- A
Use storage account access keys to authenticate to Key Vault
Why wrong: Storage account access keys are for authenticating to storage accounts, not Key Vault. They also represent a static credential, which is not allowed.
- B
Assign a managed identity to the function app and grant it access to the Key Vault
Managed identities allow the function app to authenticate to Key Vault without any stored credentials. The identity is automatically managed by Microsoft Entra ID.
- C
Generate a shared access signature (SAS) token for the Key Vault
Why wrong: SAS tokens are primarily used for delegated access to Azure Storage, not for authenticating apps to Key Vault.
- D
Create a service principal and store its certificate in the function app's local storage
Why wrong: Service principals require managing a certificate or secret, which would be static credentials stored locally – not meeting the requirement of no static credentials.
Quick Answer
The answer is to assign a managed identity to the function app and grant it access to the Key Vault. This is correct because Azure Functions can leverage either a system-assigned or user-assigned managed identity to authenticate to Azure Key Vault without storing any static credentials in configuration files. When enabled, the function app obtains an Azure AD token from the Managed Identity endpoint at 169.254.169.254, using that token to read secrets securely. On the AZ-204 exam, this scenario tests your understanding of identity-based authentication versus key-based or certificate-based approaches—a common trap is choosing connection strings or access policies that still require static secrets. Remember that managed identity is Azure’s way of giving a resource its own identity in Azure AD, so the function app itself becomes the credential. A helpful memory tip: think “no keys, no strings—just an identity token from the magic IP” to recall the 169.254.169.254 endpoint.
AZ-204 Implement Azure security Practice Question
This AZ-204 practice question tests your understanding of implement azure security. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
You are developing an Azure Function that reads secrets from Azure Key Vault. The function must not use any static credentials in configuration files. You need to authenticate to Key Vault using the function's own identity. Which Azure service feature should you enable?
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
Assign a managed identity to the function app and grant it access to the Key Vault
Option B is correct because Azure Functions can use a system-assigned or user-assigned managed identity to authenticate to Azure Key Vault without storing any static credentials. When enabled, the function app obtains an Azure AD token from the Managed Identity endpoint (169.254.169.254) and uses it to access Key Vault secrets, eliminating the need for connection strings, keys, or certificates in configuration files.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use storage account access keys to authenticate to Key Vault
Why it's wrong here
Storage account access keys are for authenticating to storage accounts, not Key Vault. They also represent a static credential, which is not allowed.
- ✓
Assign a managed identity to the function app and grant it access to the Key Vault
Why this is correct
Managed identities allow the function app to authenticate to Key Vault without any stored credentials. The identity is automatically managed by Microsoft Entra ID.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Generate a shared access signature (SAS) token for the Key Vault
Why it's wrong here
SAS tokens are primarily used for delegated access to Azure Storage, not for authenticating apps to Key Vault.
- ✗
Create a service principal and store its certificate in the function app's local storage
Why it's wrong here
Service principals require managing a certificate or secret, which would be static credentials stored locally – not meeting the requirement of no static credentials.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may confuse SAS tokens (which are for Storage) or service principals (which require manual certificate management) with the fully managed, credential-free authentication provided by managed identities.
Detailed technical explanation
How to think about this question
Managed identities work by provisioning an Azure AD identity for the Azure resource (e.g., Function App) and automatically rotating the associated certificate or secret. The function runtime calls the Azure Instance Metadata Service (IMDS) endpoint at 169.254.169.254/metadata/identity/oauth2/token to obtain an access token, which is then passed as a Bearer token in the Authorization header to Key Vault's REST API. In real-world scenarios, this enables secure secret retrieval in CI/CD pipelines or multi-tenant applications where rotating static credentials would be operationally expensive.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Implement Azure security — study guide chapter
Learn the concepts, then practise the questions
- →
Implement Azure security practice questions
Targeted practice on this topic area only
- →
All AZ-204 questions
997 questions across all exam domains
- →
Microsoft Azure Developer Associate AZ-204 study guide
Full concept coverage aligned to exam objectives
- →
AZ-204 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related AZ-204 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Develop Azure compute solutions practice questions
Practise AZ-204 questions linked to Develop Azure compute solutions.
Develop for Azure storage practice questions
Practise AZ-204 questions linked to Develop for Azure storage.
Implement Azure security practice questions
Practise AZ-204 questions linked to Implement Azure security.
Connect to and consume Azure services and third-party services practice questions
Practise AZ-204 questions linked to Connect to and consume Azure services and third-party services.
Monitor, troubleshoot, and optimize Azure solutions practice questions
Practise AZ-204 questions linked to Monitor, troubleshoot, and optimize Azure solutions.
AZ-204 fundamentals practice questions
Practise AZ-204 questions linked to AZ-204 fundamentals.
AZ-204 scenario practice questions
Practise AZ-204 questions linked to AZ-204 scenario.
AZ-204 troubleshooting practice questions
Practise AZ-204 questions linked to AZ-204 troubleshooting.
Practice this exam
Start a free AZ-204 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this AZ-204 question test?
Implement Azure security — This question tests Implement Azure security — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Assign a managed identity to the function app and grant it access to the Key Vault — Option B is correct because Azure Functions can use a system-assigned or user-assigned managed identity to authenticate to Azure Key Vault without storing any static credentials. When enabled, the function app obtains an Azure AD token from the Managed Identity endpoint (169.254.169.254) and uses it to access Key Vault secrets, eliminating the need for connection strings, keys, or certificates in configuration files.
What should I do if I get this AZ-204 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more ways this is tested on AZ-204
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Your company stores API keys and connection strings in Azure Key Vault. You need to grant an Azure Function read access to these secrets using the principle of least privilege. Which identity type should you assign to the Function App?
easy- ✓ A.System-assigned managed identity
- B.User-assigned managed identity
- C.Service principal
- D.Access policy on the Key Vault
Why A: A system-assigned managed identity is the correct choice because it is directly tied to the lifecycle of the Azure Function, automatically managed by Azure, and requires no manual credential rotation. It provides the most restrictive scope (only that specific Function App) and adheres to the principle of least privilege by granting access only to the identity that needs it, without the overhead of managing a separate identity or service principal.
Last reviewed: Jun 11, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.