How to Reset a SQL Server Admin Password in Azure

MDDM 20 Reputation points
2024-11-28T11:07:08.6633333+00:00

A SQL Server instance has limited access restricted to server admin credentials (SQL credentials). The goal is to either reset the admin password or create an additional credential, but access to the database is currently unavailable—only Azure configuration is accessible.

Is there a solution available for this issue?

There is critical data that cannot be accessed at the moment.

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,147 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nandan Hegde 32,831 Reputation points MVP
    2024-11-28T11:47:58.37+00:00
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Sai Raghunadh M 1,295 Reputation points Microsoft Vendor
    2024-11-28T11:55:33.13+00:00

    Hi @MDDM,

    Thanks for the question and using MS Q&A platform.If you are unable to access your SQL Server instance due to forgotten or lost admin credentials, and you only have access to Azure configuration (i.e., Azure portal), there are steps you can take to regain access by either resetting the admin password or creating a new admin credential. Here’s how you can address this issue:

    Reset SQL Server Admin Password via Azure Portal

    You can reset the SQL Server admin password using the Azure portal if you have access to the Azure subscription and the relevant SQL Server resource.

    Follow these steps:

    Sign in to the Azure portal (https://portal.azure.com).

    Navigate to the SQL Server instance:

    • In the Azure portal, search for SQL servers in the search bar.
    • Select the SQL server that is hosting your database.

    Reset the Server Admin Password:

    • Under Settings in the SQL Server blade, select Properties.
    • You’ll see an option for Server admin login and Password.
    • Change the password by entering a new one. This will reset the password for the SQL Server admin account.
    • Save the Changes: Click Save to apply the new password.

    Once the password is reset, you should be able to connect to the SQL Server instance using the new credentials.

    Use Azure CLI or PowerShell to Reset Password

    If you prefer automation, you can use Azure CLI or PowerShell to reset the password for the SQL Server admin:

    Using Azure CLI:

    az sql server update --name <server-name> --resource-group <resource-group> --admin-password <new-password>
    

    Using PowerShell:

    Set-AzSqlServer -ResourceGroupName <resource-group> -ServerName <server-name> -SqlAdministratorPassword <new-password>
    

    This will also allow you to reset the password from a command-line interface.

    Please go through the similar threads that might help you:

    https://learn.microsoft.com/en-us/answers/questions/1688201/im-trying-to-reset-password-for-my-sql-in-azure

    https://learn.microsoft.com/en-us/answers/questions/393443/how-to-recover-lost-password-for-sql-azure

    Hope this helps. Do let us know if you any further queries. If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.