Search code examples
sql-serverazureazure-sql-databasesql-server-administration

Can SQL Azure Globan Admin & created user passwords be reset/changed?


After I provision a SQL Azure Single DB - with a Global Admin login/password - can it be changed after the initial deployement via SQL Scripts?

Can the passwords for the SQL logins/user created by the above Global Admin - be changed/reset after the initial deployment or setup via SQL Scripts?


Solution

  • RESET PASSWORD FOR SERVER ADMIN

    You can do this after initial deployment through any of these - Azure Portal, AZURE CLI, PowerShell or SQL Scripts

    SQL

    -- You should be connected to Master Database for this Server
    ALTER LOGIN [AdminAccountName] WITH Password='New_Password';
    

    Azure PORTAL

    Go to Azure portal, click SQL Servers, select the server from the list, and then click Reset Password.

    enter image description here


    RESET PASSWORD FOR OTHER USERS/LOGIN

    Yes, You can do this after initial deployment through SQL Scripts.

    Traditional model users

    -- You should be connected to Master Database for this Server
    ALTER LOGIN login_name WITH PASSWORD = 'New_Password';
    

    Contained Database model users

    -- You should be connected to User Database itself
    ALTER USER user_name WITH PASSWORD = 'New_Password';
    

    See these links for more details:

    Contained and Traditional Model Users Syntax Differences

    Azure SQL Logins and Users