I am trying to access a blob trigger in Azure Functions using a managed identity but am encountering issues. I have followed the instructions in the documentation and blog posts, but the issue persists.
I have already:
Despite these steps, my function still cannot access the blob trigger.
Has anyone encountered this issue or can provide further guidance on resolving this?
Environment:
Azure Functions v4 Using managed identity for authentication Blob trigger binding in JavaScript (Node.js)
Additional Question:
Is it possible to use different storage accounts for: The Azure Functions runtime (i.e., internal function execution, logs, etc.) and the trigger (i.e., blob trigger in a different storage account)?
I want to set the blob trigger in a different storage account but am unsure if this is supported or how to configure it properly.
Any insights or suggestions would be appreciated!
I am trying to access a blob trigger in Azure Functions using a managed identity but am encountering issues. I have followed the instructions in the documentation and blog posts, but the issue persists.
I have already:
Despite these steps, my function still cannot access the blob trigger.
Has anyone encountered this issue or can provide further guidance on resolving this?
Environment:
Azure Functions v4 Using managed identity for authentication Blob trigger binding in JavaScript (Node.js)
Additional Question:
Is it possible to use different storage accounts for: The Azure Functions runtime (i.e., internal function execution, logs, etc.) and the trigger (i.e., blob trigger in a different storage account)?
I want to set the blob trigger in a different storage account but am unsure if this is supported or how to configure it properly.
Any insights or suggestions would be appreciated!
Follow below steps to access Blob Trigger Using Managed Identity in Azure Functions.
Storage Account=>Access Control
assign below mentioned roles to Function App's managed identity.Storage Account Contributor
Storage Blob Data Owner
Storage Queue Data Contributor
Function App=>Settings=>Environment Variables
, delete AzureWebJobsStorage
and add below app settings:<ConnectionName>__accountName : <storageName>
<ConnectionName>__credential : managedidentity
<ConnectionName>__blobServiceUri : https://<storageName>.blob.core.windows/
<ConnectionName>__queueServiceUri : https://<storageName>.queue.core.windows/
Code Snippet:
const { app } = require('@azure/functions');
app.storageBlob('storageBlobTrigger', {
path: 'samples-workitems/{name}',
connection: 'AzureWebJobsStorage',
handler: (blob, context) => {
context.log(`Storage blob function processed blob "${context.triggerMetadata.name}" with size ${blob.length} bytes`);
}
});
Able to run the function in portal successfully: