I have a release pipeline which i use to deploy my resources to other environments. All works fine but the problem is that every time i deploy, all the resources even if no modification is made, are deployed. Is there a way through which i can do selective deployment; i.e. I deploy only those resources which have been modified. Any help would do. Thanks.
2 Answers
That`s a broad question. There is no out-of-box feature to select units to deploy. But you can use variables in the release pipeline:
- Define a variable for each resource/unit and set some default value and "Settable at release time" property.
- For each resource, define a separate task to deploy and define the custom condition, like:
and(succeeded(), eq(variables['Custom.DeployUnit1'], 'YES'))
- You can update these variables at the release creation time:

- 13,096
- 3
- 24
- 31
Is there any way to do selective deployment in azure devops?
There is no such out of box way to selective deployment in azure devops.
That because Azure devops release does not support release only changed files since only release changed files not always meaningful and could not archive what the project intend to release (such as the config file only changed in a commit).
But you could create a PowerShell script to compare timestamp for all files:
- Create XML file that stores the last upload/publish information of each files (e.g. file name, date time, changeset/commit version).
- Create a PowerShell script file that included the logical to compare files (get files metadata and compare with that XML file) and copy updated files to specific folder
- Publish the files in that folder
Check the similar thread for some more details.
Besides, if deploying via the deploy.cmd or MSDeploy.exe, you could also use the the -useChecksum
WebDeploy flag:
WebDeploy/MSDeploy Quick Tip: Only Deploy Changed Files
Hope this helps.

- 71,098
- 10
- 114
- 135