Hello @Prags ,
Thanks for the question and using MS Q&A platform.
The -deleteDeployment
flag is used to specify the deletion of the ADF deployment entry from the deployment history in ARM. In the post-deployment script, you will specify the below variation of parameters/arguments which includes code to delete resources (unwanted resources like pipelines, datasets, dataflows, linked services, integration runtimes) that have been removed in the current deployment (Nothing but deletes resources which are present in last deployment(ARM) but not in current deployment(ARM) from deployment history).
Post-deployment script - which will start your triggers once after the cleanup (delete) of unwanted resources is completed.
-armTemplate "$(System.DefaultWorkingDirectory)/<your-arm-template-location>" -ResourceGroupName <your-resource-group-name> -DataFactoryName <your-data-factory-name> -predeployment $false -deleteDeployment $true.
This will execute below piece of code from the script provided in the public documentation:
This is a sample script provided by ADF product team, but you can alter the script as per your custom requirement. In case if you have few resources like pipelines/datasets/linked services that are removed in the current deployment but were present in the previous deployment then you can just use the same post-deployment script provided in the doc to get rid of the unwanted resources.
Hope this clarifies.