3

I have database project (.sqlproj) in Visual Studio where I create user like this:

CREATE USER [MyUser] WITHOUT LOGIN; --I dont want to store password in source control
GO
ALTER ROLE [db_datareader] ADD MEMBER [MyUser]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [MyUser]
GO
ALTER ROLE [db_executor] ADD MEMBER [MyUser]

I build dacpack in VSTS Build and deploy it to Azure in VSTS Release: enter image description here

How do I setup the continuous deployment so that it will create user with password?

Liero
  • 25,216
  • 29
  • 151
  • 297

1 Answers1

2

This plug-in in Azure Marketplace maybe useful.

You can also create logins using PowerShell and include conditional execution.

More alternatives explained here.

Hope this helps.

Alberto Morillo
  • 13,893
  • 2
  • 24
  • 30
  • 3
    I wonder nobody mentioned [SQLCMD Variables](https://msdn.microsoft.com/en-us/library/bb386162(v=vs.100).aspx), which is the solution I ended up with – Liero Oct 23 '17 at 09:03