Share via

How to give access to sql db on azure

Xamide 0 Reputation points
2025-11-20T14:29:21.39+00:00

Kind of a dumb question but how do I give access to a database created on my server to other user? How can they find it from their account?

Azure SQL Database

2 answers

Sort by: Most helpful
  1. Anonymous
    2025-11-26T09:15:54.86+00:00

    Hi Xamide,

    If you are still having confusion you can go these steps and do let us know for any clarification.

    1. Determine Access Type: First, decide how you want to authenticate the user. You can use either SQL Authentication (username and password) or Microsoft Entra authentication.
    2. Adding a User:
      • If you're using SQL Authentication, connect to your database using SQL Server Management Studio (SSMS) and execute the following commands:
             CREATE USER [NewUser] WITH PASSWORD = 'YourStrongPassword1';
             ALTER ROLE db_datareader ADD MEMBER [NewUser];
             ALTER ROLE db_datawriter ADD MEMBER [NewUser];
        
        If you're using Microsoft Entra Authentication, use this command to add the user:
             CREATE USER [<Azure_AD_principal_name>] FROM EXTERNAL PROVIDER;
             ALTER ROLE db_datareader ADD MEMBER [<Azure_AD_principal_name>];
             ALTER ROLE db_datawriter ADD MEMBER [<Azure_AD_principal_name>];
             ```Reference Document:
        
        

    https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/security-manage-database-users

    Kindly consider Upvoting and accept the answer if the provided information helpful, please let us know if you have further queries on this.

    Thanks!

    0 comments No comments

  2. Q&A Assist
    2025-11-20T14:29:43.47+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To give access to a database created on your Azure SQL server to another user, you can follow these steps:

    1. Choose the Authentication Type: Decide whether you want to use SQL authentication or Microsoft Entra authentication.
    2. Create a User:
      • For SQL Authentication:
        1. Connect to the database using a tool like SQL Server Management Studio.
        2. In Object Explorer, right-click the database and select New Query.
      1. Enter the following command to create a user:
               CREATE USER ApplicationUser WITH PASSWORD = 'YourStrongPassword1';
               
        
      User Access: Once the user is created and granted the necessary permissions, they can connect to the database using their credentials. If they are using SQL authentication, they will need the username and password you set. For Microsoft Entra authentication, they will use their Microsoft Entra account credentials.

    By following these steps, the user should be able to access the database from their account.


    References:

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.