Alma
Alma

Reputation: 4390

How delete all the files that are in Folder in Azure app service using Kudu console

I have a Temp Folder in Azure app service, I need to delete files that are inside it, I use Kudu console to login, the Folder in c:\Home\Mysite\wwwroot\Temp

How and with what command I can delete all the files that are in this folder?

Upvotes: 3

Views: 10014

Answers (2)

AjayKumar
AjayKumar

Reputation: 3163

I understand it’s a delayed response. Apologies for the late answer.

On Azure App Service WebApp (PAAS solution), unlike Persisted files, these files (temp) are not shared among site instances. Also, you cannot rely on them staying there. When you scale out, each instance has its own temp folder. When you restart your WebApp, you'll find that all of these folders get reset to their original state. Those files only get cleaned when your site is restarted.

Another important note is that the Main site and the scm site do not share temp files. So, if you write some files there from your site, you will not see them from Kudu Console (and vice versa). You can make them use the same temp space if you disable separation (via WEBSITE_DISABLE_SCM_SEPARATION). Just highlight this for additional info, but note that this is a legacy flag, and its use is not recommended/supported.

You may check your WebApp limit and usage in portal by going to "Diagnose and solve problems" section of your App Service blade, selecting "Best Practices", "Best Practices for Availability, Performance", and then "Temp File Usage On Workers". Please note that the displayed usage and limits are per worker, and are aggregated across all apps in the same app service plan.

Ref: Kindly check these GitHub wiki and Operating system functionality on Azure App Service for more info.

Upvotes: 0

Jaydeep Suryawanshi
Jaydeep Suryawanshi

Reputation: 551

We can use below command to delete all files from respective folder through KUDU console using cmd.

Remove-Item –path c:\Home\Mysite\wwwroot\Temp\* –recurse

Upvotes: 1

Related Questions