简体   繁体   English

如何将 Azure 函数的 AzureWebJobsStorage 设置为 Azurite 存储?

[英]How to set AzureWebJobsStorage of Azure Functions to Azurite storage?

I'm trying to use Azurite as local storage for Azure Functions.我正在尝试使用 Azurite 作为 Azure 函数的本地存储。 I have installed Azurite as Extension in Visual Studio Code.我已经在 Visual Studio Code 中安装了 Azurite 作为扩展。 I can access to Azurite with Storage Explorer.我可以使用存储资源管理器访问 Azurite。

I tried to use "AzureWebJobsStorage": "UseDevelopmentStorage=true", but did not work.我尝试使用“AzureWebJobsStorage”:“UseDevelopmentStorage=true”,但没有奏效。

Next I took AzureWebJobsStorage from following site asssuming that default account key is always same.接下来,我从以下站点获取 AzureWebJobsStorage,假设默认帐户密钥始终相同。 (is it?) https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio-code (是吗?) https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio-code

What is correct AzureWebJobsStorage?什么是正确的 AzureWebJobsStorage?

local.settings.json 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;"    
    
  }
}

Error:错误:

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')
  1. By default AzureWebJobsStorage is null in local.settings.json默认情况下, AzureWebJobsStoragelocal.settings.json中的 null
  2. To connect to your storage account from the local code, below code will helps you to connect to your storage account endpoint要从本地代码连接到您的存储帐户,下面的代码将帮助您连接到您的存储帐户端点
{  
"IsEncrypted": false,  
"Values": {  
"AzureWebJobsStorage": "",  
"FUNCTIONS_WORKER_RUNTIME": "python",  
"MyStorageConnectionAppSetting":"DefaultEndpointsProtocol=https;AccountName=0730bowmanwindow;AccountKey=xxxxxx;EndpointSuffix=core.windows.net"  
}  
}  

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 Azurite blob 容器用作 Azure Function 内部存储和触发器? - How to use Azurite blob containers as Azure Function internal storage and as trigger? Azure 函数 Azurite 404 BlobNotFound - Azure Functions Azurite 404 BlobNotFound 什么是azure函数AzureWebJobsStorage和AzureWebJobsSecretStorageType设置的用途 - What is use of azure functions AzureWebJobsStorage and AzureWebJobsSecretStorageType settings 我们可以使用本地 SQL Server 作为 AzureWebJobsStorage 运行容器化的 Azure Functions 吗? - Can we run containerized Azure Functions with local SQL Server as the AzureWebJobsStorage? 使用 Azurite 的 Azure 存储资源管理器中的错误:第一个参数必须是字符串类型或缓冲区实例 - Error in Azure Storage Explorer with Azurite : The first argument must be of type string or an instance of Buffer 如何为Azure功能设置MaxReceivedMessageSize - How to set MaxReceivedMessageSize for Azure Functions Azure 功能 临时存储 - Azure Functions Temp storage Azure函数Python blobTrigger如何修复“Microsoft.Azure.WebJobs.Extensions.Storage:对象引用未设置为对象的实例。”? - Azure Functions Python blobTrigger How do I fix “Microsoft.Azure.WebJobs.Extensions.Storage: Object reference not set to an instance of an object.”? Azure功能存储建议 - Azure functions storage recommandation 如何通过绑定将记录从Azure函数添加到Azure表存储中? - How to add record to Azure Table Storage from Azure Functions with binding?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM