how do i add a new user in azure sql

James Pruett 85 Reputation points
2025-12-26T05:28:34.8066667+00:00

Hi,

I want to add a test credentials . Some un pw which can create sql tables.

I am on this screen:

User's image

from that screen copilot says to

User's image

it says to go to query editor preview, but all i see is this:

image (8)

Is this because I have a free version ??

thanks for any leads

jim

Azure SQL Database
0 comments No comments

Answer accepted by question author
Erland Sommarskog 137.2K Reputation points MVP Volunteer Moderator
2025-12-26T10:05:04.87+00:00

Copilot seems to be mixing things up. The Query Editor is only available if you are on the blade for an individual database, and then you can only connect to that database; there is no database dropdown.

As long as you are on Windows, the easiest way to connect is to use SQL Server Management Studio (SSMS).If you are on a different platform, you can use Visual Studio Code with some mssql extension. I don't use VS Code myself, so I am foggy on the details.

Then again, you can use the Query Editor, as you can add a user directly to the database. For a user that can create tables and that, you would run like in this example:

CREATE USER kalleanka WITH PASSWORD = 'Ankeborg forever!'
CREATE ROLE my_ddladdmin
DENY ALTER ANY DATABASE DDL TRIGGER TO my_ddladmin
ALTER ROLE db_ddladmin ADD MEMBER my_ddladmin
ALTER ROLE my_ddladmin ADD MEMBER kalleanka

Here kalleanka is just a token username. The ballet with my_ddladmin is something you would only do once per database. This step is required, because the built-in role db_ddladmin incorrectly, in my opinion, gives the right to fiddle with DDL triggers, so we need a role that can do all DDL, except for DDL triggers. (I realise that this may be a little advanced for where you are now. But when it comes to security, it's better to start doing it right from the beginning.)

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2025-12-26T06:21:34.4866667+00:00

    Hi @James Pruett

    Thanks for reaching out to Microsoft Q&A! Here’s a step-by-step guide to help you fix the issue.

    It looks like you're trying to add a new user to your Azure SQL Database so they can create tables. Here’s how you can do that using either SQL authentication or Microsoft Entra authentication.

    Using SQL Authentication:

    1. Connect to your Azure SQL Database using a tool like SQL Server Management Studio (SSMS).
    2. Open a new query window.
    3. Run the following SQL command to create a new user with a password:
    CREATE USER YourUserName WITH PASSWORD = 'YourStrongPassword!';
    

    Replace YourUserName with the desired username, and make sure the password meets Azure's complexity requirements.

    1. Grant the necessary permissions to the user so they can create tables:
    ALTER ROLE db_datareader ADD MEMBER YourUserName;
    ALTER ROLE db_datawriter ADD MEMBER YourUserName;
    ALTER ROLE db_ddladmin ADD MEMBER YourUserName;
    

    This gives them read, write, and Data Definition Language (DDL) permissions.

    Using Microsoft Entra Authentication:

    1. Ensure that your Azure SQL Database has a Microsoft Entra admin configured.
    2. Log in using the Microsoft Entra admin account.
    3. Create the user with the following command:
    CREATE USER [Azure_AD_principal_name] FROM EXTERNAL PROVIDER;
    

    Replace Azure_AD_principal_name with the user’s email or Microsoft Entra identity.

    1. Assign necessary permissions:
    ALTER ROLE db_datareader ADD MEMBER [Azure_AD_principal_name];
    ALTER ROLE db_datawriter ADD MEMBER [Azure_AD_principal_name];
    ALTER ROLE db_ddladmin ADD MEMBER [Azure_AD_principal_name];
    

    Troubleshooting:

    If you’re not seeing certain options, like the query editor, it could be a limitation of the free version you mentioned. In some cases, certain features or access levels might be restricted based on your service plan.

    Follow-Up Questions:

    • Are you currently connected to your Azure SQL Database?
    • What tool are you using to access your database?
    • Could you confirm if you have administrative privileges to create users?
    • What specific version of Azure SQL are you using?

    Hope this helps! Feel free to reach out if you have any further questions!

    References:

    Was this answer helpful?

    0 comments No comments

Your answer

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