- A
Hardcode the API key in the Logic App definition.
Why wrong: Hardcoding exposes the key in source control and is not a security best practice.
- B
Use Azure Key Vault and the Key Vault connector to retrieve the secret dynamically.
Key Vault is designed for secure secret storage. The Logic App connector retrieves the secret at runtime without exposing it in code.
- C
Store the API key in an Azure Storage Table and reference it from the Logic App.
Why wrong: Storage Table does not provide encryption at rest by default for sensitive data and is not a secure secrets store.
- D
Use an environment variable in the Logic App.
Why wrong: Logic Apps do not have environment variables. Even if they did, this is not a secure way to store secrets.
Quick Answer
The correct approach is to use Azure Key Vault with the Key Vault connector to retrieve the API key dynamically at runtime. This is the right choice because it stores the secret securely in a centralized, managed service and injects it into the Logic App workflow as a query parameter without ever exposing the key in plaintext within the workflow definition or logs. On the AZ-204 exam, this scenario tests your understanding of managed identities and secure secret retrieval patterns, often appearing as a distractor against hardcoding the key or using environment variables. A common trap is choosing to store the key directly in Logic App configuration settings, which violates security best practices. Remember the memory tip: “Key Vault keeps the key vaulted” — if you need a secret in a Logic App, always pull it from Key Vault, never paste it in.
AZ-204 Practice Question: Connect to and consume Azure services and third-party services
This AZ-204 practice question tests your understanding of connect to and consume azure services and third-party services. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. A key principle to apply: azure Key Vault is a service for securely storing secrets, keys, and certificates.. 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 building an Azure Logic App that must call a third-party REST API. The API requires an API key passed as a query parameter. You need to store the API key securely and automatically add it to each request. Which approach should you use?
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
Use Azure Key Vault and the Key Vault connector to retrieve the secret dynamically.
Option B is correct because Azure Key Vault provides a secure, centralized service for storing secrets like API keys, and the Key Vault connector in Logic Apps allows you to dynamically retrieve the secret at runtime without exposing it in the workflow definition. This approach ensures the API key is never hardcoded or stored in plaintext, meeting security best practices for accessing third-party APIs.
Key principle: Azure Key Vault is a service for securely storing secrets, keys, and certificates.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Hardcode the API key in the Logic App definition.
Why it's wrong here
Hardcoding exposes the key in source control and is not a security best practice.
- ✓
Use Azure Key Vault and the Key Vault connector to retrieve the secret dynamically.
Why this is correct
Key Vault is designed for secure secret storage. The Logic App connector retrieves the secret at runtime without exposing it in code.
Related concept
Azure Key Vault is a service for securely storing secrets, keys, and certificates.
- ✗
Store the API key in an Azure Storage Table and reference it from the Logic App.
Why it's wrong here
Storage Table does not provide encryption at rest by default for sensitive data and is not a secure secrets store.
- ✗
Use an environment variable in the Logic App.
Why it's wrong here
Logic Apps do not have environment variables. Even if they did, this is not a secure way to store secrets.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may think storing the key in an Azure Storage Table or using environment variables is sufficient, but Azure Key Vault is the only option that provides secure, auditable, and managed secret storage with built-in integration for Logic Apps.
Detailed technical explanation
How to think about this question
Under the hood, the Key Vault connector uses Azure AD authentication to securely access the vault, and the secret is retrieved via the Key Vault REST API (e.g., `GET /secrets/{secret-name}`) at runtime. The Logic App's managed identity or service principal must be granted 'Get' permission on the secret, ensuring that the API key is never stored in the workflow definition or logs. In a real-world scenario, this pattern is critical for compliance with regulations like PCI DSS or HIPAA, where secrets must be rotated and access audited.
KKey Concepts to Remember
- Azure Key Vault is a service for securely storing secrets, keys, and certificates.
- Logic Apps can use the Key Vault connector to dynamically retrieve secrets at runtime.
- Secrets stored in Key Vault benefit from encryption at rest and fine-grained access control.
- Using Key Vault prevents hardcoding sensitive information in application definitions.
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
Azure Key Vault is a service for securely storing secrets, keys, and certificates.
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.
Review azure Key Vault is a service for securely storing secrets, keys, and certificates., then practise related AZ-204 questions on the same topic to reinforce the concept.
- →
Connect to and consume Azure services and third-party services — study guide chapter
Learn the concepts, then practise the questions
- →
Connect to and consume Azure services and third-party services 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?
Connect to and consume Azure services and third-party services — This question tests Connect to and consume Azure services and third-party services — Azure Key Vault is a service for securely storing secrets, keys, and certificates..
What is the correct answer to this question?
The correct answer is: Use Azure Key Vault and the Key Vault connector to retrieve the secret dynamically. — Option B is correct because Azure Key Vault provides a secure, centralized service for storing secrets like API keys, and the Key Vault connector in Logic Apps allows you to dynamically retrieve the secret at runtime without exposing it in the workflow definition. This approach ensures the API key is never hardcoded or stored in plaintext, meeting security best practices for accessing third-party APIs.
What should I do if I get this AZ-204 question wrong?
Review azure Key Vault is a service for securely storing secrets, keys, and certificates., then practise related AZ-204 questions on the same topic to reinforce the concept.
What is the key concept behind this question?
Azure Key Vault is a service for securely storing secrets, keys, and certificates.
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 →
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.