'Error in AzureWebJobStorage every time I restart my computer

When I start up my azure functions project after a reboot of my computer I am getting the error below. I have worked around it by deleting files in Azure storage, but I was wondering what is going on here and how I could possibly fix the error.

[2022-03-04T16:51:23.517Z] There was an error performing a read operation on the Blob Storage Secret Repository. Please ensure the 'AzureWebJobsStorage' connection string is valid.
[2022-03-04T16:51:23.671Z] A host error has occurred during startup operation '8f35a704-d86a-4e33-947d-09d099cc767f'.
[2022-03-04T16:51:23.673Z] Azure.Storage.Blobs: Service request failed.
[2022-03-04T16:51:23.674Z] Status: 500 (Internal Server Error)
[2022-03-04T16:51:23.675Z]
[2022-03-04T16:51:23.675Z] Headers:
[2022-03-04T16:51:23.676Z] Server: Azurite-Blob/3.14.1
[2022-03-04T16:51:23.677Z] Date: Fri, 04 Mar 2022 16:51:23 GMT
[2022-03-04T16:51:23.678Z] Connection: keep-alive
[2022-03-04T16:51:23.678Z] Keep-Alive: REDACTED
[2022-03-04T16:51:23.679Z] Content-Length: 0
[2022-03-04T16:51:23.679Z] .
[2022-03-04T16:51:51.585Z] There was an error performing a read operation on the Blob Storage Secret Repository. Please ensure the 'AzureWebJobsStorage' connection string is valid.
Value cannot be null. (Parameter 'provider')
Press any to continue....[2022-03-04T16:52:15.642Z] There was an error performing a read operation on the Blob Storage Secret Repository. Please ensure the 'AzureWebJobsStorage' connection string is valid.
[2022-03-04T16:52:15.650Z] A host error has occurred during startup operation 'fbb4b0bb-bf11-4ace-98f6-42ef0ed01fd0'.
[2022-03-04T16:52:15.650Z] Azure.Storage.Blobs: Service request failed.
[2022-03-04T16:52:15.651Z] Status: 500 (Internal Server Error)


Solution 1:[1]

Here are two workarounds that you can try.

WAY - 1

Navigate to your local.settings.json, add a new setting called AzureWebJobsSecretStorageType and set it to "files".

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

WAY - 2

Delete or rename the folder C:\Users\<USERNAME>\AppData\Local\Temp\Azurite

REFERENCES:

  1. Unable to run Durable Functions with Azure Storage Emulator
  2. There was an error performing a read operation on the Blob Storage Secret Repository

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SwethaKandikonda-MT