It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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

0 votes
Answer accepted

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,034 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you