2

How to change/reset the password for the User in Azure Postgresql Server through CLI. I know there's a way how to reset password through Portal but am looking for resetting through Azure CLI .

I tried ALTER USER {user} WITH PASSWORD '{password}'; but it needs superuser access. As far as I know, azure_superuser access is not granted so is there any way how to reset through CLI?

1 Answer 1

5
Answer recommended by Microsoft Azure Collective

On a single Postgresql server, you can change the administrator role's password with the following CLI command:

az postgres server update --resource-group myresourcegroup --name mydemoserver --admin-password <new-password>

On a flexible Postgresql server, You can change the administrator role's password with this CLI command

az postgres flexible-server update --resource-group myresourcegroup --name mydemoserver --admin-password <new-password>

Choose a password that has a minimum of 8 characters and a maximum of 128 characters. The password must contain characters from three of the following categories:

  • English uppercase letters
  • English lowercase letters
  • Numbers
  • Non-alphanumeric characters
Sign up to request clarification or add additional context in comments.

2 Comments

Can this be done via Azure Portal, do you know?
@Mitya. Sure you can. Please read here. learn.microsoft.com/en-us/azure/postgresql/single-server/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.