Closed tfrederick74656 closed 7 months ago
Hi @tfrederick74656 - thank you much for the report and contribution. Unfortunately this combination is not supported where you use the tools to create a zipdeploy package, and also configure managed identity on storage, and deploy to Linux Consumption.
The current workaround is to use a server build approach here, not using the tools to build zipdeploy package. https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies?tabs=windows
Is that acceptable to you as Azure Functions maintainers work on longer term solution?
Summary
When running the VS code starter/sample Python V2 TimerTrigger function with an identity-based connection (e.g. system-assigned managed identity and no
AzureWebJobsStorage
app setting), no functions are loaded. I'm not sure if this is a bug, if there's a documentation oversight, or if I'm simply missing a step.Investigative information
Repro steps
Storage Blob Data Owner
role on the storage account, as documented here for both "No extension" and "Timer trigger".AzureWebJobsStorage
app setting and addAzureWebJobsStorage__accountName
with the name of the storage account as the value, as documented here.Expected behavior
The function app should execute normally.
Actual behavior
The function never executes and the following is observed in log stream and traces:
Additionally, the function does not appear in the Functions blade of the Function App.
Known workarounds
When the
AzureWebJobsStorage
app setting is in place, the function app works as expected -- the function is listed in the portal blade, loads, and executes successfully on the default 1-minute timer interval. It is only when using theAzureWebJobsStorage__accountName
app setting and identity-based connection that the function fails to load.Related information
Source
**function_app.py** ```python import datetime import logging import azure.functions as func app = func.FunctionApp() @app.schedule(schedule="0 * * * * *", arg_name="myTimer", run_on_startup=True, use_monitor=False) def TimerTrigger(myTimer: func.TimerRequest) -> None: utc_timestamp = datetime.datetime.utcnow().replace( tzinfo=datetime.timezone.utc).isoformat() if myTimer.past_due: logging.info('The timer is past due!') logging.info('Python timer trigger function ran at %s', utc_timestamp) ``` **host.json** ```json { "version": "2.0", "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": true, "excludedTypes": "Request" } } }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[4.*, 5.0.0)" } } ``` **requirements.txt** ``` # DO NOT include azure-functions-worker in this file # The Python Worker is managed by Azure Functions platform # Manually managing azure-functions-worker may cause unexpected issues azure-functions ``` **Environment Variables** ```json [ { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "********-****-****-****-************", "slotSetting": false }, { "name": "APPLICATIONINSIGHTS_CONNECTION_STRING", "value": "InstrumentationKey=********-****-****-****-************;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/", "slotSetting": false }, { "name": "AzureWebJobsFeatureFlags", "value": "EnableWorkerIndexing", "slotSetting": false }, { "name": "AzureWebJobsStorage__accountName", "value": "devtjffuncpythontest", "slotSetting": false }, { "name": "FUNCTIONS_EXTENSION_VERSION", "value": "~4", "slotSetting": false }, { "name": "FUNCTIONS_WORKER_RUNTIME", "value": "python", "slotSetting": false }, { "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", "value": "DefaultEndpointsProtocol=https;AccountName=devtjffuncpythontest;AccountKey=****************************************************************************************;EndpointSuffix=core.windows.net", "slotSetting": false }, { "name": "WEBSITE_CONTENTSHARE", "value": "dev-tjf-functions-python-testa876", "slotSetting": false } ] ```