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:
- Enabled managed identity for the Function App.
- Assigned the required permissions to the managed identity on the Azure Blob Storage account.
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:
- Enabled managed identity for the Function App.
- Assigned the required permissions to the managed identity on the Azure Blob Storage account.
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!
Share Improve this question asked Mar 5 at 23:27 Hiten SamaliaHiten Samalia 591 silver badge8 bronze badges 2- Can you please share the code which you have tried? and recheck the path of the blob once. – Pavan Commented Mar 6 at 3:36
- For your additional question. It is in fact recommended that the storage which is used by your function is not shared with any other resource. So for POC or Dev it is fine, but otherwise, keep your Function storage and your blob trigger storage accounts separate. – Anupam Chand Commented Mar 6 at 4:24
1 Answer
Reset to default 0Follow below steps to access Blob Trigger Using Managed Identity in Azure Functions.
- Enable Managed Identity in Azure Function App.
- Go to
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
- Navigate to
Function App=>Settings=>Environment Variables
, deleteAzureWebJobsStorage
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/
- Created a NodeJs V4 Blob trigger Azure function.
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:
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745002649a4605592.html
评论列表(0条)