You are developing an ASP.NET Core web application that will be hosted on an Azure App Service. The application must securely read blobs from an Azure Storage container. You decide to use a user-assigned managed identity to handle authentication.
Which sequence of steps should you perform to provision, configure, and utilize the user-assigned managed identity to access the storage container?
- 1Create a user-assigned managed identity in Microsoft Entra ID.
- 2Associate the user-assigned managed identity with the Azure App Service instance.
- 3Assign the Storage Blob Data Reader RBAC role to the user-assigned managed identity at the storage container scope.
- 4Instantiate the DefaultAzureCredential class in the application code, passing the Client ID of the user-assigned managed identity to the constructor options.
Cevap
The correct sequence is to first create the user-assigned managed identity, then associate it with the Azure App Service instance, then assign the Storage Blob Data Reader RBAC role to the identity at the storage container scope, and finally instantiate the DefaultAzureCredential class in the application code by passing the Client ID of the identity to the constructor options.
The correct sequence begins with provisioning the user-assigned managed identity. Once created, the identity is linked to the App Service hosting environment. Next, the identity is granted the Storage Blob Data Reader role to authorize access. Finally, the application code initiates authentication using DefaultAzureCredential configured with the identity's Client ID.
Adım Adım Çözüm
Anahtar Kavram
Provisioning and configuring a user-assigned managed identity for Azure App Service authorization