Microsoft Entra Agent ID
Security

Secure an Amazon Bedrock agent with Microsoft Entra Agent ID

In brief

The guide now explains the sidecar as a token broker, clarifies client-credential and OBO flows, updates workload identity federation guidance to Azure Container Apps, and expands setup prerequisites and validation steps.

What Entra admins need to know

Administrators should use the revised deployment guidance and verify existing blueprints, permissions, and sidecar credentials when reusing a setup.

This editorial summary was generated by AI from the documentation changes. Verify important details in the full Microsoft Learn article.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Secure an Amazon Bedrock agent with Microsoft Entra Agent ID

This guidearticle shows you how to secure an Amazon Bedrock agent by usinguse the Microsoft Entra ID Auth SDK (sidecar) to authenticate to downstream APIs.sidecar with an Amazon Bedrock agent. The sidecar runs as a separate container and handles all credential management and token exchange withholds the Microsoft Entra ID. Yourblueprint credential, obtains and caches downstream access tokens, and returns authorization headers to the agent. The agent requests anholds the selected AWS credential for Bedrock and passes the authorization header fromto the sidecar, and the sidecar handles the OAuth 2.0 exchange with Microsoft Entra ID.protected API.

Prerequisites

Before you begin, make sure you have:

  • A Microsoft Entra tenant.
  • An Azure subscription.subscription for the Microsoft Entra and optional Azure deployment resources.
  • Docker Desktop (macOS/Windows) or Docker Engine with Compose v2 (Linux).
  • PowerShell 7+.
  • Azure CLI.
  • AWS CLI v2.
  • An AWS account with Bedrock model access enabled for Anthropic Claude 3 Haiku (or your preferred model). Enable access in the AWS Bedrock console under Model access > Manage model access.
  • Global Administrator role for the first-time Microsoft Entra setup.setup and consent steps. Use Privileged Identity Management (PIM) to activate this role just-in-time.only when needed.

Clone the sample repository

cd entra-agentid-samples/sidecar/aws


## ArchitectureReview the architecture

The Microsoft Entra ID Auth SDK (sidecar) sitssidecar is the token broker between yourthe agent and Microsoft Entra ID. The agent never talks to Microsoft Entra ID directly and never manages credentials. It asks the sidecar forrequests an `Authorization` header from the sidecar and passes the header to call athe downstream API. Amazon Bedrock handles LLM inference separately, without having to worry about identity.authentication remains separate: the agent container uses the AWS credential that you configure for model inference.

:::image type="content" source="media/integrate-aws-bedrock-agent/bedrock-sidecar-token-flow.png" alt-text="Diagram showing the token flow between the Bedrock agent, sidecar, Microsoft Entra ID, and Weather API." lightbox="media/integrate-aws-bedrock-agent/bedrock-sidecar-token-flow.png":::

1. The Flask app sends the query to AWS Bedrock (Claude) via the LangGraph ReAct agent.
1. When Claude decides it needs weather data, it calls the `get_weather` tool.
1. The tool asks the sidecar for an authorization header by calling `GET /AuthorizationHeader?AgentIdentity={agentId}`.
1. The sidecar authenticates to Microsoft Entra ID by using OAuth 2.0 (client credentials or on-behalf-of (OBO) exchange).a client credential. For OBO, it also exchanges the signed-in user's token.
1. Microsoft Entra ID returns the requesteddownstream access token (TR) to the sidecar.
1. The sidecar returns an authorization header to the agent.
1. The agent callspasses the authorization header to the weather API with `Authorization: Bearer TR`.API.
1. The weather API validates TR and returns the weather JSON response.

### Understand the token flow
|---|---|---|---|
| **Tc** | Signed-in user | OBO flow only | MSAL.js in the browser |
| **T1** | Blueprint app | Both flows | Sidecar (client credentials) |
| **TR** | Agent (downstream API)identity for the downstream API | Both flows | Sidecar-Sidecar app-only (autonomous) or OBO exchange |

In the autonomous flow, the sidecar uses client credentials to get T1, then exchanges it for TR scoped to the downstream API. In the OBO flow, the sidecar also receives Tc (the user's token) and performs an OBO exchange to get TR that acts on behalf of the signed-in user.


- **Temporary STS credentials:** Best for local development with AWS SSO. Set `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` in your `.env` file. These credentials expire after approximately one hour.
- **Bedrock API key:** Best for demos and workshops. Set `AWS_BEARER_TOKEN_BEDROCK` in your `.env` file. Scoped to Bedrock only with a configurable lifetime.
- **OIDC federation:** Best for production deployments onUse workload identity federation instead of a stored AWS secret. The Azure App Service. UsesContainer Apps deployment configures `AWS_ROLE_ARN`, `AWS_WEB_IDENTITY_TOKEN_FILE`, and `AWS_WEB_IDENTITY_TOKEN_FILE` set by the platform. No secrets stored anywhere.a token-refresher container.
Daily Entra.News

Get daily email updates

Get a concise summary of the latest Microsoft Entra updates delivered straight to your inbox.

Loading the secure signup form…