Microsoft

How to Generate .DACPAC File in Your Build Artifact for Azure SQL Deployment

Digital Process Automation

You’d have to run the Azure SQL DacpacTask in your Release Pipeline to continuously deploy your database to Azure SQL. However, if your .dacpac file is not recognized in your build artifact during the DacpacTask, you have to manually add some lines in your Build Pipeline.

NOTE: I’d already deployed our local database to Azure SQL manually before implementing CI/CD for the database. Click here to learn how you can do that in SSMS.

First locate your .dacpac file in your project. From where your SQL project is, navigate to <name of your project>/bin/Release folder. Refer to the GIF below.

Bp9 2 Dacpac File Location

Microsoft - The Essential Guide to Microsoft Teams End-User Engagement
The Essential Guide to Microsoft Teams End-User Engagement

We take you through 10 best practices, considerations, and suggestions that can enrich your Microsoft Teams deployment and ensure both end-user adoption and engagement.

Get the Guide

Once you have found your .dacpac file, add a CopyFiles Task with a ‘**/*.dacpac’ under its Contents key and a PublishBuildArtifact task with a PathToPublish configured to where you .dacpac file is located in relation to your .NET Framework Web Application solution.

Bp9 P1

The PathToPublish in our example here is ‘$(Build.ArtifactStagingDirectory)/4 – Database/BootTrack.Database/BootTrack.Database/bin/Release’.

Once your build runs successfully, navigate to view your build artifact. If you correctly set your path to the file, you will see the .dacpac file in your artifact as shown below!

Bp9 3 Build Artifact Location

Add the path to your .dacpac file in your Azure SQL DacpacTask.

Bp9 P4

About the Author

David Hwang is an Associate Technical Consultant in the Sitecore/Microsoft Business Unit. He will be blogging about various concepts in technologies for beginners.

More from this Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up
Categories