Azure SQL Database "Login failed for user" contained users. I'm having a similar issue to this question (https://dba.stackexchange.com/posts/123094/edit)! I have followed the following article: https://azure.microsoft.com/en-gb/documentation/articles/sql-database-manage-logins/ and just cannot get it to fully work.

-- first, connect to the master database

CREATE LOGIN login1 WITH password='password';


-- Establish a new connection to the database

CREATE USER login1user FROM LOGIN login1;

GRANT CONNECT TO login1user

EXEC sp_addrolemember 'db_datareader', 'login1user ';

EXEC sp_addrolemember 'db_datawriter', 'login1user ';

EXEC sp_addrolemember 'db_ddladmin', 'login1user ';


The issue is, I cannot connect to my database with login1user. I have to use the login1 details, which isn't really what I was expecting to happen. I would be happy having the names the same, except for bullet point three in the remarks section of this article (https://msdn.microsoft.com/library/ff929188.aspx), suggests that this isn't best practise.

Any help appreciated!
It looks like you mixed a few different steps from the Azure article. Many of these Azure articles contain lots of great information but the layout is borderline horrible. Topics just blend into each other making it confusing for most readers (DB firewall configuration is another commonly confused doc).

If you want to use contained DBs with contained users, your create user statement should be something like

CREATE USER MyContainedUser01 WITH password='MyL@m3P@$$0rd';


as described in https://azure.microsoft.com/en-gb/documentation/articles/sql-database-manage-logins/#managing-contained-database-users

When you create a user mapped to a login as per your sample script, that's a regular, non-contained user. With that, you need to connect using the login which then maps to the user.