• Home /
  • Blog /
  • Create custom user login for Azure SQL Database
Sql Server Tutorials

Create custom user login for Azure SQL Database

Windows Azure user management is a little bit complicated, and unfortunately, there is no way to add users to existing database using Windows Azure management portal.

To add a new user to existing database in windows azure you have to do the following:

First, you need to create a new login on MASTER database using the following command

Important! It is important to verify what database is currently selected, the next step in creating a user in the Azure database should be done on MASTER database
CREATE LOGIN MyNewDbUser  WITH PASSWORD = 'P@ssw0rd'  
GO

Then you have to create User on your database using previously established login, and add permissions for the database using the following command

Important! Do not forget to switch database, it is NOT Master anymore
CREATE USER MyNewDbUser  FOR LOGIN MyNewDbUser  
GO
EXEC sp_addrolemember N'db_owner', N'MyNewDbUser'  
GO

How to create new database login in Microsoft Azure (Video)

Comments

Yaplex - Freelance developer - white logo on black background

Yaplex is an IT Consulting and .NET development company co-founded by freelance developer Alex Shapovalov who lives in Canada and provides software development services in Canada, USA and all over the world.

Contact Information

Toronto, Canada
Phone: +1 647 328 3809
Email: alex@yaplex.com