AZ-204 Practice Question: Connect to and consume Azure services and third-party services
You are building an Azure Logic App that must call an external REST API. The API requires an API key passed in the Authorization header. You need to store the API key securely and reference it in the Logic App without exposing it in the workflow definition. What should you do?
⚠ Common exam trap
Candidates often confuse Azure App Configuration with Azure Key Vault, assuming App Configuration's encrypted storage is sufficient for secrets, but Key Vault is the only service designed for managing and auditing access to sensitive secrets like API keys.
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
✓
A
Azure Logic Apps can securely reference API keys stored in Azure Key Vault using a managed identity. By configuring the Logic App with a system-assigned or user-assigned managed identity, you grant it access to retrieve the secret from Key Vault at runtime without hardcoding the key in the workflow definition or connection parameters. This approach ensures the API key is never exposed in the Logic App's JSON definition or source control.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
A
Why this is correct
Azure Key Vault is the recommended service for securely storing secrets like API keys. It encrypts secrets at rest and in transit, and access is controlled via Azure RBAC or Key Vault access policies. By assigning a Managed Identity to the Logic App and granting it "Get" permissions on the secret in Key Vault, the Logic App can securely retrieve the API key at runtime using the built-in Key Vault connector, ensuring the key is never exposed in the Logic App's definition or logs.
- ✗
B
Why it's wrong here
Azure App Configuration is primarily designed for managing application settings and feature flags, allowing dynamic updates without redeploying the application. While it can store configuration values, it lacks the specialized security features of Azure Key Vault, such as hardware security module (HSM) backed keys, granular access control for individual secrets, and robust secret rotation capabilities. Storing API keys here does not provide the same level of protection against unauthorized access or exposure.
- ✗
C
Why it's wrong here
Storing the API key directly within a Logic App's connection parameters or definition means the key is embedded as part of the Logic App's resource configuration. Although the Azure portal might mask sensitive fields, the raw value is still present in the underlying ARM template or resource definition, making it discoverable by anyone with read access to the Logic App resource. This approach does not provide the necessary separation of secrets from application code or the robust security features of a dedicated secret store.
- ✗
D
Why it's wrong here
Initializing an API key as a plain text string within a Logic App variable action is highly insecure. The key would be directly visible in the Logic App designer, the underlying workflow definition (JSON), and potentially in the run history's inputs and outputs, making it easily discoverable. This method offers no encryption at rest or in transit, no access control mechanisms, and completely bypasses best practices for secret management, posing a significant security risk.
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Key Vault Secrets
Key Vault Secrets are secure containers in Microsoft Azure that store sensitive information like passwords, connection strings, and API keys, keeping them encrypted and accessible only to authorized applications and users.
Key term
Managed identity
A managed identity is an automatically managed service principal in Azure that allows your code to authenticate to any service that supports Azure AD authentication without storing credentials.
About these practice questions
One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.