How To Change User Id And Password For Azure SQL Server Database

This Azure tutorial will discuss how to change user ID and password for Azure SQL Server Database using Azure Portal, PowerShell, and Azure CLI.

Approach-1: Using Azure Portal

Let’s discuss here the easiest way to change the user ID and password for the Azure SQL server database. But before that, you should have a little idea of What is Azure SQL Database?.

Assuming you have enough idea about Azure SQL Database by now. Let’s discuss the steps to reset the password for the Azure SQL Server Database.

  1. Log in to the Azure Portal (https://portal.azure.com/).
  2. Once you have logged in to the Azure Portal, search for SQL Server and click on the search result SQL Server.
Azure SQL Database Change User Password

3. On the SQL servers page, you can see the list of databases that you have created already. Click on the one for which one, you want to change the user ID and password.

How To Reset Azure SQL Server Password

4. On the overview tab of your SQL server database page, click on the Reset password button as highlighted below.

azure sql change user password

5. On the Reset admin password window, enter the new password and confirm the password, and then click on the Save button to update the password or click on the Discard button to discard the changes.

how to change azure sql server admin password

6. Once you click on the Save button, it will take a few seconds to update the new password, and then it will show you the message “Successfully reset administrator password.”

the parameter password cannot be provided for users that cannot authenticate in a database

Note: An important point to remember here is, the admin login name can’t be changed once it has been created. You can only able to change the password.

This is How To Change User ID and Password For Azure SQL Server Database.

Approach-2: Using PowerShell

You can also reset the password of your Azure SQL Server Database using PowerShell. Follow the below steps.

  1. Open the PowerShell ISE using Run as Administrator mode.
azure sql change user password

2. Now, run the Below PowerShell Script to reset the Password For your Azure SQL Server Database.

$pwd = ConvertTo-SecureString -AsPlainText -Force 'Raj@######'
Set-AzureRmSqlServer -ResourceGroupName Demo123 -ServerName test45 -SqlAdministratorPassword $pwd

Where, Demo123 is the Resource Group name, test45 is the Azure SQL Server Database name in my case. Make sure to change the resource group and database server name based on yours.

Once you run the above script, It will successfully reset your Azure SQL Server Database password and get the below Output.

ResourceGroupName        : Demo123
ServerName               : test45
Location                 : eastus
SqlAdministratorLogin    : rajkishore
SqlAdministratorPassword : 
ServerVersion            : 12.0
Tags                     : {}
Identity                 : 
FullyQualifiedDomainName : test45.database.windows.net
ResourceId               : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourc
                           eGroups/Demo123/providers/Microsoft.Sql/servers/test45
MinimalTlsVersion        : 
PublicNetworkAccess      : Enabled

Check out this below

azure sql server change admin password

Approach-3: Using Azure CLI

Follow the steps below

  1. Log in to the Azure Portal (https://portal.azure.com/).
  2. Click on the Cloud Shell button, as highlighted below.
reset azure sql database password

3. Paste the script below on the Cloud Shell window to change the Azure SQL Server Database password.

az sql server update --resource-group Demo123 --name test45 --admin-password Raj@@@@@@

Where Demo123 is the name of the resource group, and test45 is the Azure SQL Server Database name. Make sure to change the resource group and Azure SQL Database server name based on yours.

Once you run the above script, it will immediately change the Password of your Azure SQL Server Database. You will get the below output

PS /home/bijay> az sql server update --resource-group Demo123 --name test45 --admin-password Raj@@@@@@@
{
  "administratorLogin": "rajkishore",
  "administratorLoginPassword": null,
  "fullyQualifiedDomainName": "test45.database.windows.net",
  "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/Demo123/providers/Microsoft.Sql/servers/test45",
  "identity": null,
  "kind": "v12.0",
  "location": "eastus",
  "minimalTlsVersion": null,
  "name": "test45",
  "privateEndpointConnections": [],
  "publicNetworkAccess": "Enabled",
  "resourceGroup": "Demo123",
  "state": "Ready",
  "tags": {},
  "type": "Microsoft.Sql/servers",
  "version": "12.0"
}

You can see the output as below

how to change azure sql server admin password

You may also like following the below Articles

Wrapping Up

This article discusses how To Change User Id And Password For Azure SQL Server Database. I hope you have enjoyed this article !!!

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!