From 1b7a9d58bb3b78bc1ca894eb65e7f3bdd76d292a Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 16 May 2024 17:14:40 +0700 Subject: [PATCH] Testing Azure Function --- function_app.py | 1 + host.json | 17 ++++++++--------- localsettings.json | 0 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 localsettings.json diff --git a/function_app.py b/function_app.py index fee4ad5..ad7705e 100644 --- a/function_app.py +++ b/function_app.py @@ -40,6 +40,7 @@ def tokenize_text(x): return ' '.join(list(filter(lambda y: y.replace(' ', ''), word_tokenize(filter_thai(x))))) +@flask_app.function_name(name="GetProducts") @flask_app.post("/predict") def run_ai(): if request.headers['aikey'] == os.environ['AIKEY']: diff --git a/host.json b/host.json index 21c4836..c05791f 100644 --- a/host.json +++ b/host.json @@ -1,20 +1,19 @@ { "version": "2.0", - "logging": - { - "applicationInsights": - { - "samplingSettings": - { + "logging": { + "applicationInsights": { + "samplingSettings": { "isEnabled": true, "excludedTypes": "Request" } + }, + "logLevel": { + "default": "Trace" } }, - "extensionBundle": - { + "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", - "version": "[2.*, 3.0.0)" + "version": "[4.*, 5.0.0)" }, "extensions": { diff --git a/localsettings.json b/localsettings.json new file mode 100644 index 0000000..e69de29