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?

Connell.O'Donnell
  • 3,603
  • 11
  • 27
  • 61

1 Answers1

5

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
Alberto Morillo
  • 13,893
  • 2
  • 24
  • 30