CmdID / az / az documentdb / az documentdb mongocluster / az documentdb mongocluster microsoft-entra-user
az documentdb mongocluster microsoft-entra-user assign
Grant a Microsoft Entra ID principal access to a mongo cluster by assigning it database roles. Azure CLI extensions reference
1 example 4 options Its page in the Azure CLI extensions reference
Examples
Assign admin access to an Entra ID user (or service principal) by object ID.
az documentdb mongocluster microsoft-entra-user assign --object-id 11111111-1111-1111-1111-111111111111 --cluster-name MyCluster -g MyResourceGroup --type User --role db=admin role=rootIdentify--object-idObject ID (client ID) of the Microsoft Entra principal.--cluster-nameThe name of the mongo cluster.-gName of resource group.Options
--cluster-nameThe name of the mongo cluster.--identity-providerThe user's identity provider definition.--object-id, --name, -nObject ID (client ID) of the Microsoft Entra principal.--rolesDatabase roles that are assigned to the user.