Configure persistent storage for your App Service app and manage the storage separately.
Make static content like video and images readily available for your App Service app.
Write application log files or archive older application log to Azure File shares.
Share content across multiple apps or with other Azure services.
Let’s try to understand custom mounted storage benefits listed above using a real-life business scenario explained below:
Department A of a company uploads images to a file share using a web app hosted on Azure App Services for windows containers.
Department B of the same company performs actions like watermarking, resizing of the images uploaded by department A using a web app hosted on Azure App Services for Linux.
Azure SQL and Azure Storage File share are accessible only within the Azure VNET
Diagram below depicts sample deployment architecture for the scenario mentioned above:
<<Please note that the steps provided below are suited for successful deployment and execution of sample web applications provided as part of this blog. You should make necessary modifications as per your web application code and configuration requirements>>
Step 1: Create Azure Storage account, Create Azure App services Web App (Windows Container), Create Azure SQL Database, Configure an Azure File Share as a local share for your Web App and Configure Regional VNET integration
If you define "uploadPath” App Setting in both the places as shown above then the value of "uploadPath" provided in the Azure Portal will override the value provided in appsettings.json file.
App setting is named "uploadPath" for successful execution of sample code provided as part of this blog. You may choose any name for the app setting for your web applications
There are many different scenarios that can be enabled using the sample described above and the apps that are producing and consuming the content may be developed in technology of your choice including legacy frameworks enabling wide variety of app dev scenarios on Azure App Services ex: Invoice processing, Image processing, Content publishing to name a few.
As you can see that the content stored on same custom mounted storage can be shared across multiple web apps hosted within Azure App services and even across other Azure services like Azure VMS’s etc. while ensuring secure end to end access to your content across these Azure resources via Azure VNET integration.