I set up an Azure Functions app with Python in VS code. After creating a couple of http triggers, I wanted to create a Blobtrigger called xml-update. All worked well until I tried deploying it. The Functions app returns 404's. How can I debug this?
I have a Blob container in Azure Storage called xml-feed with a blob called jobs.json. When I deploy the Function App with these bindings (and boilerplate function code)...
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "xml-feed/jobs.json",
"connection": "AzureWebJobsStorage"
}
]
}
...the app exclusively returns 404's.
When I developed the BlobTrigger function locally, I was able to read and write without any problems. (To the actual cloud storage, not a local emulation.) The Function App logs show the folowing error:
The following function.json restores the Function App's functionality, although this function is rendered useless.
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "",
"connection": "AzureWebJobsStorage"
}
]
}
If path is anything else than an empty string, the problem occurs. (Even if it is an ordinary string, which makes me suspicious of the invalid character error.) I haven't been able to dig up much more. I checked the connection string in Application Settings, fiddled with Storage permissions, but was unable to find the cause.
EDIT: Boilerplate function code:
import logging
import azure.functions as func
def main(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {myblob.length} bytes")
