I am working on one of the Azure Function which is written in Python and it should get called based on Blob trigger event. However, the trigger is not firing when I am uploading a zip file in a blob container to which azure function is supposed to monitor.
Following is local.settings.json file -
{
"IsEncrypted": false,
"Values":
{
"AzureWebJobsStorage": "blob (connection string) that was created when Azure function is created",
"FUNCTIONS_WORKER_RUNTIME": "python",
"My_STORAGE": "blob (connection string) that function should monitor"
}
}
Following is function.json file -
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "mycontainer/{name}",
"connection": "My_STORAGE"
}
]
}
Following is my code init.py - (test_func is user defined function to do some business logic)
def main(myblob: func.InputStream):
test_func(myblob.name)
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {myblob.length} bytes")
When I'm uploading zip file in "mycontainer" container, the azure function is not firing.
The "mycontainer" of StorageV2 (general purpose v2) account kind. I am using Python 3.8 version.
This "mycontainer" has automatically created a container named $logs that has day wise folder to have a log file mentioning the file that I'm uploading in "mycontainer", however, there is no sign of blob trigger event on Azure function.
"My_STORAGE" is added as Application Settings in Azure Function's Configuration settings. I am uploading Local Settings after Azure Function deployment.
Any idea what is going wrong?
Thank you.
test_func(myblob.name)
? – Hury Shenfunc host start
in your VS code Terminal window to start your function. – Hury ShenMy_STORAGE
in application settings of your function app on portal. "local.settings.json" will not be deployed to azure portal when you do deployment. – Hury Shen