I have a CosmosDB account:
az cosmosdb list | jq 'map({"name": .name, "identity": .identity})'
[
{
"name": "redacted-db-account",
"identity": {
"principalId": null,
"tenantId": null,
"type": "userassigned",
"userAssignedIdentities": {
"/subscriptions/a/resourcegroups/b/providers/Microsoft.ManagedIdentity/userAssignedIdentities/redacted-agentpool": {
"clientId": "bcaf6b6b-...",
"principalId": "be4a3128-..."
}
}
}
}
]
The redacted-agentpool
identity has the following role assignments:
az role assignment list --assignee be4a3128-... --all | jq 'map([.roleDefinitionName, .scope])'
[
[
"DocumentDB Account Contributor",
"/subscriptions/a/resourceGroups/b/providers/Microsoft.DocumentDB/databaseAccounts/redacted-db-account"
],
[
"Cosmos DB Operator",
"/subscriptions/a/resourceGroups/b/providers/Microsoft.DocumentDB/databaseAccounts/redacted-db-account"
]
]
Now when I run my Python application inside the Kubernetes cluster, I get the following error:
azure.cosmos.exceptions.CosmosHttpResponseError: (Forbidden) Request
blocked by Auth redacted-db-account : Request is blocked because
principal [be4a3128-...] does not have required RBAC permissions to
perform action [Microsoft.DocumentDB/databaseAccounts/readMetadata]
on resource [/]. Learn more: https://aka.ms/cosmos-native-rbac.
I am pretty new to Azure, but this seems inexplicable to me. Can someone please explain what steps I could take to even debug this? I am pretty much out of ideas.