Question 144 of 997

Quick Answer

The correct answer is to use an HTTP action with the OAuth 2.0 authentication type and set the client secret parameter to a secure reference to the Key Vault secret. This works because the Logic App’s built-in HTTP action natively implements the OAuth 2.0 Client Credentials flow, meaning it handles the token endpoint call and automatically injects the access token into the Authorization header. By using a secure reference like `@Microsoft.KeyVault(SecretUri=...)` for the client secret, you keep credentials out of the workflow definition and rely on the Logic Apps runtime to fetch the secret from Key Vault at execution time. On the AZ-204 exam, this scenario tests your understanding of managed identities, Key Vault integration, and the difference between native OAuth support versus custom token management. A common trap is trying to manually call the token endpoint with a separate HTTP action, which adds unnecessary complexity and security risk. Memory tip: “Native OAuth + Key Vault reference = zero custom code for token management.”

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.

You are building an Azure Logic App that needs to call an external HTTP API secured with OAuth 2.0 Client Credentials flow. The client ID and client secret are stored in Azure Key Vault. You need to obtain an access token and include it in the Authorization header of each request. Which combination of actions should you use within the Logic App?

Question 1mediummultiple choice
Read the full NAT/PAT explanation →

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 an HTTP action with the OAuth 2.0 authentication type. Set the client secret parameter to a secure reference to the Key Vault secret.

Option A is correct because the HTTP action in Azure Logic Apps natively supports the OAuth 2.0 authentication type, which can directly handle the Client Credentials flow. By setting the client secret parameter to a secure reference (e.g., `@Microsoft.KeyVault(SecretUri=...)`) pointing to the secret stored in Azure Key Vault, you avoid exposing credentials in the workflow definition. The Logic Apps runtime automatically retrieves the secret from Key Vault, obtains an access token from the token endpoint, and includes it in the Authorization header of each request without requiring custom token management.

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 an HTTP action with the OAuth 2.0 authentication type. Set the client secret parameter to a secure reference to the Key Vault secret.

    Why this is correct

    Logic Apps' built-in OAuth 2.0 authentication for HTTP actions handles token acquisition and renewal. The secret can be securely referenced from Key Vault via a parameter.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Use two HTTP actions: first, call the token endpoint with credentials to get a token, then use the token in the second action. Store credentials in a string variable.

    Why it's wrong here

    This approach is more complex and less secure. Storing credentials in a variable exposes them in the workflow definition. The built-in OAuth 2.0 authentication abstracts token management.

  • Use the HTTP action with managed identity authentication.

    Why it's wrong here

    Managed identity is used to authenticate to Microsoft Entra ID resources, not to third-party APIs that require OAuth 2.0 Client Credentials with a specific client ID and secret.

  • Use the 'Invoke an Microsoft Entra ID protected API' connector with the client credentials grant type.

    Why it's wrong here

    This connector is designed for APIs protected by Microsoft Entra ID. If the external API is not registered in the same Microsoft Entra ID tenant or does not use Microsoft Entra ID, this connector may not work.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often overcomplicate the solution by manually implementing token acquisition (Option B) or misapplying managed identity (Option C) or prebuilt connectors (Option D), not realizing that the built-in HTTP action's OAuth 2.0 authentication type directly supports the Client Credentials flow with Key Vault integration.

Detailed technical explanation

How to think about this question

Under the hood, the HTTP action with OAuth 2.0 authentication type uses the `client_credentials` grant type by default when no resource or scope is specified, and it caches the access token for the token's lifetime (typically 1 hour) to avoid redundant calls to the token endpoint. The secure reference to Key Vault uses the Logic Apps managed identity (system-assigned or user-assigned) to authenticate to Key Vault, ensuring that the secret is never stored in plaintext in the workflow JSON. In a real-world scenario, if the external API requires a custom scope (e.g., `api://contoso.com/.default`), you must specify it in the 'Audience' or 'Scope' field of the HTTP action's authentication settings.

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.

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.

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: Use an HTTP action with the OAuth 2.0 authentication type. Set the client secret parameter to a secure reference to the Key Vault secret. — Option A is correct because the HTTP action in Azure Logic Apps natively supports the OAuth 2.0 authentication type, which can directly handle the Client Credentials flow. By setting the client secret parameter to a secure reference (e.g., `@Microsoft.KeyVault(SecretUri=...)`) pointing to the secret stored in Azure Key Vault, you avoid exposing credentials in the workflow definition. The Logic Apps runtime automatically retrieves the secret from Key Vault, obtains an access token from the token endpoint, and includes it in the Authorization header of each request without requiring custom token management.

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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

