Search code examples
azure-functions.net-6.0azurite

Azure Functions Azurite 404 BlobNotFound


After cleaning up the Azurite folder and restarting my .Net 6 Azure Functions ~4 projects, I get the following error:

Azure.RequestFailedException: 'Service request failed.
Status: 404 (The specified container does not exist.)
ErrorCode: ContainerNotFound

Headers:
Server: Azurite-Blob/3.18.0
x-ms-error-code: ContainerNotFound
x-ms-request-id: 94748aff-d2c2-492f-af58-9876fbab8338
Date: Thu, 25 Aug 2022 08:03:14 GMT
Connection: keep-alive
Keep-Alive: REDACTED
'

My Local.settings.json configuration is set to use the local development storage:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "AzureWebJobsSecretStorageType": "files"
  }
}

Nothing has changed in my project. This is an internal error coming from BlobLeaseDistributionManager.cs.

While it can connect to my local Azurite installation properly, it complains that the container does not exist. Is there a way to create this container or maybe a different solution?


Solution

  • Check your exception settings in Visual Studio.

    I had Common Language Runtime Exceptions on.

    The exception is by design, and actually, it will throw lots of times. So you can either mash the continue button, or you can reset these to default.

    Once you power through the exceptions, everything sets up correctly.

    Thanks to @Noppey for his comment above that led me to find this solution.