@Jesse Zhao Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
.
Apologies for the late reply. Please confirm if you are still encountering the same issue.
.
Here are the few things you need to check:
- Firstly, please ensure that the container with the name outcontainer exists. You can create one in your storage account if it doesn't exit.
- Please check and confirm if this is working fine locally in your dev environment (before deploying it to Azure).
- Please confirm if you are using HTTPTrigger or Blob Trigger. Because your logging statement is little confusing.
- Please confirm which Python programming model you are using ? V1 or V2 ?
- If you are using v1 programming model, You need to check your function.json and ensure that you have the necessary settings like below:
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "MySampleContainer/{blobname}",
"connection": "MyStorageConnectionString"
}
]
}
Here the path
option defines the path for the blob storage where we are listening to. Currently, we are listening to all new files created in the blob storage path MySampleContainer/
. I hope you have added the right container name here. Also check if the connectionstring
of the right Storage account is added.
.
6.If you are using v2 programming model, you could try with the below sample code:
import logging
import azure.functions as func
app = func.FunctionApp()
@app.function_name(name="BlobTrigger1")
@app.blob_trigger(arg_name="myblob",
path="PATH/TO/BLOB",
connection="CONNECTION_SETTING")
def test_function(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {myblob.length} bytes")
If the above action plan doesn't help, Please let me know, I would be happy to help.