I have the following simple Azure Function written in Python. It is an HTTP trigger that should simply return the name and URI of the blob input binding from an Azure storage account (reference documentation from Microsoft here).
import logging
import azure.functions as func
import azure.storage.blob
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
def main(req: func.HttpRequest, inputblob: func.InputStream) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
return func.HttpResponse(f"Blob name: {inputblob.name}. Blob URI: {inputblob.uri}")
My function.json file looks like this. I've verified that the connection string in local.settings.json is correct and that the blob path is correct too.
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"name": "inputblob",
"type": "blob",
"path": "containername/testblobname.json",
"connection": "MyStorageConnectionAppSetting",
"direction": "in"
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
]
}
Now, this function returns "JSON name: None. JSON URI: None". Clearly the blob input binding is not working. How do I troubleshoot this, or what am I missing?