Forum Discussion
DarrenMArdex
Oct 06, 2022Copper Contributor
ASP.NET Bundling + CI/CD - how to handle when a bundled file is deleted or renamed
We are using Azure DevOps to run a CI/CD pipeline to our various environments. We recently encountered an issue where one of the developers re-named a TypeScript file - perfectly reasonable thing to ...
- Oct 07, 2022Thanks for the details.
Take a look at the task documentation here: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/iisweb-app-deployment-on-machine-group-v0?view=azure-pipelines
It has a flag called RemoveAdditionalFilesFlag. Its a boolean flag. According to the flag description from documentation - it is supposed to "Remove Additional Files at Destination". By default the value for this flag is false. So the deployment wont remove any additional files present on the server that was not present in the currently deployed deployment.
I believe this is the flag you are looking for.
Let me know If this works for you.
Hope this helps you.
DarrenMArdex
Oct 06, 2022Copper Contributor
Hi,
Thanks for the reply. Apologies, wasn't sure what detail I needed to include.
We are using a YAML file to define the pipeline steps. It is deploying to a VM.
Deployment steps are as follows:
- stage: Deploy
displayName: Deploy to IIS
dependsOn: Build
jobs:
- deployment: DeploytoIIS
displayName: Deploy the web application to dev environment
environment:
name: Development-env-02
resourceType: VirtualMachine
strategy:
runOnce:
deploy:
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'specific'
downloadPath: '$(System.ArtifactsDirectory)'
- task: IISWebAppDeploymentOnMachineGroup@0
displayName: 'Deploy IIS Website'
inputs:
WebSiteName: '$(websiteName)'
Package: '$(System.ArtifactsDirectory)\**\Zeus.zip'
So maybe there is a clean step we can include?
Lohith_GN
Oct 07, 2022Copper Contributor
Thanks for the details.
Take a look at the task documentation here: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/iisweb-app-deployment-on-machine-group-v0?view=azure-pipelines
It has a flag called RemoveAdditionalFilesFlag. Its a boolean flag. According to the flag description from documentation - it is supposed to "Remove Additional Files at Destination". By default the value for this flag is false. So the deployment wont remove any additional files present on the server that was not present in the currently deployed deployment.
I believe this is the flag you are looking for.
Let me know If this works for you.
Hope this helps you.
Take a look at the task documentation here: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/iisweb-app-deployment-on-machine-group-v0?view=azure-pipelines
It has a flag called RemoveAdditionalFilesFlag. Its a boolean flag. According to the flag description from documentation - it is supposed to "Remove Additional Files at Destination". By default the value for this flag is false. So the deployment wont remove any additional files present on the server that was not present in the currently deployed deployment.
I believe this is the flag you are looking for.
Let me know If this works for you.
Hope this helps you.
- DarrenMArdexOct 09, 2022Copper ContributorThat looks to be exactly what I want. Will give it a try, thanks!