Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Specify tool scopes, permission boundaries, and authentication methods

A worked example

Complete the statement

Fabrikam is designing the authentication methods for a multi-agent code-review solution hosted in Azure Container Apps. The design must meet these requirements:

  • Enrichment agent: runs a nightly batch job with no user signed in and writes results to an Azure Cosmos DB account. Local (key-based) authentication is disabled on the Cosmos DB account.
  • Review agent: reads a developer's Azure DevOps repositories when that developer requests a review. The developer's own repository permissions must be enforced, and the Azure DevOps audit log must show the developer, not the agent, as the actor. The agent receives the developer's access token issued for the review application and must exchange it for a downstream token without initiating another interactive authorization flow. The required delegated permissions and consent are already configured.
  • Ticketing agent: creates tickets for the developer in a third-party SaaS ticketing service. The service does not accept Microsoft Entra ID tokens, does not issue API keys, and supports OAuth2 sign-in. Each developer must grant explicit consent the first time the agent acts for them.

Which authentication method should you specify for each agent connection?

The enrichment agent's writes to Cosmos DB use . The review agent's access to the developer's Azure DevOps repositories uses . The ticketing agent's access to the SaaS ticketing service uses .

  • Blank 1: managed identity (correct answer)

    Managed identity authenticates the unattended agent to an Azure service without stored credentials. OBO requires a user assertion, which this job does not have. Authorization code with PKCE introduces interactive user authorization that this service operation does not need. Key-based authentication cannot be used because local authentication is disabled.

  • Blank 2: the on-behalf-of (OBO) flow (correct answer)

    OBO exchanges the incoming application token for a downstream token that preserves the developer's delegated permissions. Managed identity represents the service rather than the developer. Authorization code with PKCE can support delegated access, but initiating that authorization flow does not meet the required incoming-token exchange. A service API key does not preserve the developer's delegated identity.

  • Blank 3: the OAuth2 authorization code flow with PKCE (correct answer)

    Authorization code with PKCE fits the third-party service's interactive user-consent requirement. Managed identity and Entra OBO produce Entra tokens, which this service does not accept. Key-based authentication is unavailable because the service issues no API keys.

Why

Managed identity fits the unattended Cosmos DB connection, and disabling local authentication excludes service keys. OBO exchanges the review application's incoming user token for a downstream token while preserving delegated user access. Authorization code with PKCE fits the ticketing service's initial user-consent flow.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free