1
votes

I'm deploying files to an Azure Web App via Octopus Deploy, and want to clean out the Azure Web App directories before deploying new versions. This way I can be sure I'm deploying each app version onto a clean slate. I don't want to entirely delete and re-create the app, because there are some app settings that need to carry over from previous deployments.

Kudu documentation lists the web app file structure here (all under D:\home), but I'm wondering if there's any possibility of other files outside of the D:\home directory that could affect app performance.

I tried running get-childItem D:\ -recursive in the kudu powershell console before and after deployment to compare results and found 268 new files (not counting those in wwwroot) after deployment, all within these directories:

  • D:\Windows\Temp
  • D:\Windows\Logs
  • D:\Windows\security\logs
  • D:\Users\\AppData\Roaming\Microsoft\SystemCertificates
  • D:\home\LogFiles
  • D:\home\Microsoft\Windows\PowerShell
  • D:\home\data\aspnet\CompilationSnapshots
  • D:\local\VirtualDirectory0\LogFiles
  • D:\local\VirtualDirectory0\data
  • D:\local\VirtualDirectory0\site\wwwroot
  • D:\local\VirtualDirectory0\Microsoft\Windows\PowerShell
  • D:\local\Config\
  • D:\local\Temporary ASP.NET Files\msdeploy

So which files do I need to clear or reset in order to ensure that new versions of the web app run as intended? Is it sufficient to clear out the wwwroot directory?

1
You may take charge of the deployment process by customizing the deployment process as mentioned in the links: github.com/projectkudu/kudu/wiki/Custom-Deployment-Script and github.com/projectkudu/kudu/wiki/Customizing-deploymentsAjayKumar-MSFT

1 Answers

3
votes

The only writable folders are d:\home and d:\local. But d:\local is temporary, and gets wiped clean on app restart. So effectively, you should only be concerned about d:\home when it comes to deployment.

Within that, wwwroot is typically the most important, though if you set up virtual directories and applications, you can end up with other folders as part of your app.

See also https://github.com/projectkudu/kudu/wiki/Understanding-the-Azure-App-Service-file-system which has related info.