Skip to main content
  1. Home
  2. >
  3. Azure
  4. >
  5. AZ-305
  6. >
  7. Key Vault vs App Config for Secrets | Azure AZ-305

Key Vault vs App Config for Secrets | Azure AZ-305

Jeff Taakey
Author
Jeff Taakey
21+ Year Enterprise Architect | Multi-Cloud Architect & Strategist.

While preparing for the AZ-305 Design: Secure Cloud Solutions exam, many candidates wrestle with integrating Azure Key Vault secrets into App Services following the principle of least privilege. In real-world enterprise design, the choice balances security, operational simplicity, and minimal application code changes. Let’s drill into a simulated migration scenario that demonstrates the ideal approach.

The Scenario
#

Fabrikam Manufacturing operates a global portfolio of line-of-business web applications hosted in Azure App Service. They recently adopted system-assigned managed identities for their web apps to streamline authentication patterns. As part of their governance initiative aligned with the Microsoft Cloud Adoption Framework (CAF), Fabrikam wants to securely store connection strings and API keys in Azure Key Vault. The solution must minimize code changes on the web apps and strictly adhere to least privilege access principles.

Key Requirements
#

Ensure the web applications retrieve secrets from Azure Key Vault securely, minimizing application code changes while following least privilege security principles.

The Options
#

  • A) Use Key Vault references in the Azure App Service application settings
  • B) Assign the “Secrets: Get” permission directly to application users in Key Vault
  • C) Implement client credential grant flow in the application for Key Vault access
  • D) Query Azure Instance Metadata Service (IMDS) endpoint to authenticate

Correct Answer
#

Option A A) Use Key Vault references in the Azure App Service application settings.

Step-by-Step Winning Logic
#

Using Key Vault references in Azure App Service application settings takes advantage of system-assigned managed identities to authenticate securely and transparently. This eliminates code changes since the platform handles token acquisition and secret retrieval automatically. It also encapsulates permissions following least privilege—only the managed identity requires “Get” permission for secrets in Key Vault, not user accounts or client credentials. This simplifies operational overhead, enhances security, and fits well into the Microsoft Well-Architected Framework pillars:

  • Security: Minimal permission scope with managed identity
  • Operational Excellence: Zero code changes; platform-managed secret rotation
  • Reliability: Reduced risk of secret exposure from app code or configs
  • Cost Optimization: Avoids overhead of client certificate management or complex custom logic

💎 The Architect’s Deep Dive: Why Options Fail
#

The Trap (Distractor Analysis)
#

  • Option B: Assigning permissions to user accounts violates least privilege and operational governance, increasing risk.
  • Option C: Client credential flows require adding authentication code to your app, increasing complexity and attack surface.
  • Option D: IMDS endpoint is used for VM or managed identity token retrieval but not directly for Key Vault secret resolution — does not satisfy minimal code change requirement.

💎 Professional Decision Matrix

This AZ-305 professional section is locked.
Free beta access reveals the exam logic.

100% Free Beta Access

The Architect Blueprint
#

Mermaid Diagram illustrating the flow of the correct solution:

graph TD
    User[User Requests Web App] --> AppService[Azure App Service with Managed Identity]
    AppService --> KeyVault[Azure Key Vault]
    subgraph AzureResources
    AppService
    KeyVault
    end
    style AppService fill:#0078D4,stroke:#333,color:#fff
    style KeyVault fill:#5C2D91,stroke:#333,color:#fff

💎 Professional Decision Matrix

This AZ-305 professional section is locked.
Free beta access reveals the exam logic.

100% Free Beta Access

Diagram Note: The App Service uses its system-assigned managed identity to automatically fetch secrets from Azure Key Vault via configured Key Vault references in app settings.

The Decision Matrix
#

Option Est. Complexity Est. Monthly Cost Pros Cons
A) Key Vault references in App Settings Low Minimal (only Key Vault usage) Zero code changes; Least privilege; Azure-managed token lifecycle Requires Azure App Service platform support
B) Secrets:Get permission for users Low Minimal Simple permissions assignation Violates least privilege; Risk of secret leak
C) Client credential flow in app code Medium Higher (app dev, auth management) Fine-grained token control Increased complexity; Maintenance overhead
D) Use IMDS endpoint Low Minimal Seamless token fetch for VM/MI Does not manage Key Vault secret retrieval directly

💎 Professional Decision Matrix

This AZ-305 professional section is locked.
Free beta access reveals the exam logic.

100% Free Beta Access

Real-World Practitioner Insight
#

Exam Rule
#

For the exam, always pick Key Vault references with managed identities when you see minimal code changes and least privilege as requirements for Key Vault integration.

Real World
#

In enterprise migrations, this pattern simplifies secret management and reduces security risks by avoiding embedded secrets in code or config files. For legacy apps without platform support, client credential flows might be necessary, but new cloud-native apps should leverage this seamless authentication.

💎 Professional Decision Matrix

This AZ-305 professional section is locked.
Free beta access reveals the exam logic.

100% Free Beta Access