Exclude/Skip files in VSTS Build and release

bluemoon522 picture bluemoon522 · Oct 25, 2017 · Viewed 12.2k times · Source

We are in process of creating architecture for VSTS CI/CD to deploy our web app to our Azure App Services. We want to exclude the web.config while deploying it to the Azure server as we are directly modifying the web.config on the different environment. CI Tasks looks like this: CI Taks

CD Task: Deploy Azure App Service I am aware of other ways of updating the web.config https://docs.microsoft.com/en-us/vsts/build-release/tasks/transforms-variable-substitution, but in our case we want to skip the web.config file. I couldn’t find the option to skip file in during release in VSTS as mentioned in this thread How do I exclude the .cs files within an artifact from a vs-team-services CI build? Is there a way to exclude certain files while building and deploying the release?

Answer

bluemoon522 picture bluemoon522 · Oct 26, 2017

Added -skip:objectName=filePath,absolutePath=web\.config in additional arguments. This skips updating the web.config file during deployment. Azure App Service Deployment