node.js - Unable to Access Blob Trigger Using Managed Identity in Azure Functions - Stack Overflow

I am trying to access a blob trigger in Azure Functions using a managed identity but am encountering is

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
Add a comment  | 

1 Answer 1

Reset to default 0

Follow below steps to access Blob Trigger Using Managed Identity in Azure Functions.

  1. Enable Managed Identity in Azure Function App.
  2. 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

  1. Navigate to 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/

  • 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信