Configuring Azure blob storage with RBAC access in Azure function

lakshmi 816 Reputation points
2024-02-19T17:01:31.6166667+00:00

Hi Team, We have enabled RBAC access for Cosmos and Blob storage. We have configured the blob storage and cosmos client with the service endpoint and default azure credentials in azure web app and we are able to access the cosmos data and storage tables and blob. Same configuration we have made in Azure functions. Below is the JSON file,

"AzureWebJobsStorage__blobServiceUri": "https://<account name>.blob.core.windows.net/",


Startup File:

builder.Services.AddSingleton<IStorage>(_ => new BlobsStorage(new Uri($"{Environment.GetEnvironmentVariable("AzureWebJobsStorage__blobServiceUri")}{Environment.GetEnvironmentVariable(<ContainerName>)}"), new DefaultAzureCredential(), new StorageTransferOptions(), new BlobClientOptions()));

While building the code we are getting the below error,


[2024-02-19T16:43:38.310Z] Microsoft.Azure.WebJobs.Script.WebHost: Secret initialization from Blob storage failed due to missing both an Azure Storage connection string and a SAS connection uri. For Blob Storage, please provide at least one of these. If you intend to use files for secrets, add an App Setting key 'AzureWebJobsSecretStorageType' with value 'Files'.
Value cannot be null. (Parameter 'provider')



Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,656 Reputation points Microsoft Employee Moderator
    2024-02-22T14:15:59.4866667+00:00

    @lakshmi In addition to your own code, the Azure Functions Runtime uses Azure Storage as well and needs to be configured appropriately as well as shown in the official docs.

    I assume you are not using the Storage Binding due to the Startup Code you shared. So you could also consider using a different App Setting Name for your client and continue using the regular one for the functions runtime.

    If you intend to use Managed Identity across the board, then follow the docs linked above for the functions runtime including the common set of app settings required.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.