Courseiva
Implement Azure securityeasyMultiple ChoiceObjective-mapped

AZ-204 Implement Azure security Practice Question

Your Azure App Service app must access Azure Key Vault secrets without storing credentials in code. Which service should you use to manage identities?

⚠ Common exam trap

Many exam-takers confuse service principals (which require credential storage) with managed identities (which are credential-free), leading them to pick option A because they think any Azure AD identity is equivalent.

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

Managed identity

Managed identity (B) is correct because it provides an automatically managed Azure AD identity for your App Service app, allowing it to authenticate to Azure Key Vault without storing any credentials in code or configuration. The identity is tied to the app's lifecycle and can be used with Azure RBAC to grant access to secrets, eliminating the need for manual credential management.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Service principal with client secret

    Why it's wrong here

    Using a service principal with a client secret for Azure Key Vault access requires the client secret itself to be stored securely within the App Service configuration or code. This approach reintroduces the fundamental security challenge of managing and rotating credentials, which Key Vault is designed to mitigate. It creates a dependency where the App Service's ability to access Key Vault is contingent on the secure handling of this sensitive secret, undermining the 'secretless' access principle.

  • Managed identity

    Why this is correct

    Managed identities provide an identity for Azure services in Azure Active Directory, eliminating the need for developers to manage credentials. When an App Service uses a managed identity, Azure automatically handles the authentication to Azure AD and acquires access tokens to interact with other Azure resources like Key Vault. This approach significantly enhances security and simplifies operations by removing the burden of credential storage, rotation, and protection from the application.

  • Storage account access key

    Why it's wrong here

    Storage account access keys are high-privilege credentials specifically designed for authenticating and authorizing access to an Azure Storage account's data, such as blobs, files, queues, and tables. These keys are entirely distinct from the authentication mechanisms used by Azure Key Vault, which relies on Azure Active Directory for identity and access management. Therefore, storage account access keys are irrelevant and cannot be used to gain access to secrets stored within Azure Key Vault.

  • Client certificate

    Why it's wrong here

    While client certificates can be used for authentication in some scenarios, employing them for an App Service to access Key Vault introduces significant operational overhead. Certificates require secure storage within the App Service environment, and their lifecycle must be meticulously managed, including issuance, renewal, and revocation. This management complexity, coupled with the need to securely deploy and update certificates, defeats the purpose of seeking a simplified, credential-free access method like managed identities.

Quick reference

Access Control Model Comparison

ModelAcronymWho Controls Access?Best For
Discretionary Access ControlDACResource ownerSmall teams, file shares
Mandatory Access ControlMACSystem / security labelsClassified govt / military
Role-Based Access ControlRBACAdministrator (via roles)Enterprise environments
Attribute-Based Access ControlABACPolicy engine (user + resource attributes)Fine-grained, dynamic policies
Rule-Based Access ControlRuBACSystem rules / ACLsFirewall rules, network ACLs

Go deeper

Related to this question

About these practice questions

This AZ-204 question is part of Courseiva's 881-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 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-204 exam.