Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I remove extraneous files from Azure Web App during deployment?

lhambling March 14, 2019

Using pipe: atlassian/azure-web-apps-deploy:0.2.1 (or newer) is there a way to remove old files from the Azure Web App during deployment? I do not see any option in the pipe to do so.

For example the following currently occurs:

  • Deployment #1 includes a file called "test.txt", deployed to Azure via the Pipe.
  • A subsequent commit removes this file from the repository
  • Deployment #2 does not currently delete this file that is now extraneous from the Azure Web App.

2 answers

2 accepted

0 votes
Answer accepted
lhambling March 27, 2019

Thanks to David McGhee's answer I was led to this issue regarding the Azure CLI: https://github.com/Azure/azure-cli/issues/5007

It turns out that my described issue was not true. In my case what had actually happened was that the original file I was attempted to delete was deployed using a different mechanism (it was actually originally deployed via a local Git repository). On subsequent attempts to recreate the issue it turns out that:

In short, my issue was a non-issue - I simply deleted the extraneous files from previous deployment mechanisms and now my web app file system is syncing in line with the Bitbucket repo.

0 votes
Answer accepted
DavidM March 27, 2019

Looking at the source this pipe performs the deployment using the kudu zip push deployment for a web app. In a zip push files and directories found in the site that aren’t being overwritten by the deployment will be preserved, such as files deployed via FTP, created in the Functions portal or created by your app during runtime. I would suggest the way to remove files would be to use staging environment and a slot swap as part of deployment. Alternatively you could use the azure cli pipe to clean up/remove or an advanced method might be to try KuduSync.NET

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events