Can Azure App Service Storage Be Used Like Local Storage?

Shreyas Rastogi 225 Reputation points
2024-12-06T17:56:54.26+00:00

Currently, there is an ASP.NET app in .NET Framework 4.8 deployed on IIS running on a Windows server.

If this application migrates to an Azure App Service, which is hosted on a Windows App Service plan, can it utilize the storage of the App Service plan similarly to how it had storage on the Windows server? Or are changes needed to use Blob Storage or mount additional storage? The goal is to avoid making application changes for storage.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,965 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,301 Reputation points Moderator
    2024-12-06T23:47:41.3666667+00:00

    @Shreyas Rastogi when you move to Azure App Service on a Windows App Service plan, there are some important differences in local storage compared to a traditional Windows server you should be aware of.

    Azure App Service provides a limited local storage called "D:\home" or "local storage". This is ephemeral storage that does not persist between app restarts. It has a size limit (around 10-20 GB depending on the App Service plan). Content is not shared across multiple instances if you scale out

    If your application relies on local file storage, you'll need to modify your approach. Best practices recommend using Azure Blob Storage or Azure Files for persistent storage. This allows data durability, scalability, and ability to share across multiple app instances

    Azure Blob Storage vs. Azure Files

    a) Azure Files:

      - Can be mounted as a network drive
    
      - Supports SMB protocol
    
      - Minimal code changes required
    
      - Can replace direct file system access with minimal refactoring
    

    b) Azure Blob Storage with Azure StorageHelper libraries:

      - Can create abstraction layers to minimize code changes
    
      - Provides similar file access patterns to local file system
    

    Hope that helps. Please let us know if you have further questions

    -Grace

    0 comments No comments

Your answer

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