Change password in Azure CosmosDB MongoDB Vcore

Ziggy Zulueta 490 Reputation points MVP
2024-05-03T01:49:10.5333333+00:00

I created the database mentioned above and I want to change the password. I checked online and this was the way to do it. But it seems Azure is not supporting it. So how do we change the password?

db.changeUserPassword("accountUser", "SOh3TbYhx8ypJPxmt1oOfL")
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,632 questions
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 15,301 Reputation points
    2024-05-06T04:11:17.7566667+00:00

    Hi Ziggy Zulueta,

    Thanks for your patience and reply.

    Please use Azure Portal, open your Azure Cosmos DB for MongoDB (vCore), go to Overview section as shown below and use option "Reset Password" to change password of your admin username:

    User's image

    As per the documentation here https://video2.skills-academy.com/en-us/azure/cosmos-db/mongodb/how-to-setup-rbac#limitations, a user's password can earlier only be set/reset by through the Azure CLI / Azure PowerShell which is now possible through Azure Portal too.

    To update the user's password, send the new password in the password field.

    In Powershell:

    az cosmosdb mongodb user definition update --account-name <account-name> --resource-group <resource-group-name> --body {"Id":"test.myName","UserName":"myName","Password":"pass","DatabaseName":"test","CustomData":"Some_Random_Info","Mechanisms":"SCRAM-SHA-256","Roles":[{"Role":"My_Read_Only_Role101","Db":"test"}]}

    Please try and let us know if you could make it or face any issue.

    Awaiting you reply so that we can assist further.

    Thanks


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.