How to clear Temp storage without restarting Azure Web App

Ryan Hill 26,316 Reputation points Microsoft Employee
2021-07-28T21:17:27.897+00:00

I want to clear the Temp directory for my Web App, however I do not want the app to undergo a restart. Is there a way to just empty out the temp space directly?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,047 questions
0 comments No comments
{count} votes

Accepted answer
  1. Niharika Koneru 441 Reputation points Microsoft Employee
    2021-07-28T22:17:33.49+00:00

    Yes, temporary storage can be emptied without restarted the Web App. However, it is notable that doing so while the app is running can have unexpected consequences.

    The steps to do so would be as follows-

    1. Ensure that this Web App has the app setting which combines the app and Kudu processes:
      https://github.com/projectkudu/kudu/wiki/Configurable-settings#use-the-same-process-for-the-user-site-and-the-scm-site
    2. Navigate to Kudu (<web-app-name>.scm.azurewebsites.net) -> Debug Console -> Cmd
    3. Select the Globe (see screenshot) and run the following command: del /q/f/s %TEMP%*

    Also note that adding an application setting to the Web App will restart it, which means to empty temporary storage without restarting the app this setting would have needed to be present beforehand.

    118804-picpost.png

    For more information on handling temporary storage with your Azure Web App, please see the following video- Video:Troubleshoot Temporary Storage on Azure App Service - Azure | Microsoft Learn

    0 comments No comments

0 additional answers

Sort by: Most helpful