0

我正在尝试将 Azurite 用作 Azure Functions 的本地存储。我已经在 Visual Studio Code 中安装了 Azurite 作为扩展。我可以使用存储资源管理器访问 Azurite。

我尝试使用“AzureWebJobsStorage”:“UseDevelopmentStorage=true”,但没有奏效。

接下来,我从以下站点获取 AzureWebJobsStorage,假设默认帐户密钥始终相同。(是吗?) https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio-code

什么是正确的 AzureWebJobsStorage?

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"    
    
  }
}

错误:

There was an error performing a read operation on the Blob Storage Secret Repository. Please 
ensure the 'AzureWebJobsStorage' connection string is valid.
[2021-11-25T10:22:16.575Z] A host error has occurred during startup operation '8835ef12-63da- 
 4108-a1ca-5231dbb471d4'.
[2021-11-25T10:22:16.578Z] Azure.Core: No connection could be made because the target machine 
actively refused it. System.Net.Http: No connection could be made because the target machine 
actively refused it. System.Private.CoreLib: No connection could be made because the target 
machine actively refused it.
[2021-11-25T10:22:54.238Z] 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')
4

1 回答 1

0
  1. 默认AzureWebJobsStorage为空local.settings.json
  2. 要从本地代码连接到您的存储帐户,下面的代码将帮助您连接到您的存储帐户端点
{  
"IsEncrypted": false,  
"Values": {  
"AzureWebJobsStorage": "",  
"FUNCTIONS_WORKER_RUNTIME": "python",  
"MyStorageConnectionAppSetting":"DefaultEndpointsProtocol=https;AccountName=0730bowmanwindow;AccountKey=xxxxxx;EndpointSuffix=core.windows.net"  
}  
}  
于 2021-11-25T11:47:52.827 回答