If you want to create a user in the Azure SQL database, it’s quite easy. This article will discuss how to create a user in Azure SQL database.
How to create a user in Azure SQL database
You can follow the below steps to create a user in the Azure SQL database.
Creating a user in the Azure SQL Database involves the below key steps
- First, you must connect to the Azure SQL Database server with the SQL Server Management Studio as an admin in Master.
- Now you need to create a login (SQL Authentication) called “xyz” with a Password “Abc@1234”.
- The next step is to create a user and then map the user to the login XYZ you have created.
- Finally, You need to add it to the db_datawriter and db_datareader roles.
Make sure to run the below query on the Master
CREATE LOGIN xyz
WITH PASSWORD = 'Abc@1234'
Now choose the DB as User and run the below query
CREATE USER [xyz]
FOR LOGIN [xyz]
WITH DEFAULT_SCHEMA = dbo;
-- adding user to roles
ALTER ROLE db_datareader ADD MEMBER [xyz];
ALTER ROLE db_datawriter ADD MEMBER [xyz];
You may also like following the articles below
This article discussed how to create user in Azure SQL database. Thanks for reading this article !!!
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.