How to fix Error response 404 The specified blob does not exist?

Jesse Zhao 0 Reputation points
2024-06-27T09:05:26.03+00:00

2024-06-27T08:55:18Z [Warning] Error response [0c8f4843-79f3-411c-8268-bf6158e1728a] 404 The specified blob does not exist. (00.0s)User's imageUser's image

User's image

The error message is here. I tried to build a HTTP-triggered function app that can read from blob storage and write into blob storage. I am sure the blob storage exists, but seems my function app cannot find it.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,614 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 20,375 Reputation points Microsoft Employee
    2024-07-03T05:49:30.49+00:00

    @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:

    1. Firstly, please ensure that the container with the name outcontainer exists. You can create one in your storage account if it doesn't exit.
    2. Please check and confirm if this is working fine locally in your dev environment (before deploying it to Azure).
    3. Please confirm if you are using HTTPTrigger or Blob Trigger. Because your logging statement is little confusing.
      User's image
    4. Please confirm which Python programming model you are using ? V1 or V2 ?
    5. 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.

    0 comments No comments