A Python app running on an Azure VM must upload blobs to one container in a storage account. The app must not store a storage account key or SAS token on the VM. Which two actions should the administrator take? Select two.
A system-assigned managed identity lets the VM request Azure access tokens without storing secrets on the server. The identity is automatically created and tied to that VM, which fits a simple single-VM app. This is the safest starting point when a workload must authenticate to Azure Storage without an account key or SAS token.
Why this answer
A system-assigned managed identity on the VM allows Azure AD authentication without storing any credentials on the VM. By assigning the Storage Blob Data Contributor role to that identity at the container scope, the app can use Azure AD tokens to authenticate and upload blobs, eliminating the need for a storage account key or SAS token.
Exam trap
The trap here is that candidates often confuse the Contributor role (which grants management-level access) with the Storage Blob Data Contributor role (which grants data-plane access), and may overlook that scoping the role to the container (rather than the storage account or resource group) is the most secure and correct approach.
Why the other options are wrong
The question explicitly requires that the app must not store a storage account key on the VM. Storing the key in an environment variable still places the key on the VM, violating the requirement.
The question explicitly states the app must not store a SAS token on the VM. Generating a service SAS and copying it into the application configuration violates this requirement.
The Contributor role at the resource group scope grants full management access to all resources in the group, but does not include the specific data permissions (e.g., Storage Blob Data Contributor) needed to upload blobs. Managed identities require a data role on the storage container or account to access blob data.