after creating login in Azure SQL server, getting error while login to DB using SSMS

Lakshmi Narayana Sarma Bhamidipati 155 Reputation points
2024-11-07T08:53:18.8333333+00:00

Hi, i am trying to connect to Azure sql server using sql authentication. but it is throwing error. i have followed the below steps to create login. Error attached for reference. Thanks

CREATE LOGIN [john_doe]

WITH PASSWORD = 'MySecurePassword123!';

-- Step 2: Switch to the target database

USE YourDatabaseName;

-- Step 3: Create a user mapped to the login

CREATE USER [john_doe] FOR LOGIN [john_doe];

-- Step 4: Assign roles to the user (optional)

ALTER ROLE db_datareader ADD MEMBER [john_doe];

{4FFA31B6-1EEE-48C8-B3B9-D8FCB614D52E}

Azure SQL Database
{count} votes

Accepted answer
  1. Sai Raghunadh M 1,295 Reputation points Microsoft Vendor
    2024-11-27T09:39:32.1266667+00:00

    Hi @Lakshmi Narayana Sarma Bhamidipati,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer. Accepted answers show up at the top, resulting in improved discoverability for others.

    Issue: after creating login in Azure SQL server, getting error while login to DB using SSMS

    Solution:  Modify the code as ALTER ROLE db_owner ADD MEMBER [john_doe]; and disable Zscaler.

    If your issue remains unresolved or have further questions, please let us know in the comments so that we can assist. We are here to help you and strive to make your experience better and greatly value your feedback.


1 additional answer

Sort by: Most helpful
  1. Sai Raghunadh M 1,295 Reputation points Microsoft Vendor
    2024-11-07T09:41:37.6633333+00:00

    Hi @ Lakshmi Narayana Sarma Bhamidipati,

    Thanks for the question and using MS Q&A platform.

    It seems like you are facing Error: 916 while connecting to the Azure SQL server using SQL authentication.

    This error message can occur when the guest user does not have CONNECT permission to the named database and the trustworthy property is not set.

    please go through this document for more details: MSSQLSERVER_916.

    Here is the User Action to resolve this issue.

    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.


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.