question

JigarkumarPatel-5373 avatar image
0 Votes"
JigarkumarPatel-5373 asked ·

Sample pre- and post-deployment script Azure Data Factory

In the document of CICD for Azure datafactory a Sample pre- and post-deployment script is given link : https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment#script.
predeployment $true -deleteDeployment $false
I understand that in pre deployment (i.e when predeployment $true -deleteDeployment $false) it will disables all the triggers from datafactory and post deployment (predeployment $false -deleteDeployment $true) it will delete piplines, dataflow,datasets etc which are no longer present in the ARM templae.

My question is, what is use of parameter -deleteDeployment ? Since the delete resources part is inside the else part and inside this else we have -deleteDeployment.

Can you lep me in understanding the use of this parameter -deleteDeployment.

azure-data-factory
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

VaibhavChaudhari avatar image
0 Votes"
VaibhavChaudhari answered ·

It's sample script provided by Microsoft and you can always change it. You're right. You can remove the deleteDeployment flag logic from the script.

Maybe in some rare case, when you don't want DevOps to delete any unwanted ADF objects (not present in ARM) to delete, you can put preDeployment to false and deleteDeployment to false in the DevOps step. That's the only use case of this flag I could think of.

Edit #1

Sorry, I was wrong. I checked the code carefully. Deletion of ADF objects will always happen by the code in ELSE block.

If deleteDeployment is true - it is deleting the last deployment from deployment history as mentioned in this blog
https://www.integration-playbook.io/docs/clearing-azure-deployments


Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav


· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Hi Vaibhav,

Thank you for your prompt reply.
You have mentioned that "Maybe in some rare case, when you don't want DevOps to delete any unwanted ADF objects (not present in ARM) to delete, you can put preDeployment to false and deleteDeployment to false in the DevOps step. That's the only use case of this flag I could think of."

But if you see the sample script in that when preDeployment is false the else block is executed and inside this else block there is code to remove the unwantred ADF object. So I dont see how setting deleteDeployment to false will not delete the unwated ADF object.

Is it that deleteDeployment is to be used when we want to delete the last deployment (i.e the latest deployment) done on ADF, in scenario like we want to roll back the deployment ?

0 Votes 0 ·
VaibhavChaudhari avatar image VaibhavChaudhari JigarkumarPatel-5373 ·

Please check Edit #1 section in my original response.

Adding @MartinJaffer-MSFT @HimanshuSinha-MSFT to help us in correcting and providing more details

0 Votes 0 ·