Soru

Zorluk: OrtaSecure API Management Endpoints

You are securing a backend API by routing requests through Azure API Management (APIM). The backend API is secured using Microsoft Entra ID and requires authentication. You need to configure APIM to authenticate to the backend API using the APIM instance's system-assigned managed identity.

Which policy configuration should you apply to meet this requirement?

  1. <inbound>
    <base />
    <authentication-managed-identity resource="api://mybackend" />
    </inbound>
    Cevap
  2. B
    <inbound>
    <base />
    <authentication-managed-identity resource="api://mybackend" client-id="00000000-0000-0000-0000-000000000000" />
    </inbound>
  3. C
    <outbound>
    <base />
    <authentication-managed-identity resource="api://mybackend" />
    </outbound>
  4. D
    <inbound>
    <base />
    <set-header name="Authorization" exists-action="override">
    <value>@("Bearer " + "{{keyvault-token}}")</value>
    </set-header>
    </inbound>

Cevap

The configuration that applies the authentication-managed-identity policy with only the resource attribute in the inbound section.
The correct configuration uses the authentication-managed-identity policy with only the resource attribute specified, placed in the inbound section. This instructs the APIM gateway to use its system-assigned managed identity to fetch a token for the specified resource and attach it to the inbound request before it is forwarded to the backend service.

Adım Adım Çözüm

1
Determine the authentication mechanism.
Use the authentication-managed-identity policy to obtain a token from Microsoft Entra ID.
This policy manages the acquisition and caching of the token automatically.
2
Configure the managed identity parameters.
Specify the resource attribute, but omit the client-id attribute.
Omitting the client-id or identity-id tells APIM to use the system-assigned managed identity rather than a user-assigned managed identity.
3
Determine the policy placement.
Place the authentication-managed-identity policy in the inbound section.
The policy must run before the request is dispatched to the backend service.

Anahtar Kavram

Securing backend services from APIM using managed identity authentication
Tahmini Süre:1m 30s
Bu soruyu puanla