Search code examples
c#.netazurepermissionsazure-blob-storage

Can we give Storage blob data contributor permission to Azure app registration?


I know we can give the role to user but is it possible to give storage blob data contributor permission to azure app ?

And if yes, can I request a user delegation key when I provide the app's config in env variable since I used DefaultAzureCredential() in the code ? Do the app need any specific role for itself to do that ?


Solution

  • Is it possible to give storage blob data contributor permission to azure app ?

    Yes, that is possible.
    Easiest solution would be to use Managed Identities since they already work with the DefaultAzureCredential() implementation. If the configuration of Managed Identities for your application is fairly simple, you don't even have to specify anything in variables.

    For more information, see What are managed identities for Azure resources? and the links under Next Steps. For instance How to use managed identities for App Service and Azure Functions.