- A
Store the API key in plain text directly in the Logic App HTTP action header.
Why wrong: This exposes the API key in the workflow definition, which is insecure and violates security best practices.
- B
Store the API key in Azure Key Vault and use the Key Vault connector to retrieve it dynamically in the Logic App.
This securely stores the key in Key Vault and allows the Logic App to reference it at runtime without exposing it in the definition.
- C
Store the API key in an App Service application setting and reference it using the 'appsetting' expression.
Why wrong: Application settings are for App Service, not Logic Apps. Logic Apps cannot directly access App Service application settings.
- D
Create an Azure Function with the API key hardcoded as an environment variable and call it from the Logic App.
Why wrong: This adds unnecessary complexity and still requires storing the key somewhere. Azure Functions also need secure key management.
Quick Answer
The correct answer is to store the API key in Azure Key Vault and use the Key Vault connector to retrieve it dynamically in the Logic App. This approach is correct because Azure Key Vault acts as a secure, centralized secrets store, and the Logic App’s built-in Key Vault connector retrieves the secret at runtime via a managed identity, ensuring the API key never appears in plain text within the workflow’s JSON definition or source control. On the AZ-204 exam, this scenario tests your understanding of securing sensitive configuration data in serverless workflows, often paired with questions about managed identities or access policies. A common trap is to hardcode the key in a Logic App parameter or use an environment variable, both of which expose the secret in the definition. Remember the mnemonic “KV-LA-MI” — Key Vault, Logic App, Managed Identity — to recall the secure chain for runtime secret retrieval.
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. 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.
Your company uses Azure Logic Apps to automate workflows. A workflow must call an external REST API that requires an API key in the header. You need to securely store the API key and reference it in the Logic App without exposing it in the workflow definition. What should you do?
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
Store the API key in Azure Key Vault and use the Key Vault connector to retrieve it dynamically in the Logic App.
Option B is correct because Azure Key Vault provides a secure, centralized store for secrets like API keys, and the Logic App Key Vault connector retrieves the key at runtime without exposing it in the workflow definition. This approach ensures the secret is never stored in plain text within the Logic App's JSON definition or source control, aligning with Azure security best practices for managed identities and access policies.
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.
- ✗
Store the API key in plain text directly in the Logic App HTTP action header.
Why it's wrong here
This exposes the API key in the workflow definition, which is insecure and violates security best practices.
- ✓
Store the API key in Azure Key Vault and use the Key Vault connector to retrieve it dynamically in the Logic App.
Why this is correct
This securely stores the key in Key Vault and allows the Logic App to reference it at runtime without exposing it in the definition.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Store the API key in an App Service application setting and reference it using the 'appsetting' expression.
Why it's wrong here
Application settings are for App Service, not Logic Apps. Logic Apps cannot directly access App Service application settings.
- ✗
Create an Azure Function with the API key hardcoded as an environment variable and call it from the Logic App.
Why it's wrong here
This adds unnecessary complexity and still requires storing the key somewhere. Azure Functions also need secure key management.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may confuse App Service application settings (Option C) with Logic App environment variables, but Logic Apps do not support the 'appsetting' expression, and Azure Key Vault is the only secure, native way to inject secrets into Logic Apps without exposing them in the definition.
Detailed technical explanation
How to think about this question
Under the hood, the Key Vault connector uses Azure AD authentication and a managed identity (or service principal) to authenticate to Key Vault, ensuring the secret is never transmitted in the Logic App's definition or logs. The connector retrieves the secret via the Key Vault REST API (e.g., GET /secrets/{name}) and passes it to the HTTP action header dynamically, with the secret value masked in the Azure portal's monitoring outputs. A real-world scenario where this matters is in CI/CD pipelines where Logic App definitions are stored in source control — using Key Vault prevents secrets from being committed to repositories.
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 company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
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.
- →
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 — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Store the API key in Azure Key Vault and use the Key Vault connector to retrieve it dynamically in the Logic App. — Option B is correct because Azure Key Vault provides a secure, centralized store for secrets like API keys, and the Logic App Key Vault connector retrieves the key at runtime without exposing it in the workflow definition. This approach ensures the secret is never stored in plain text within the Logic App's JSON definition or source control, aligning with Azure security best practices for managed identities and access policies.
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
3 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 uses Azure Logic Apps to automate a business process. The process needs to call an external REST API that requires an API key passed in the Authorization header. You need to store the API key securely and reference it in the Logic App. Which approach should you use?
medium- A.Store the API key in the Logic App's definition as a constant
- ✓ B.Use an Azure Key Vault secret and a managed identity
- C.Hardcode the API key in a parameter file
- D.Use an Azure Storage account table to store the key
Why B: Option B is correct because Azure Key Vault securely stores secrets like API keys, and using a managed identity allows the Logic App to authenticate to Key Vault without embedding credentials in code or configuration. This follows the principle of least privilege and eliminates the need to manage secrets in connection strings or parameter files.
Variation 2. A company uses Azure Logic Apps to integrate with a third-party CRM system. The CRM API requires OAuth 2.0 authentication. The developer needs to securely store the client secret and refresh token. Which Azure service should the developer use?
medium- A.Azure App Configuration
- ✓ B.Azure Key Vault
- C.Azure Managed Identity
- D.Azure SQL Database
Why B: Option A is correct because Azure Key Vault securely stores secrets and credentials, and Logic Apps can reference them. Option B is incorrect because Azure App Configuration is for configuration settings, not secrets. Option C is incorrect because Azure SQL Database is not a secret store. Option D is incorrect because Azure Managed Identity is for Azure AD authentication, not for third-party OAuth secrets.
Variation 3. You are using Azure Logic Apps to integrate with a third-party CRM. The CRM API requires OAuth 2.0 authentication with a client secret. The secret must be stored securely and rotated automatically. What should you do?
medium- A.Use a system-assigned managed identity without storing the secret
- ✓ B.Store the secret in Azure Key Vault and use a managed identity to access it
- C.Store the secret in the Logic App definition as a string parameter
- D.Store the secret in Azure App Configuration with encryption
Why B: Store the secret in Key Vault and reference it from the Logic App using a managed identity. Option A is wrong because storing secrets in Logic App definitions is insecure. Option C is wrong because storing in App Configuration is not designed for secrets. Option D is wrong because managed identity alone does not store the secret.
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.