From 217345a4fba8436d0423e9434028ceeb350d5404 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Thu, 6 May 2021 19:14:04 -0300 Subject: [PATCH] new(all): Trainning project added. --- EstimateLoanTax/__init__.py | 20 ++++++++++---------- EstimateLoanTaxTrain/__init__.py | 17 +++++++++++++++++ EstimateLoanTaxTrain/function.json | 20 ++++++++++++++++++++ EstimateLoanTaxTrain/sample.dat | 3 +++ requirements.txt | 6 ++++++ 5 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 EstimateLoanTaxTrain/__init__.py create mode 100644 EstimateLoanTaxTrain/function.json create mode 100644 EstimateLoanTaxTrain/sample.dat diff --git a/EstimateLoanTax/__init__.py b/EstimateLoanTax/__init__.py index 2a01653..c441f91 100644 --- a/EstimateLoanTax/__init__.py +++ b/EstimateLoanTax/__init__.py @@ -1,22 +1,22 @@ import logging import azure.functions as func - +#set STORAGE_BLOB_URL='https://pythonazurestorage12345.blob.core.windows.net' def main(req: func.HttpRequest) -> func.HttpResponse: + # https://docs.microsoft.com/pt-br/azure/developer/python/azure-sdk-example-storage-use?tabs=cmd logging.info('Python HTTP trigger function processed a request.') - name = req.params.get('name') - if not name: - try: - req_body = req.get_json() - except ValueError: - pass - else: - name = req_body.get('name') + age = req.params.get('age') + income = req.params.get('income') + employeeTime = req.params.get('employeeTime') + + # Code here. + + returnedTax = 1; if name: - return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.") + return func.HttpResponse(returnedTax) else: return func.HttpResponse( "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.", diff --git a/EstimateLoanTaxTrain/__init__.py b/EstimateLoanTaxTrain/__init__.py new file mode 100644 index 0000000..44d3915 --- /dev/null +++ b/EstimateLoanTaxTrain/__init__.py @@ -0,0 +1,17 @@ +import logging + +import azure.functions as func + + +def main(req: func.HttpRequest) -> func.HttpResponse: + logging.info('Python HTTP trigger function processed a request.') + + name = req.params.get('name') + + if name: + return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.") + else: + return func.HttpResponse( + "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.", + status_code=200 + ) diff --git a/EstimateLoanTaxTrain/function.json b/EstimateLoanTaxTrain/function.json new file mode 100644 index 0000000..8c4cbe3 --- /dev/null +++ b/EstimateLoanTaxTrain/function.json @@ -0,0 +1,20 @@ +{ + "scriptFile": "__init__.py", + "bindings": [ + { + "authLevel": "anonymous", + "type": "httpTrigger", + "direction": "in", + "name": "req", + "methods": [ + "get", + "post" + ] + }, + { + "type": "http", + "direction": "out", + "name": "$return" + } + ] +} diff --git a/EstimateLoanTaxTrain/sample.dat b/EstimateLoanTaxTrain/sample.dat new file mode 100644 index 0000000..26aac46 --- /dev/null +++ b/EstimateLoanTaxTrain/sample.dat @@ -0,0 +1,3 @@ +{ + "name": "Azure" +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index bdb8fc5..edd2fc2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,9 @@ # Manually managing azure-functions-worker may cause unexpected issues azure-functions +azure-storage-blob +azure-identity +tensorflow +scikit-learn +pandas +numpy \ No newline at end of file