Search code examples
azureazure-cosmosdbazure-policyazure-role-environment

How to make Visible the Keys/Passwords in CosmosDB connection string - Azure


I have an issue with the account not being able to view the Keys of connection string in CosmosDB Azure portal. Look below as it is greyed out both read write and read only keys. Take note that this is only for user account.

enter image description here

Is there any permission/role to be assigned in order to make this visible? Thank you!


Solution

  • You'll need a role with the Microsoft.DocumentDB/databaseAccounts/readonlyKeys/* or Microsoft.DocumentDB/databaseAccounts/listKeys/* permissions. If the scope of the role should include access to the Cosmos Database and nothing else the most fitting role would be the DocumentDB Account Contributor role. Before granting it check its full list of actions first.

    Alternatively check the Cosmos DB Account Reader Role which only includes the readonly keys of the two options.