new(all): Trainning project added.

This commit is contained in:
Rodrigo Rodriguez 2021-05-06 19:14:04 -03:00
parent 278c8d8fa0
commit 217345a4fb
5 changed files with 56 additions and 10 deletions

View file

@ -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.",

View file

@ -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
)

View file

@ -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"
}
]
}

View file

@ -0,0 +1,3 @@
{
"name": "Azure"
}

View file

@ -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