AWS Builder Center
From az login to Bedrock: AWS Auth for Azure Switchers

From az login to Bedrock: AWS Auth for Azure Switchers

If you're used to Azure AI Foundry's API keys, Bedrock's authentication model might feel unfamiliar at first — here's the mental model, and the two-command equivalent of az login.

Tech Enthusiast

Before we start: three quick terms

  • IAM is AWS's identity and access system — the equivalent of Entra ID. Every request to any AWS service is checked against it.
  • SigV4 is the signing method AWS credentials use to prove a request is legitimate. Instead of attaching a static token to a request (like a password), the request itself gets cryptographically signed using your credentials. More on why that matters below.
  • IAM Identity Center is AWS's answer to "log in once, get access to what you're allowed to use" — the rough equivalent of your organization's Entra ID tenant. If your organization uses it, this is what you'll authenticate against.

The question that started this

If you've used Azure AI Foundry, you've probably seen the setting that disables API key authentication for a deployed model, forcing every caller to use Entra ID instead. It's a genuinely good security practice — and if you're moving from Azure to AWS Bedrock, a natural first question is: where's the equivalent setting for Bedrock?
Short answer: there isn't one to find, because there's nothing to turn off. Bedrock's native, original authentication method has always been IAM credentials — the AWS equivalent of Entra ID — not an API key. Keys were added later as an optional convenience feature. If you never opt into using one, you were never authenticating with a key in the first place.

Why this is confusing coming from Azure

Azure OpenAI and AI Foundry ship with both an API key and Entra ID authentication turned on simultaneously. You have to actively go find the setting and switch keys off. That's the model most people learn first, so it's reasonable to expect AWS to work the same way — a toggle somewhere in the Bedrock console labeled "disable API keys."
AWS built it the other way around. IAM has always been the only way in. API keys, when AWS introduced them, were explicitly framed as a getting-started convenience — useful if you're following a quick tutorial and don't want to learn IAM roles and SigV4 signing on day one. If you go through the normal AWS login flow instead, you never touch that feature at all.

The actual equivalent of  az login 

With Azure, you'd typically run:
az login
and then call Azure AI Foundry using whatever identity that logged you in as. The AWS equivalent, if your organization uses IAM Identity Center (common in larger orgs):
aws configure sso # one-time setup: point this at your org's IAM Identity Center URL
aws sso login --profile your-profile
This opens a browser, you authenticate the same way you would for any other company login (possibly including MFA, depending on how your org has it set up), and AWS caches short-lived credentials locally. From there, calling Bedrock from code looks like this:
import boto3

client = boto3.client("bedrock-runtime", profile_name="your-profile")
response = client.converse(
modelId="anthropic.claude-sonnet-4-5-20250929-v1:0",
messages=[{"role": "user", "content": [{"text": "Hello!"}]}]
)
No key anywhere in that code. The SDK automatically finds your cached login credentials and signs each request for you.

One real difference worth knowing (not just naming)

Here's a genuine trade-off, not just a vocabulary difference. With Azure, once you have a token, you can paste it into a raw  curl  command as a header and it works:
curl -H "Authorization: Bearer <token>" https://your-endpoint...
You can't do that with plain IAM credentials on AWS. SigV4 requires computing a signature from parts of the request itself — you can't just stick a static value in a header and call it done. This is exactly why AWS eventually added the API key feature: it gives people who want "paste a token, curl it" simplicity the option to have that, at the cost of stepping outside AWS's stronger default security model.
So the honest comparison isn't "Azure is less secure by default" — a default Azure OpenAI resource genuinely does have both key and Entra ID auth enabled at once, so on day one it is more permissive than a default Bedrock setup. The interesting difference is direction: Azure starts permissive and asks you to lock it down; AWS starts locked down and offers you a permissive option if you want it.

What to take away

If you're a student learning cloud AI services: the practical takeaway is simple — if you're setting up Bedrock for a project or class, reach for  aws configure sso  /  aws sso login  (or a plain IAM role if you're on a personal account without Identity Center) before reaching for an API key. You'll get the same working setup, without picking up a habit that's harder to unwind later.
If you're already working with this professionally: if your organization already federates IAM Identity Center to Entra ID (a common setup when a company already runs Microsoft 365 or Entra ID elsewhere), logging into AWS this way authenticates against the exact same identity, MFA, and Conditional Access policies your team already uses for Azure. It's not a second identity system to manage — it's the same one, with a different login command.
If you do need to allow API keys in your organization — or want to lock them down explicitly rather than relying on nobody using them — that's a deeper, policy-level topic on its own.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article