nerdexam
Microsoft

AZ-204 · Question #413

Drag and Drop Question You are developing a serverless Java application on Azure. You create a new Azure Key Vault to work with secrets from a new Azure Functions application. The application must…

The correct answer is Create the Azure Functions app with a Consumption plan type.; Create a system-assigned managed identity for the application.; Create an access policy in Azure Key Vault for the application identity. Explanation of Azure Functions + Key Vault Access Question --- Quick Requirements Mapping | Requirement | Implies | |---|---| | No code changes for Key Vault references | Key Vault references via app settings | | Dynamic scaling based on events | Event-driven plan | |…

Submitted by noor.lb· Mar 30, 2026Implement Azure security

Question

Drag and Drop Question You are developing a serverless Java application on Azure. You create a new Azure Key Vault to work with secrets from a new Azure Functions application. The application must meet the following requirements: - Reference the Azure Key Vault without requiring any changes to the Java code. - Dynamically add and remove instances of the Azure Functions host based on the number of incoming application events. - Ensure that instances are perpetually warm to avoid any cold starts. - Connect to a VNet. - Authentication to the Azure Key Vault instance must be removed if the Azure Function application is deleted. You need to grant the Azure Functions application access to the Azure Key Vault. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. Answer:

Exhibit

AZ-204 question #413 exhibit

Answer Area

Drag items

Create a user-assigned managed identity for the application.Create the Azure Functions app with a Premium plan type.Create an access policy in Azure Key Vault for the application identity.Create an SSL certification in Azure Key Vault for the application identity.Create the Azure Functions app with an App Service plan type.Create the Azure Functions app with a Consumption plan type.Create a system-assigned managed identity for the application.

Correct arrangement

  • Create the Azure Functions app with a Consumption plan type.
  • Create a system-assigned managed identity for the application.
  • Create an access policy in Azure Key Vault for the application identity.

Explanation

Explanation of Azure Functions + Key Vault Access Question


Quick Requirements Mapping

RequirementImplies
No code changes for Key Vault referencesKey Vault references via app settings
Dynamic scaling based on eventsEvent-driven plan
Perpetually warm, no cold startsPre-warmed instances
VNet connectivityVNet integration support
Identity deleted when app is deletedSystem-assigned managed identity

Step-by-Step Breakdown

Step 1: Create the Azure Functions app with a Consumption Premium plan type

Important: The provided "correct" answer for Step 1 appears to be wrong. The stated requirements explicitly require:

  • No cold starts ("perpetually warm") - Consumption plan cannot guarantee this; it is the defining weakness of Consumption. Premium plan has Always Ready / pre-warmed instances.
  • VNet connectivity - Consumption plan has very limited VNet support. Premium plan provides full VNet integration.

The technically correct answer for Step 1 is Premium plan. Consumption plan violates two of the stated requirements directly.

Step 2: Create a system-assigned managed identity

This is correct and the reasoning is precise:

  • A system-assigned identity is tied to the lifecycle of the Azure Function app. When the app is deleted, the identity is automatically deleted - satisfying the requirement "Authentication to Key Vault must be removed if the Function app is deleted."
  • A user-assigned identity is a standalone resource with an independent lifecycle. It would persist after the Function app is deleted, violating the requirement.
  • The identity also enables Key Vault references in app settings (e.g., @Microsoft.KeyVault(SecretUri=...)) - satisfying the "no code changes" requirement.

Step 3: Create an access policy in Azure Key Vault for the application identity

  • This grants the Function app's managed identity permission to read secrets from Key Vault.
  • An SSL certificate (wrong distractor) is used for TLS/HTTPS, not for granting access to secrets.
  • The access policy must come after the identity exists - you need the identity's object ID to create the policy.

Common Mistakes & Misconceptions

MistakeWhy It's Wrong
Choosing user-assigned identityIt survives app deletion - fails the cleanup requirement
Choosing Consumption plan for "no cold starts"Consumption plan is the source of cold starts, not the solution
Choosing SSL certificate instead of access policySSL certs handle transport security, not Key Vault authorization
Reversing steps 2 and 3You can't create an access policy for an identity that doesn't exist yet

Summary

The correct sequence is: provision the right Function plan -> establish a lifecycle-bound identity -> grant that identity Key Vault access. Each step is a prerequisite for the next, and the identity type choice is the most discriminating decision in the question.

Topics

#Azure Functions#Azure Key Vault#Managed Identity#Access Policy

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice