6

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?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
alecasciaro
  • 155
  • 1
  • 11

1 Answers1

7

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

Remco Brilstra
  • 798
  • 5
  • 13
  • I can't remove "additional files at destination" because on the app server there's a cms. That means that all cms files will removed. I need to delete specific files. – alecasciaro Mar 12 '19 at 12:54
  • 1
    In that case you might be able to use the "Post Deployment Action" which allows you to run a script after the files are copied over. – Remco Brilstra Mar 12 '19 at 14:44
  • i have similar issue facing, trying to deploy multiple webjobs on same app service using pipeline. After deployment it is removing all webjob and i can only see the lat one present. please help – user27178 May 22 '20 at 11:08
  • I have exactly the same problem. I need to delete two files before I deploy, because the CMS replace them. I can't delete all files not in the deploy package because this will delete too much, e.g., the media files uploaded into the CMS. – Elmar Höfinghoff Apr 21 '21 at 08:25
  • Is there a way to do this with a linux app? The button is not present – syter May 05 '22 at 11:34
  • What is the equivalent of this if you're using the YAML script instead? – FaCoffee Nov 28 '22 at 16:20