• 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)

Alex Shapovalov

Alex Shapovalov is a founder of Yaplex - an IT consulting and software development company, located in Mississauga, Ontario. Alex provides IT consulting and .NET software development services in Canada and the USA.

Yaplex - Freelance developer - white logo on black background

Yaplex ® is a custom software development company located in Mississauga, Ontario. Yaplex was founded in 2013 and provides website development, mobile development, and custom .NET software development services.

Contact Information

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