You are developing a secure web application that runs on an Azure Virtual Machine. The application must generate a temporary URI to allow external clients to download PDF reports from a private Azure Blob Storage container named reports. To meet security requirements, you must not use storage account keys. Instead, you configure a User-Assigned Managed Identity for the Virtual Machine. In the application code, you successfully request a User Delegation Key and build a Shared Access Signature (SAS) token using the Azure.Storage.Blobs SDK. The SAS token is configured with read permissions and a lifetime of hour. However, when external clients attempt to download a report using the generated SAS URI, they receive an HTTP (Forbidden) error. You verify that the Virtual Machine's managed identity has been assigned the Storage Blob Delegator role at the storage account level. Which action should you perform to resolve the HTTP error?
- AAdd the List permission (BlobSasPermissions.List) when building the BlobSasBuilder object.
- BConfigure a Stored Access Policy on the reports container and associate its identifier with the BlobSasBuilder object.
- Assign the Storage Blob Data Reader role to the managed identity at the storage account or container level.Answer
- DGrant the managed identity the Key Vault Secrets User role to allow it to retrieve the storage account's primary access key.