azure query editor - connect to master database RRS feed

  • Question

  • Hi,

    I cannot currently use SSMS to connect to my Azure SQL database due to a port issue. I have been told to use the query editor directly from the azure portal. It's not ideal as it does not display my tables but will do for now.

    However, I need to create a new login and user for an external person who will log in using SQL authentication. I would normally go into the MASTER database in SSMS and create login with password and then create a user etc.

    Is this possible in the query editor within Azure? I logged in with an admin role and tried to use the master database for my query but was told that I could not switch to the master database from Azure. Is that correct? 

    As this person is external I cannot use active directory to help me.


    Tuesday, September 19, 2017 8:49 AM

All replies

  • Hello,

    Open SSMS, on the Object Explorer window/panel expand the Databases folder until you see the master database. Make a right click on it and select “New query”. Now you will be connected to the master database.

    You cannot use the query editor to switch between SQL Azure databases either by changing the combo box of available databases or by trying to make switch using USE statement.

    Hope this helps.


    Alberto Morillo

    Tuesday, September 19, 2017 11:40 AM
  • Why do create a login for the external person? You could just create a contained database user so authentication occurs at the database level like the example below. This could be done via the portal query editor. 

    CREATE USER ExternalPerson WITH PASSWORD='S$*if9c lw8sdfdf';

    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    Tuesday, September 19, 2017 12:04 PM
  • Hello, its not possible with the query editor to switch the databases. 

    Please use SSMS for this.

    Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh

    • Proposed as answer by Kapil.Kumawat Tuesday, September 19, 2017 12:47 PM
    Tuesday, September 19, 2017 12:43 PM
  • This doesn't work -- it spans a new query window that's not connected to Master.
    Monday, May 7, 2018 9:16 PM
  • SSMS doesn't permit switching databases and it's not clear how to connect directly to Master. 
    Monday, May 7, 2018 9:17 PM
  • SSMS doesn't permit switching databases and it's not clear how to connect directly to Master. 

    SSMS does permit one to change the database context to a user database using the database drop-down if initially connected to master. However, once a user database is selected, one can no longer switch between databases.

    To directly connect to master, connect as an admin with either <default> or master specified under the Connection Properties tab. This can be specified under the server registration properties or when connecting with a new query window.

    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    Tuesday, May 8, 2018 11:02 AM
  • Any luck? I am stuck exactly the same situation. :(

    None of the replies here is the solution.

    Tuesday, May 14, 2019 10:52 AM
  • I can see every single reply here basically doesnt' address the issue and I'm also facing the same problem. Not very helpful site.
    Monday, November 18, 2019 6:36 AM
  • Non-administrative users do not need access to master, where the CREATE USER T-SQL run against the target database is sufficient. CREATE LOGIN in master for this user is not required. Please see: Non-Administrative Users.

    If the user you are wanting to grant access for requires an administrative level static role, you will need to run CREATE LOGIN in master and given this situation of port 1433 being blocked, the Query interface in the portal will not suffice.



    Friday, November 22, 2019 1:13 AM
  • Azure SQL Database User Voice forum does not have any existing entries related to being able to have access to master for the purposes of running a CREATE LOGIN statement. Can someone please create an entry related to this request: User Voice filtered on query editor.

    Thank you!

    Friday, November 22, 2019 6:42 PM