1

How to reset the sql admin password on Azure SQL Managed Instance if there is only one user/admin and the admin password is lost/forgotten?

Could it be done via portal or using some script?

1 Answer 1

4

The easiest way to reset the password is to go to the Azure portal, open the instance details blade and press Reset password button:

Reset sql admin password using the Azure portal

As an alternative, you can use AzureRm.Sql PowerShell library and Set-AzureRmSqlManagedInstance command:

$InstancePassword = "Newpassword1234" $SecureString = ConvertTo-SecureString $InstancePassword -AsPlainText -Force Set-AzureRmSqlInstance -Name "managedinstance1" -ResourceGroupName "ResourceGroup01" -AdministratorPassword $SecureString 

You can also use Azure CLI with az sql mi update command:

az sql mi update -g mygroup -n myinstance -i -p mypassword 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.