You may have faced scenarios when you need to change the password of your Azure SQL database. In this article, we will explain various ways to achieve this.
How To Reset Azure SQL Database Password
Let us discuss all the approaches individually.
Approach-1: Using Azure Portal
To reset Azure SQL database password, follow the below steps.
- Open the Azure portal and sign in to your Azure account.
- Navigate to your database whose password you want to change.
- Click on Server Name. Because you have to change the password of your server on which the database is running. Look at the below image for reference:

4. You will see the option Reset Password. Click on it to reset the password.

5. Now you can specify a new admin password for your Azure SQL server.
6. While entering the new password, you have to follow the password policy of Azure SQL. You have to follow all the rules, only then your password will be accepted. The rules are shown below in the image:

7. Once your new password is accepted, you have to re-enter the new password.
8. the Save button will be enabled after the password is matched. Click on the Save button to change the password. Now, you can log into your Azure SQL database using the new password.
Read How to create SQL authentication user in Azure SQL database
Approach-2: Using Powershell
Microsoft Azure has created a module called Az module, which you can use to manage the Azure resources from the PowerShell.
You can use Azure PowerShell from the portal where the necessary modules are installed or use Windows PowerShell. If you want to use Windows PowerShell, you have to install this Az module.
Once you have installed the Az module, you can follow the below steps to change the administrator password of your Azure SQL database:
- Run the Windows PowerShell as an administrator.
Note: Open the link shell.azure.com and switch the terminal to PowerShell to use the Azure PowerShell.
- Write the below command to connect your Windows PowerShell to your Azure account:
Connect-AzAccount
- You will see a sign in prompt for signing in to the Microsoft account. Sign in to your Microsoft account. Once you have signed in, you will see an output like in the image below:

- Now, write the script below to change the Azure SQL database password:
$password = ConvertTo-SecureString -AsPlainText -Force '*********'
Set-AzSqlServer -ResourceGroupName GroupAzure -ServerName mysql1000 -SqlAdministratorPassword $password
- In the above script, the $password is a variable into which we store our new password in a secure string.
- Set-AzSQLServer is a command line utility that sets the Azure SQL server properties. We are using this utility to change the password.
- GroupAzure is the resource group name, and mysql1000 is the server name on which the database runs.
- Once you execute the above query, your password will be changed, and you will see an output like in the below image:

Thus, you might have learned how to change the Azure SQL database password from PowerShell.
Read Backup and restore SQL Server to Azure Blob storage
Approach-3: Using Azure CLI
Follow the below steps:
- Open the link shell.azure.com in your browser and sign in to your Azure account.
- Make sure the terminal is in bash mode. Look at the below image for reference:

- Now execute the below command in the terminal to change the Azure SQL database administrator password:
az sql server update --resource-group GroupAzure --name mysql1000 --admin-password Kushal@123
- In the above command, we have used the az module that is used to manage the Azure resources from the command line. GroupAzure is the name of the resource group, MySQL1000 is the name of the SQL server instance, and Kushal@007 is the new administrator password for the database.
- You will see an output like in the below image after executing this command and your password will be changed.

Hence, you can use the Azure CLI to reset the administrator password for your Aure SQL database.
Thus, you might have learned how you can change the administrator password of your Azure SQL database in multiple ways.
Read Cannot open backup device operating system error 50 azure
Change password Azure database user
In the above sections, we explained how you can change the administrator password of your Azure SQL database. Now, we will explain how you can change a user’s password in the Azure SQL database.
We created a user in our Azure SQL database for the demonstration purpose. The username is TestUser, and the password for this user is User@123.
CREATE USER [TestUser] WITH PASSWORD = 'User@123';
ALTER ROLE [db_datareader] ADD MEMBER [TestUser];
Now, suppose you want to change your password. You can use the ALTER USER statement to alter the user’s information, such as username, password, schema, etc.
If you are logged in as the user TestUser, you can change the password for the user TestUser, by executing the ALTER USER statement as:
ALTER USER [TestUser] WITH PASSWORD = 'Password@123' OLD_PASSWORD= 'User@123'
Now, the new password will be Password@123.
Video Tutorial
Watch my YouTube video for a better understanding of the topic.
You may like:
- How to rename a database in Azure SQL
- SQL Server stored procedure if exists update else insert
- SQL Server check user permissions on table
- How to execute stored procedure in SQL Server
- Azure sql password validation failed
In this way, we can reset Azure SQL database password.
I am Bijay having more than 15 years of experience in the Software Industry. During this time, I have worked on MariaDB and used it in a lot of projects. Most of our readers are from the United States, Canada, United Kingdom, Australia, New Zealand, etc.
Want to learn MariaDB? Check out all the articles and tutorials that I wrote on MariaDB. Also, I am a Microsoft MVP.