Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clean up wwwroot folder on the target Azure Websites Windows Server before each deployment in VSTS

Tags:

After about a dozen deployments, the wwwroot directory is filled with a lot of files due to active development and deployments. We are using VSTS's Azure App Service Deploy task to deploy to Azure Websites Windows Server for a ASP.NET Web API project, is there a way to clean up the wwwroot directory before deploying to the Avsts pre-deployment clean up?

like image 952
imgen Avatar asked Oct 18 '17 02:10

imgen


People also ask

How do I clean my Azure App Service?

Another trick to delete an entire Azure website deployment which can be done entirely in the Azure portal is: 1) Create a new empty deployment slot under the Azure website. 2) Swap it with the parent Azure website. That will give you an empty Azure website.

What the task can be used to deploy to a range of Azure app services?

The task can be used to deploy to a range of Azure App Services such as: Web Apps on both Windows and Linux. Web Apps for Containers. Function Apps on both Windows and Linux.

What is Azure App Service deployment?

What is Azure App Service? From the official product description, Microsoft Azure App Service is a fully managed platform for building, deploying, and scaling web apps. It is a PaaS (Platform as a service) that enables us to quickly deploy our app without worrying about infrastructure and performance.

How do I create a release pipeline in Azure DevOps for app service?

Create your pipeline Sign in to your Azure DevOps organization and navigate to your project. Go to Pipelines, and then select New Pipeline. Walk through the steps of the wizard by first selecting GitHub as the location of your source code. You might be redirected to GitHub to sign in.


1 Answers

When using the Azure App Service Deploy task, and you are using the Publish using Web Deploy option, there is an additional option to Remove Additional Files at Destination.

enter image description here

If you check this option, the deployment process will remove any files at the destination where there is no corresponding file in the package that is being deployed.

In other words, it'll remove any left over files from a previous deployment that are no longer required.

like image 101
Brendan Green Avatar answered Sep 19 '22 03:09

Brendan Green