0

I'm trying to use Azurite as local storage for Azure Functions. I have installed Azurite as Extension in Visual Studio Code. I can access to Azurite with Storage Explorer.

I tried to use "AzureWebJobsStorage": "UseDevelopmentStorage=true", but did not work.

Next I took AzureWebJobsStorage from following site asssuming that default account key is always same. (is it?) https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio-code

What is correct 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;"    
    
  }
}

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')
Kenny_I
  • 2,001
  • 5
  • 40
  • 94

1 Answers1

0
  1. By default AzureWebJobsStorage is null in local.settings.json
  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"  
}  
}  
SaiSakethGuduru
  • 2,218
  • 1
  • 5
  • 15
  • I get Function working correctly if I set Azure Storage endpoint to AzureWebJobsStorage. Need help to with Azurite endpoint. – Kenny_I Nov 25 '21 at 13:41