Cannot login as Contained User in SQL Database

Richard 1 Reputation point
2020-10-28T14:32:11.773+00:00

I have created a contained user in a database as follows:

CREATE USER devowner WITH PASSWORD = N'wombat'  

And added it to dbowner role:

ALTER ROLE db_owner ADD MEMBER devowner;  

But when trying to login, either via SSMS or sqlcmd, i get the error:
35782-image.png

I am specifying the correct database in SSMS and in the connection string for sqlcommand.

If I create a login, and then a user associated with the login, I can connect just fine. But the contained user cannot login.

I have also tried GRANT CONNECT to the user, but it has not helped.

What am I missing?

Thanks

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Vaibhav Chaudhari 38,971 Reputation points Volunteer Moderator
    2020-10-28T15:47:26.117+00:00

    I ran the same queries and it worked for me. Are you able to connect to the DB from SSMS? Ensure you specify the DB name as shown below

    35726-image.png

    ----------

    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    1 person found this answer helpful.

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.