Hi @Michael Clemans,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
This error usually occurs when the authentication method does not match the account configuration. Common causes include:
- Using local account keys when the account requires Azure AD (Entra ID) authentication.
- Token issued from a different tenant than the Cosmos DB account.
- Missing role assignment for the user.
fix:
Use Entra ID authentication\ Sign in via https://cosmos.azure.com using Entra ID credentials.
Assign the correct role\ Ensure the user has the Cosmos DB Built-in Data Contributor role. You can assign it using Azure CLI or PowerShell:
az cosmosdb sql role assignment create \
--account-name <CosmosAccountName> \
--resource-group <ResourceGroupName> \
--role-definition-id <RoleDefinitionId> \
--scope "/" \
- Verify tenant alignment\ If the token comes from a different tenant, switch to the correct directory before logging in.
For details, see https://learn.microsoft.com/azure/cosmos-db/how-to-setup-rbac.