What are the challenges you face when working across database platforms? Take the survey

Taking DB backup in Azure Pipeline

Is RedGate supports for taking DB backup in pipeline? If possible, how to take it without data and taking only specific objects like Store Procedures and Views?




  • Options
    Kendra_LittleKendra_Little Posts: 139 Gold 3
    edited June 24, 2020 8:40AM

    To capture the schema for specific objects without data, you can use the SQL Compare command line. 

    Here's an example command. This example compares a database to the "schema-model" folder in the release artifact for a SQL Change Automation project. In an Azure DevOps pipeline, you can set up a step after creating a release artifact (but before deployment) and run this step, and it will write out a rollback script for the stored procedures, views, and functions which the release is modifying:


    Some notes:
    • In an Azure DevOps pipeline, you will probably need to use the ReleaseName variable for the path to the release artifact
    • If you are using a SQL Source Control project, you can do a similar pattern, but just point it to the folder holding your state in the release artifact
    • If you want to script out ALL of these types of objects, not just those modified in a release, you can compare the database to an empty folder

    Coincidentally, I'm working on some improved documentation and examples for this right now :)

    Hope this helps and let me know if you have questions,

  • Options
    ManisankarManisankar Posts: 1 New member
    edited November 23, 2020 10:03AM
    Hi Kendra ,

    Could you please provide if any detailed documentation with examples for taking backup in azure pipeline

Sign In or Register to comment.