Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure pipeline delete Files on app service before deploy

I'm using Azure pipeline to deploy my asp.net web site on an app service. Before deploy, I need to remove some files on the remove app service. The only way is to use kudu api? Or I can use PowerShell script to access and manipulate files directly?

like image 796
alecasciaro Avatar asked Mar 12 '19 11:03

alecasciaro


People also ask

How do I delete files from Azure App Service?

Here is the doc about Azure Web App Service Deploy task. Select the option to delete files on the Azure App Service that have no matching files in the App Service package or folder. You can use Azure PowerShell task to run the Kudo API to delete the files.

How do I clean my Azure App Service?

In the Azure portal, select Resource groups from the portal menu and select the resource group that contains your app service and app service plan. Select Delete resource group to delete the resource group and all the resources. This command might take several minutes to run.

Can we deploy WAR file on Azure App Service?

You can deploy your WAR package to Azure App Service to run your Java web app using the Azure CLI, PowerShell, or the Kudu Publish API. Note: It is not recommended of deploying WAR / JAR / EAR packages using FTP or WebDeploy .


1 Answers

If you are using the 'Deploy Azure App Service' task you are able to explicitly select the way you deploy the application. By setting that to 'WebDeploy' you are able to set the task to remove any files that are on the App Service but are not present in the deployment package.

Configuration would look as follows:

enter image description here

like image 164
Remco Brilstra Avatar answered Sep 28 '22 11:09

Remco Brilstra