Regarding C:\local on AppService instances

航 鈴木 20 Reputation points
2025-09-25T00:00:09.89+00:00

We have encountered an issue where the free space on C:\local of our AppService instances has reached 0.

User's image

Upon investigating where the space in C:\local is being consumed, we found that the VirtualDirectory0 folder is significantly contributing to this. We observed that VirtualDirectory0 has the same structure as C:\home. User's image

Regarding the above issue, please let us confirm the following two points:

  1. The reason why C:\local\VirtualDirectory0 has the same structure as C:\home.
  2. How to handle C:\local running out of free space. When this issue occurred this time, the free space in C:\local increased after deleting some log files (under C:\home\site\wwwroot\App_Data\logs) and restarting the instance. Please let us know if there are any other effective countermeasures you can suggest.

Thank you for your assistance.

Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 18,390 Reputation points Volunteer Moderator
    2025-10-06T08:25:32.1033333+00:00

    hi

    unning out of space on C:\local can bring your app service to a complete halt.

    the reason C:\local\VirtualDirectory0 mirrors C:\home is due to how azure app service handles content synchronization. when you deploy your application, the platform copies your content from the persistent C:\home storage to the local, faster ssd (C:\local) for better performance. VirtualDirectory0 is essentially a working copy of your live site.

    for the space issue. C:\local is a temporary drive with limited space, and it's not meant for storing data that grows over time. your app's log files, which are being written to C:\home\site\wwwroot\App_Data\logs, are also being duplicated to this local cache, consuming the precious space.

    your approach of deleting the log files and restarting is a valid short term fix, but here are more sustainable solutions.

    change your log file path. configure your application to write logs directly to the persistent D:\home drive instead of the wwwroot folder. a path like D:\home\LogFiles\yourapp is much safer and won't be synced to C:\local.

    implement log rotation. set up your logging framework to automatically archive or delete old log files. this prevents any single log file from growing indefinitely and filling up the drive.

    clean up deployment artifacts. if you have a lot of previous deployment packages in C:\local\Temp, you can safely delete them. the platform manages the current deployment.

    stop writing logs to the synced wwwroot folder, and instead write them directly to D:\home. this is the most effective long term solution to prevent C:\local from filling up.

    regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.