Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Users to SQL Azure Database with ARM template

I am trying to create users inside DB and grant some specific permission each user; with the help of ARM template. But I do not find a way to do it using ARM.

Can someone tell me is it supported by the ARM templates to

  1. Create Users for DB and grant permissions?
  2. does it support to deploy a Dacpac to DB?
like image 667
Pavan Avatar asked May 24 '17 19:05

Pavan


People also ask

How do I create a new user in a SQL Azure database?

Connect to your Azure SQL Database server with SSMS as an admin and choose the database you want to add a user to in the dropdown. Add Azure Active Directory user '[email protected]' then add it to the db_datareader and db_datawriter roles.


1 Answers

You can't insert users into a database using an ARM template to my knowledge. I've looked pretty closely - someone correct me if I'm wrong.

As for the ability to get data into the system, you have some options with VSTS Build.

  1. You can use a Powershell task to call invoke_sqlcmd, which you can insert users using your own script.

  2. My personal favorite is the Azure SQL Database deployment task, which will deploy a DACPAC. In the DACPAC you can set up users as needed.

like image 120
Rob Reagan Avatar answered Sep 19 '22 04:09

Rob Reagan