Courseiva

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 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?

⚠ Common exam trap

Watch out — candidates often confuse Managed Identity with cross-tenant authentication, assuming it works across tenants, when in fact Managed Identity is strictly scoped to the resource's home tenant.

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 the HTTP action with Active Directory OAuth authentication, providing the tenant ID, client ID, and client secret.

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.

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 the HTTP action with Managed Identity authentication.

    Why it's wrong here

    Managed Identities provide an identity for Azure resources to authenticate to services that support Microsoft Entra authentication within the same tenant where the identity is registered. Since the external API resides in a different Microsoft Entra ID tenant, the Logic App's Managed Identity would not be recognized or authorized by that external tenant's application registration, rendering it ineffective for cross-tenant API calls.

  • Use the HTTP + Swagger connector to import the API definition.

    Why it's wrong here

    The HTTP + Swagger connector primarily serves to parse an OpenAPI (Swagger) definition, providing design-time schema validation and a more structured interface for the HTTP action within the Logic App. While it enhances the developer experience by defining API structure, it does not inherently handle the runtime acquisition or management of OAuth tokens, especially for complex cross-tenant authentication scenarios.

  • Use the HTTP action with Active Directory OAuth authentication, providing the tenant ID, client ID, and client secret.

    Why this is correct

    This configuration correctly leverages the OAuth 2.0 Client Credentials flow, where the Logic App acts as a confidential client. By providing the external API's Microsoft Entra ID tenant ID, a registered application's client ID, and its corresponding client secret, the Logic App can directly request an access token from the external tenant's token endpoint. This token is then automatically attached to the HTTP request, authorizing access to the external API even across different tenants.

  • Use the Azure Key Vault - Get secret action to retrieve a token.

    Why it's wrong here

    Azure Key Vault is a secure service for storing and managing secrets, keys, and certificates, such as API keys or client secrets. However, it is not designed to generate or store dynamic OAuth access tokens, which are short-lived credentials obtained from an identity provider after a successful authentication flow. The Logic App would still need to use stored client credentials to programmatically request a token from the external API's identity provider, not retrieve a pre-existing token from Key Vault.

About these practice questions

This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.