First I followed the instructions to get a Function Application running. https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-python
After successfull creation of the application, I've deployed a small HTTP triggered function to Azure for testing purposes.
My function is written in python. I am using a Linux OS for pushing to Azure. Everything looks fine.
I use this statement for publishing: func azure functionapp publish myApp --publish-local-settings
After successfull deployment to Azure, I've tried to reach "https://myAppName.azurewebsites.net", which gives me at first a Site with Error Code 502. After a few minutes it change its status and I get the welcome page of the Azure Functions.
If I try to reach the function directly via: https://myAppName.azurewebsites.net/api/functionName
I get an 502.. Even after waiting 30 Minutes, the function is still not running correctly..
Please let me know, if you have related useful information.
Take a look in the "Application Insights" shows some more information:
09:55:40 | Trace@(none)
Hosting stopping
09:55:40 | Exception | HostInitializationException@(none)
Did not find functions with language [python].
09:55:40 | Trace@(none)
A host error has occurred
09:55:40 | Trace@(none)
Creating function descriptors.
09:55:40 | Trace@(none)
Adding Function descriptor provider for language python.
09:55:40 | Trace@(none)
1 proxies loaded
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 not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')
if name:
return func.HttpResponse(f"Hello {name}!")
else:
return func.HttpResponse(
"Please pass a name on the query string or in the request body",
status_code=400
)
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
]
}
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "python"
}
}
{
"version": "2.0"
}


