AZ-104 Manage Azure Identities and Governance Practice Question
Exhibit
Web app configuration: - Name: orders-web - Current authentication method: client secret stored in application settings - Requirement: Access Azure resources without storing credentials in the app - Additional requirement: When the app is deleted, the identity should be removed automatically.
Based on the exhibit, which identity should the administrator enable to remove the secret from app settings and have the identity disappear automatically when the app is deleted?
⚠ Common exam trap
Candidates often confuse user-assigned managed identities with system-assigned ones, assuming both are automatically deleted with the resource, but only the system-assigned identity is tied to the resource's lifecycle.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
System-assigned managed identity
The system-assigned managed identity is tied directly to the lifecycle of the Azure resource (e.g., an App Service). When you enable it, Azure automatically creates a service principal in Azure AD for that resource, and you can use the identity to access Azure Key Vault without storing secrets in app settings. When the resource is deleted, the system-assigned managed identity and its corresponding service principal are automatically removed, eliminating the need for manual cleanup.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
User-assigned managed identity
Why it's wrong here
A user-assigned managed identity is a standalone Azure AD identity that can be assigned to multiple resources and has an explicit lifecycle managed independently of any single app. Because it remains after the web app is deleted, it requires separate deletion steps and can leave an orphaned identity behind, which complicates security audits and the principle of using the identity only for one resource. In contrast, a system-assigned identity is created and removed together with the app, so this option does not meet the goal of an identity that automatically follows the resource.
When this WOULD be correct
A user-assigned managed identity would be correct if the question asked for an identity that can be shared across multiple Azure resources (e.g., multiple VMs or apps) and must persist even after one resource is deleted, or if the identity needs to be pre-created and assigned to resources in different regions.
- ✗
Service principal with a client secret
Why it's wrong here
A service principal backed by a client secret still requires the secret to be created with a defined expiry date (typically one or two years) and stored in the app's configuration, environment variables, or a key vault reference. This setup introduces ongoing secret rotation and storage concerns, which is precisely the operational overhead that managed identities eliminate by removing the credential entirely. Moreover, the client secret is a static credential that could leak, unlike a system-assigned managed identity which obtains ephemeral tokens through Azure's control plane.
When this WOULD be correct
This option would be correct if the question required an identity that can be used for authentication outside of Azure (e.g., for an on-premises application) and the administrator is willing to manage the secret lifecycle manually, with no requirement for automatic cleanup.
- ✓
System-assigned managed identity
Why this is correct
A system-assigned managed identity is tied directly to the Azure resource, so it is created with the app and removed when the app is deleted. It is the best fit when you want to eliminate stored secrets and keep the identity lifecycle aligned to one resource.
- ✗
Shared access signature
Why it's wrong here
A shared access signature is a delegated URI token that grants granular, time-limited permissions only to specific Azure Storage resources (blobs, queues, tables). It is not an identity in Azure AD and cannot be used to authenticate a web app to Microsoft Graph, Azure SQL, or other services beyond storage. Additionally, the SAS string itself must be generated, distributed, and refreshed, which means a credential still lives somewhere in the application configuration, reintroducing the exact secret-storage problem a managed identity solves.
When this WOULD be correct
When the question asks for a method to grant time-limited, delegated access to a specific Azure Storage resource (e.g., blob or queue) without sharing account keys, and the access should be revocable by expiry or policy.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.
✓System-assigned managed identityCorrect answer▾
Why this is correct
A system-assigned managed identity is tied directly to the Azure resource, so it is created with the app and removed when the app is deleted. It is the best fit when you want to eliminate stored secrets and keep the identity lifecycle aligned to one resource.
✗User-assigned managed identityWrong answer — click to see why▾
Why this is wrong here
User-assigned managed identities are not automatically deleted when the associated app is deleted; they persist independently until explicitly removed. The question requires an identity that disappears automatically with the app, which is a property of system-assigned managed identities.
★ When this WOULD be the correct answer
A user-assigned managed identity would be correct if the question asked for an identity that can be shared across multiple Azure resources (e.g., multiple VMs or apps) and must persist even after one resource is deleted, or if the identity needs to be pre-created and assigned to resources in different regions.
Why candidates choose this
Candidates may confuse user-assigned with system-assigned managed identities, or think that all managed identities are automatically deleted with the resource, overlooking the key difference that user-assigned identities have a separate lifecycle.
✗Service principal with a client secretWrong answer — click to see why▾
Why this is wrong here
A service principal with a client secret is not automatically deleted when the app is deleted; it must be manually removed. It also requires storing a secret in app settings, which contradicts the requirement to remove the secret.
★ When this WOULD be the correct answer
This option would be correct if the question required an identity that can be used for authentication outside of Azure (e.g., for an on-premises application) and the administrator is willing to manage the secret lifecycle manually, with no requirement for automatic cleanup.
Why candidates choose this
Candidates may confuse service principals with managed identities, thinking both provide similar functionality, and may not realize that service principals require manual secret management and deletion.
✗Shared access signatureWrong answer — click to see why▾
Why this is wrong here
A shared access signature (SAS) is a token granting limited access to Azure Storage resources, not an identity for an app. It cannot be used to remove secrets from app settings or automatically disappear when the app is deleted.
★ When this WOULD be the correct answer
When the question asks for a method to grant time-limited, delegated access to a specific Azure Storage resource (e.g., blob or queue) without sharing account keys, and the access should be revocable by expiry or policy.
Why candidates choose this
Candidates may confuse SAS with managed identities because both involve temporary access, but SAS is for storage access, not for app identity or automatic lifecycle management.
Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Privileged Identity Management (PIM)
Key term
Azure Key Vault
Azure Key Vault is a cloud service for securely storing and managing sensitive information like passwords, encryption keys, and certificates.
Key term
Managed identity
A managed identity is an automatically managed service principal in Azure that allows your code to authenticate to any service that supports Azure AD authentication without storing credentials.
About these practice questions
This AZ-104 question is part of Courseiva's 1,049-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-104 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-104 exam.