Deploying DACPAC as new database in Azure

Posted on

The following powershell script can be used to deploy a DACPAC file to a new (or replace an existing) database in Azure.

Notice that Azure and SQL credentials are not taken as parameter, but instead the  Get-Credential command is called. It works well in desktop, but not necessarily as an automated script without human intervention. The code can be easily modified for that purpose, though. The script above can be executed with the following command: