每次重新启动计算机时 AzureWebJobStorage 都会出错

zac*_*ary 2 azure-functions azurite

当我重新启动计算机后启动我的 azure 函数项目时,出现以下错误。我已经通过删除 Azure 存储中的文件来解决这个问题,但我想知道这里发生了什么以及如何修复该错误。

[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)
Run Code Online (Sandbox Code Playgroud)

Swe*_*nda 7

您可以尝试以下两种解决方法。

方式-1

导航到local.settings.json,添加一个名为 的新设置AzureWebJobsSecretStorageType并将其设置为"files"

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "AzureWebJobsSecretStorageType": "files"
  }
}
Run Code Online (Sandbox Code Playgroud)

方式-2

删除或重命名文件夹 C:\Users\<USERNAME>\AppData\Local\Temp\Azurite

参考:

  1. 无法使用 Azure 存储模拟器运行 Durable Functions
  2. 对 Blob 存储秘密存储库执行读取操作时出错