Courseiva
Develop Azure compute solutionshardMultiple SelectObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

A report export service in Azure App Service must safely access Key Vault secrets without connection strings in configuration. Which two steps are required?

⚠ Common exam trap

Many exam-takers think storing the Key Vault URI or a reference in app settings is sufficient, but the question explicitly requires 'without connection strings in configuration,' so the correct path is to use managed identity plus granting permissions, not storing any key material.

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

Grant the identity permission to read the required secrets

Granting the managed identity permission to read secrets in Key Vault via Azure RBAC or access policies ensures that the App Service can authenticate without storing any secrets in configuration. This follows the principle of least privilege and eliminates the risk of credential leakage from app settings or connection strings.

Answer analysis

Option-by-option breakdown

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

  • Enable anonymous access on the vault

    Why it's wrong here

    Azure Key Vault is specifically designed to secure sensitive information like cryptographic keys, secrets, and certificates. Enabling anonymous access would fundamentally compromise its core security purpose, allowing any unauthenticated request to retrieve or manipulate these critical assets. Key Vault strictly enforces authentication and authorization for all operations, making anonymous access an invalid and highly insecure configuration that is not permitted.

  • Store the Key Vault access key in app settings

    Why it's wrong here

    Azure Key Vault does not utilize "access keys" in the same manner as some other Azure services like Storage Accounts; instead, access is primarily granted to Azure Active Directory (Azure AD) identities. Storing any form of credential, such as a client secret or certificate, directly within app settings for Key Vault authentication defeats the primary security benefit of Key Vault, which is to centralize and protect credentials from application code and configuration files, making it a poor security practice.

  • Grant the identity permission to read the required secrets

    Why this is correct

    After an identity (such as a managed identity) is established for the Azure App Service, it must be explicitly authorized to perform specific operations within Azure Key Vault. This authorization is achieved by assigning appropriate permissions, typically through Azure Role-Based Access Control (RBAC) roles like "Key Vault Secrets User" or by configuring an access policy directly on the Key Vault, granting "Get" and "List" secret permissions to the service principal. This ensures the principle of least privilege is followed.

  • Enable a managed identity for the web app

    Why this is correct

    Enabling a managed identity for the Azure App Service provides it with an automatically managed identity in Azure Active Directory (Azure AD). This eliminates the need for developers to manually manage credentials, such as connection strings or client secrets, within the application code or configuration files. The App Service can then use this Azure AD identity to securely authenticate to other Azure services, like Key Vault, without storing any secrets itself, significantly enhancing security and simplifying credential management.

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

Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.