Post-deployment script for CICD

Ksenija Saulic 0 Reputation points
2024-03-01T13:18:12.2466667+00:00

For CICD process in Azure DevOps, I don't want to delete anything from UAT.

I made changes to DEV and I created pre- and post-deployment scripts for UAT. For post-deployment script:

-armTemplate "$(System.DefaultWorkingDirectory)/<your-arm-template-location>" -ResourceGroupName <your-resource-group-name> -DataFactoryName <your-data-factory-name> -predeployment $false -deleteDeployment $false

I added -deleteDeployment $false, but every pipeline got deleted that didn't exist on DEV (or that I deleted from DEV).

How can I make sure that nothing will be deleted from UAT during CICD process?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargava-MSFT 31,361 Reputation points Microsoft Employee Moderator
    2024-03-01T21:17:47.7066667+00:00

    Hello Ksenija Saulic,

    Welcome to the Microsoft Q&A forum.

    Using CICD it only merges the changes, it doesn't delete/add any objects.

    In your case, every pipeline got deleted that didn't exist on DEV - this is because of the above reason I mentioned (CICD only merge the changes)

    The pre and post deployment scripts stop triggers before deployment and restart them afterward.

    and your understanding is wrong with respect to -deleteDeployment $false

    The -deleteDeployment flag is used to specify the deletion of the ADF deployment entry from the deployment history in ARM.

    https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery-sample-script

    enter image description here

    If you are looking to cherry pick specific pipelines using CICD, you need to consider isolating the artifacts in a separate branch and use the validate and deploy operation to deploy the artifacts from that branch.

    https://learn.microsoft.com/en-us/azure/synapse-analytics/cicd/source-control#unsupported-features

    https://techcommunity.microsoft.com/t5/azure-synapse-analytics-blog/automating-the-publishing-of-workspace-artifacts-in-synapse-cicd/ba-p/3603042

    I hope this answers your question.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.