4 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. You are building an Azure Logic App that must call an external API secured with OAuth 2.0 Client Credentials flow. The external API is registered in a different Microsoft Entra ID tenant. You need to obtain an access token and add it to the request headers. Which action and authentication configuration should you use?

medium
  • A.Use the HTTP action with Managed Identity authentication.
  • B.Use the HTTP + Swagger connector to import the API definition.
  • C.Use the HTTP action with Active Directory OAuth authentication, providing the tenant ID, client ID, and client secret.
  • D.Use the Azure Key Vault - Get secret action to retrieve a token.

Why C: Option C is correct because the HTTP action's Active Directory OAuth authentication type directly supports the OAuth 2.0 Client Credentials flow for cross-tenant scenarios. By providing the tenant ID, client ID, and client secret, the Logic App runtime can obtain an access token from the external tenant's token endpoint and automatically inject it into the Authorization header as a Bearer token. This is the only built-in authentication option in the HTTP action that handles the client credentials grant without custom code.

Variation 2. You are building an Azure Logic App that needs to call an external API secured with OAuth 2.0 client credentials flow. You have registered an application in Microsoft Entra ID with client ID 'myClientId' and client secret stored in Key Vault. Which action should you use to authenticate?

medium
  • A.HTTP action with Active Directory OAuth authentication
  • B.HTTP action with Managed Identity authentication
  • C.Invoke the API through Azure API Management
  • D.Use the Microsoft Entra ID OAuth 2.0 connector

Why A: Option A is correct because the HTTP action in Azure Logic Apps supports an 'Active Directory OAuth' authentication type that directly implements the OAuth 2.0 client credentials flow. By providing the tenant ID, client ID, and referencing the client secret from Key Vault (via a secure parameter or connection reference), the Logic App can obtain an access token from Microsoft Entra ID and authenticate to the external API without custom code.

Variation 3. You are building an Azure Logic App that must call a third-party REST API secured with OAuth 2.0 Client Credentials flow. The client ID and client secret are stored in Azure Key Vault. You need to securely obtain an access token and include it in requests to the API. Which approach should you use in the Logic App?

medium
  • A.Use the HTTP action with 'Active Directory OAuth' authentication and hardcode the client secret in the connection parameters.
  • B.Create an Azure API connection (custom connector) with the OAuth 2.0 settings and store the secret in the connector's definition.
  • C.Enable a system-assigned managed identity for the Logic App, grant it access to Key Vault, use the 'Get secret' action to retrieve the client secret into a variable, then use the HTTP action with 'Active Directory OAuth' authentication referencing that variable for the secret.
  • D.Store the client secret in an Azure App Service application setting and reference it in the Logic App via a connector.

Why C: Option C is correct because it securely retrieves the client secret from Azure Key Vault at runtime using a managed identity, avoiding any hardcoded secrets. The Logic App's system-assigned managed identity is granted access to Key Vault, then the 'Get secret' action fetches the secret into a variable, which is passed to the HTTP action's 'Active Directory OAuth' authentication. This approach follows the principle of least privilege and eliminates secret exposure in connection definitions or source code.

Variation 4. You are building an Azure Logic App that calls an external REST API secured with the OAuth 2.0 client credentials flow. You have registered an app in Microsoft Entra ID with client ID and client secret stored in Azure Key Vault. The Logic App uses a system-assigned managed identity with Get permission on the secret. Which action should you use in the Logic App designer to authenticate to the API?

medium
  • A.HTTP action with 'Active Directory OAuth' authentication type, referencing the client ID and client secret
  • B.HTTP action with 'Managed Identity' authentication type
  • C.Invoke an API with OAuth predefined connector
  • D.HTTP action with 'Basic' authentication and pass the secret as password

Why A: Option A is correct because the OAuth 2.0 client credentials flow requires a client ID and client secret to obtain an access token from Microsoft Entra ID. The HTTP action's 'Active Directory OAuth' authentication type directly supports this flow, allowing you to reference the client ID and the client secret stored in Azure Key Vault. The Logic App's system-assigned managed identity has Get permission on the secret, enabling it to retrieve the secret at runtime without exposing it in the workflow definition.

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

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.