-
Notifications
You must be signed in to change notification settings - Fork 1
1: Using this repository
Most optimal way to use this repository is to clone(copy) it to your local computer.
Afterwards, you can than work with your scripts in the scripts folder. Ideally using a version of Visual Studio. You can view more information on how to setup Visual Studio for use on the DbUp website. You can then synchronize your local copy of this repository to one in the Azure Repos service in Azure DevOps for use.
From there you can create a new pipeline by using the existing YAML file called serverlessSQLPool-sqlpackage.yml. I go into more detail about how to do this in a blog post called Connect a Database Project in Azure Repos to Azure Pipelines.
Once done you can customize the YAML file used for the pipeline to suit your needs. Which you can find in the AzureDevOpsTemplates folder.
In order for this pipeline to work you need either a self-hosted agent with the latest version of sqlpackage installed or you can look to deploy sqlpackage to a Microsoft-hosted agent first in your pipeline.
Please note that by default you need the below variables created for this to work. I recommend doing this by creating at least one variable group:
- agentpool - The name of the agent pool you want to use (ideally a self-hosted one with latest sqlpackage installed). Otherwise you must put additional logic in this pipeline to deploy latest version of sqlpackage onto the agent
- TargetFile - The name of the dacpac that you want to be created
- SQLPoolEndPoint - The name of your serverless SQL Pool endpoint (which you can get in the Azure Synapse overview)
- SourceDB - The name of database in the serverless SQL Pool you want to extract the schema from
- SQLPooluser - A SQL login that can access the serverless SQL Pool
- SQLPoolpw - The p/w for the above SQL login
- SQLPoolartifactname - A name for the created artifact
- AzureSubscription - The Azure subscription that contains the serverless SQL Pool where you want to deploy the dacpac
- DestinationDB - The name of the target/destination database where you to deploy the dacpac
You can extend this however you see fit. For example, you can add a variable for a second serverless SQL Pool endpoint which belongs to another workspace.