Developers can mount Azure Files as a directory share in Linux App Service (source code and custom Linux container), Windows containerand Windows Code (Preview)
The benefits of custom-mounted storage include:
Let’s try to understand custom mounted storage benefits listed above using a real-life business scenario explained below:
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 want to use Azure Portal for custom mount configuration then refer to Azure How-To YouTube video which guides you on how to mount custom storage in Azure App services and configure Private endpoint connection between your web app and Azure Storage files mount How to mount Azure Storage as a local share in a container app in App Service | Azure Portal Series ...
You can also mount custom storage for your web app using below mentioned Azure Cli commands:
az webapp config storage-account add --resource-group <group-name> --name <app-name> --custom-id <custom-id> --storage-type AzureFiles --share-name <share-name> --account-name <storage-account-name> --access-key "<access-key>" --mount-path <mount-path-directory>
Sample::: az webapp config storage-account add --resource-group sampleresourcegroup --name sampleapp1 --custom-id customblogstore --storage-type AzureFiles --share-name blogshare --account-name samplestorageaccountname --access-key "samplestorageaccountkey" --mount-path /blogstore
Verify your configuration by running the following command:
az webapp config storage-account list –resource-group <resource-group> --name <app-name>
Sample ::: az webapp config storage-account list –resource-group sampleresourcegroup --name sampleapp1
Important::: We also need to provide mount path in both the sample application code provided . Now there are 2 ways to provide value of mount path app setting for the sample applications :
1) Using an app setting in appsettings.json file
2) Using Azure Portal to Create an "Application Setting " for your web app (Configure apps in the portal - Azure App Service | Microsoft Docs)
*** Important
Step 2: Create Azure App services Web App (Linux) and Configure an Azure File Share as a local share for your Web App
*** Mount same Azure File Share for both the web apps for content sharing between these sample web applications provided with this blog
Sample::: az webapp config storage-account add --resource-group sampleresourcegroup --name sampleapp2 --custom-id customblogstore --storage-type AzureFiles --share-name blogshare --account-name samplestorageaccountname --access-key "samplestorageaccountkey" --mount-path /blogstore
Verify your configuration by running the following command:
az webapp config storage-account list –resource-group <resource-group> --name <app-name>
Sample ::: az webapp config storage-account list –resource-group sampleresourcegroup --name sampleapp2
Important::: We also need to provide mount path in both the sample application code provided . Now there are 2 ways to provide value of mount path app setting for the sample applications :
1) Using an app setting in appsettings.json file
2) Using Azure Portal to Create an "Application Setting " for your web app (Configure apps in the portal - Azure App Service | Microsoft Docs)
*** Important
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.