Scenarios and samples for Mounting Azure Storage as a local share in a container app in App Service

Published Oct 28 2021 06:36 PM 1,823 Views
Microsoft

Developers can mount Azure Files as a directory share in Linux App Service (source code and custom Linux container) as well as Windows container (Preview)

The benefits of custom-mounted storage include:

  • 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:

 

 

blog_arch.png

 

<<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

 

  1. Create an Azure App Services Web App for Windows Container (https://docs.microsoft.com/en-us/azure/app-service/quickstart-custom-container?tabs=dotnet&pivots=co... )
  2. Create an Azure SQL Database (https://docs.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?tabs=azu... )
  3. Setup Regional VNET Integration for private connectivity between web app and database (https://docs.microsoft.com/en-us/azure/architecture/example-scenario/private-web-app/private-web-app )
  4. Deploy your web app code to Azure App Services web app for Windows Container created in step 1. Sample Source code for Image Upload Application is available at byosCPUplDwn/byosWinContUpload at master · gsethgit/byosCPUplDwn (github.com) and the sample app is available at https://gsethbyosblogwcont.azurewebsites.net
  5. Create Azure Storage Account & an Azure Files share and Setup Private Endpoint (https://docs.microsoft.com/en-us/azure/storage/common/storage-private-endpoints )
  6. Configure Azure Files share created in step 5 as local share for you Image Upload (Windows Container) web app(https://docs.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?tabs=portal&pi... )

 

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

 

gauravseth_1-1635543610975.png

 

2) Using Azure Portal to Create an "Application Setting " for your web app (Configure apps in the portal - Azure App Service | Microsoft Docs

 

gauravseth_0-1635543420568.png

 

*** Important

  • 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 application

 

Step 2: Create Azure App services Web App (Linux) and Configure an Azure File Share as a local share for your Web App

 

  1. Create an Azure App Services Web App for Linux (https://docs.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?tabs=net50&pivots=developme... )
  2. Deploy your web app code to Azure App Services web app for Linux created in step 1. Sample Source code for Image Processing Application is available at byosCPUplDwn/byosLinuxImageWTM at master · gsethgit/byosCPUplDwn (github.com) and the sample app is available at https://gsethbyosbloglinux.azurewebsites.net/
  3. Configure Azure Files share created above as local share for you Image Processing (Linux) web app (https://docs.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?tabs=portal&pi... )

 

*** 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

 

gauravseth_1-1635543610975.png

 

2) Using Azure Portal to Create an "Application Setting " for your web app (Configure apps in the portal - Azure App Service | Microsoft Docs

 

gauravseth_0-1635543420568.png

 

*** Important

  • 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.

%3CLINGO-SUB%20id%3D%22lingo-sub-2898095%22%20slang%3D%22en-US%22%3EScenarios%20and%20samples%20for%20Mounting%20Azure%20Storage%20as%20a%20local%20share%20in%20a%20container%20app%20in%20App%20Service%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2898095%22%20slang%3D%22en-US%22%3E%3CP%3EDevelopers%20can%20mount%20Azure%20Files%20as%20a%20directory%20share%20in%20Linux%20App%20Service%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-connect-to-azure-storage%3Ftabs%3Dportal%26amp%3Bpivots%3Dcontainer-linux%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Esource%20code%20and%20custom%20Linux%20container%3C%2FA%3E%3CSPAN%3E)%20%3C%2FSPAN%3Eas%20well%20as%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-connect-to-azure-storage%3Ftabs%3Dportal%26amp%3Bpivots%3Dcontainer-windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWindows%20container%20(Preview)%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EThe%20benefits%20of%20custom-mounted%20storage%20include%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EConfigure%20persistent%20storage%20for%20your%20App%20Service%20app%20and%20manage%20the%20storage%20separately.%3C%2FLI%3E%0A%3CLI%3EMake%20static%20content%20like%20video%20and%20images%20readily%20available%20for%20your%20App%20Service%20app.%3C%2FLI%3E%0A%3CLI%3EWrite%20application%20log%20files%20or%20archive%20older%20application%20log%20to%20Azure%20File%20shares.%3C%2FLI%3E%0A%3CLI%3EShare%20content%20across%20multiple%20apps%20or%20with%20other%20Azure%20services.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ELet%E2%80%99s%20try%20to%20understand%20custom%20mounted%20storage%20benefits%20listed%20above%20using%20a%20real-life%20business%20scenario%20explained%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EDepartment%20A%20of%20a%20company%20uploads%20images%20to%20a%20file%20share%20using%20a%20web%20app%20hosted%20on%20Azure%20App%20Services%20for%20windows%20containers.%3C%2FLI%3E%0A%3CLI%3EDepartment%20B%20of%20the%20same%20company%20performs%20actions%20like%20watermarking%2C%20resizing%20of%20the%20images%20uploaded%20by%20department%20A%20using%20a%20web%20app%20hosted%20on%20Azure%20App%20Services%20for%20Linux.%3C%2FLI%3E%0A%3CLI%3EAzure%20SQL%20and%20Azure%20Storage%20File%20share%20are%20accessible%20only%20within%20the%20Azure%20VNET%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDiagram%20below%20depicts%20sample%20deployment%20architecture%20for%20the%20scenario%20mentioned%20above%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22blog_arch.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F321085i3E1D3C13FB2A2D05%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22blog_arch.png%22%20alt%3D%22blog_arch.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CU%3E%3CFONT%20color%3D%22%23FF6600%22%3E%3CSTRONG%3E%26lt%3B%3CPLEASE%20note%3D%22%22%20that%3D%22%22%20the%3D%22%22%20steps%3D%22%22%20provided%3D%22%22%20below%3D%22%22%20are%3D%22%22%20suited%3D%22%22%20for%3D%22%22%20successful%3D%22%22%20deployment%3D%22%22%20and%3D%22%22%20execution%3D%22%22%20of%3D%22%22%20sample%3D%22%22%20web%3D%22%22%20applications%3D%22%22%20provided%3D%22%22%20as%3D%22%22%20part%3D%22%22%20of%3D%22%22%20this%3D%22%22%20blog.%3D%22%22%20you%3D%22%22%20should%3D%22%22%20make%3D%22%22%20necessary%3D%22%22%3E%26gt%3B%3C%2FPLEASE%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FU%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%201%3A%20Create%20Azure%20Storage%20account%2C%20Create%20Azure%20App%20services%20Web%20App%20(Windows%20Container)%2C%20Create%20Azure%20SQL%20Database%2C%20Configure%20an%20Azure%20File%20Share%20as%20a%20local%20share%20for%20your%20Web%20App%20and%20Configure%20Regional%20VNET%20integration%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ECreate%20an%20Azure%20App%20Services%20Web%20App%20for%20Windows%20Container%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fquickstart-custom-container%3Ftabs%3Ddotnet%26amp%3Bpivots%3Dcontainer-windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fquickstart-custom-container%3Ftabs%3Ddotnet%26amp%3Bpivots%3Dcontainer-windows%3C%2FA%3E%20)%3C%2FLI%3E%0A%3CLI%3ECreate%20an%20Azure%20SQL%20Database%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-sql%2Fdatabase%2Fsingle-database-create-quickstart%3Ftabs%3Dazure-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-sql%2Fdatabase%2Fsingle-database-create-quickstart%3Ftabs%3Dazure-portal%3C%2FA%3E%20)%3C%2FLI%3E%0A%3CLI%3ESetup%20Regional%20VNET%20Integration%20for%20private%20connectivity%20between%20web%20app%20and%20database%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Fexample-scenario%2Fprivate-web-app%2Fprivate-web-app%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Fexample-scenario%2Fprivate-web-app%2Fprivate-web-app%3C%2FA%3E%20)%3C%2FLI%3E%0A%3CLI%3EDeploy%20your%20web%20app%20code%20to%20Azure%20App%20Services%20web%20app%20for%20Windows%20Container%20created%20in%20step%201.%20Sample%20Source%20code%20for%20Image%20Upload%20Application%20is%20available%20at%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgsethgit%2FbyosCPUplDwn%2Ftree%2Fmaster%2FbyosWinContUpload%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EbyosCPUplDwn%2FbyosWinContUpload%20at%20master%20%C2%B7%20gsethgit%2FbyosCPUplDwn%20(github.com)%3C%2FA%3E%20and%20the%20sample%20app%20is%20available%20at%20%3CA%20href%3D%22https%3A%2F%2Fgsethbyosblogwcont.azurewebsites.net%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgsethbyosblogwcont.azurewebsites.net%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3ECreate%20Azure%20Storage%20Account%20%26amp%3B%20an%20Azure%20Files%20share%20and%20Setup%20Private%20Endpoint%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-private-endpoints%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fstorage%2Fcommon%2Fstorage-private-endpoints%3C%2FA%3E%20)%3C%2FLI%3E%0A%3CLI%3EConfigure%20Azure%20Files%20share%20created%20in%20step%205%20as%20local%20share%20for%20you%20Image%20Upload%20(Windows%20Container)%20web%20app(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-connect-to-azure-storage%3Ftabs%3Dportal%26amp%3Bpivots%3Dcontainer-windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-connect-to-azure-storage%3Ftabs%3Dportal%26amp%3Bpivots%3Dcontainer-windows%3C%2FA%3E%20)%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20use%20Azure%20Portal%20for%20custom%20mount%20configuration%20then%20refer%20to%20Azure%20How-To%20YouTube%20video%20%26nbsp%3Bwhich%20guides%20you%20on%20how%20to%20mount%20custom%20storage%20in%20Azure%20App%20services%20and%20configure%20Private%20endpoint%20connection%20between%20your%20web%20app%20and%20Azure%20Storage%20files%20mount%20%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOJkvpWYr57Y%26amp%3Blist%3DLL%26amp%3Bindex%3D1%26amp%3Bt%3D50s%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EHow%20to%20mount%20Azure%20Storage%20as%20a%20local%20share%20in%20a%20container%20app%20in%20App%20Service%20%7C%20Azure%20Portal%20Series%20-%20YouTube%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3BYou%20can%20also%20mount%20custom%20storage%20for%20your%20web%20app%20using%20below%20mentioned%20Azure%20Cli%20commands%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eaz%20webapp%20config%20storage-account%20add%20--resource-group%20%3CGROUP-NAME%3E%20--name%20%3CAPP-NAME%3E%20--custom-id%20%3CCUSTOM-ID%3E%20--storage-type%20AzureFiles%20--share-name%20%3CSHARE-NAME%3E%20--account-name%20%3CSTORAGE-ACCOUNT-NAME%3E%20--access-key%20%22%3CACCESS-KEY%3E%22%20--mount-path%20%3CMOUNT-PATH-DIRECTORY%3E%3C%2FMOUNT-PATH-DIRECTORY%3E%3C%2FACCESS-KEY%3E%3C%2FSTORAGE-ACCOUNT-NAME%3E%3C%2FSHARE-NAME%3E%3C%2FCUSTOM-ID%3E%3C%2FAPP-NAME%3E%3C%2FGROUP-NAME%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3ESample%3A%3A%3A%3C%2FU%3E%20az%20webapp%20config%20storage-account%20add%20--resource-group%20sampleresourcegroup%20--name%20sampleapp1%20--custom-id%20customblogstore%20--storage-type%20AzureFiles%20--share-name%20blogshare%20--account-name%20samplestorageaccountname%20--access-key%20%22samplestorageaccountkey%22%20--mount-path%20%2Fblogstore%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EVerify%20your%20configuration%20by%20running%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eaz%20webapp%20config%20storage-account%20list%20%E2%80%93resource-group%20%3CRESOURCE-GROUP%3E%20--name%20%3CAPP-NAME%3E%3C%2FAPP-NAME%3E%3C%2FRESOURCE-GROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3ESample%20%3A%3A%3A%3C%2FU%3E%26nbsp%3Baz%20webapp%20config%20storage-account%20list%20%E2%80%93resource-group%20sampleresourcegroup%20--name%20sampleapp1%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23FF6600%22%3E%3CU%3E%3CSTRONG%3EImportant%3A%3A%3A%3C%2FSTRONG%3E%3C%2FU%3E%20%3C%2FFONT%3EWe%20also%20need%20to%20provide%20mount%20path%20in%20both%20the%20sample%20application%20code%20provided%20.%20Now%20there%20are%202%20ways%20to%20provide%20value%20of%20mount%20path%20app%20setting%20for%20the%20sample%20applications%20%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1)%20Using%20an%20app%20setting%20in%20appsettings.json%20file%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gauravseth_1-1635543610975.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F321647i9DC3CC72AC33A6BF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22gauravseth_1-1635543610975.png%22%20alt%3D%22gauravseth_1-1635543610975.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2)%20Using%20Azure%20Portal%20to%20Create%20an%20%22Application%20Setting%20%22%20for%20your%20web%20app%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-common%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EConfigure%20apps%20in%20the%20portal%20-%20Azure%20App%20Service%20%7C%20Microsoft%20Docs%3C%2FA%3E)%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gauravseth_0-1635543420568.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F321646i881BE70C901F3374%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22gauravseth_0-1635543420568.png%22%20alt%3D%22gauravseth_0-1635543420568.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23FF6600%22%3E***%20Important%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EIf%20you%20define%20%22uploadPath%E2%80%9D%20App%20Setting%20in%20both%20the%20places%20as%20shown%20above%20then%20the%20value%20of%20%22uploadPath%22%20provided%20in%20the%20Azure%20Portal%20will%20override%20the%20value%20provided%20in%20appsettings.json%20file.%3C%2FLI%3E%0A%3CLI%3EApp%20setting%20is%20named%20%22uploadPath%22%20for%20successful%20execution%20of%20sample%20code%20provided%20as%20part%20of%20this%20blog.%20You%20may%20choose%20any%20name%20for%20the%20app%20setting%20for%20your%20web%20application%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EStep%202%3A%20Create%20Azure%20App%20services%20Web%20App%20(Linux)%20and%20Configure%20an%20Azure%20File%20Share%20as%20a%20local%20share%20for%20your%20Web%20App%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ECreate%20an%20Azure%20App%20Services%20Web%20App%20for%20Linux%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fquickstart-dotnetcore%3Ftabs%3Dnet50%26amp%3Bpivots%3Ddevelopment-environment-vs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fquickstart-dotnetcore%3Ftabs%3Dnet50%26amp%3Bpivots%3Ddevelopment-environment-vs%3C%2FA%3E%20)%3C%2FLI%3E%0A%3CLI%3EDeploy%20your%20web%20app%20code%20to%20Azure%20App%20Services%20web%20app%20for%20Linux%20created%20in%20step%201.%20Sample%20Source%20code%20for%20Image%20Processing%20Application%20is%20available%20at%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgsethgit%2FbyosCPUplDwn%2Ftree%2Fmaster%2FbyosLinuxImageWTM%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EbyosCPUplDwn%2FbyosLinuxImageWTM%20at%20master%20%C2%B7%20gsethgit%2FbyosCPUplDwn%20(github.com)%3C%2FA%3E%20and%20the%20sample%20app%20is%20available%20at%20%3CA%20href%3D%22https%3A%2F%2Fgsethbyosbloglinux.azurewebsites.net%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgsethbyosbloglinux.azurewebsites.net%2F%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EConfigure%20Azure%20Files%20share%20created%20above%20as%20local%20share%20for%20you%20Image%20Processing%20(Linux)%20web%20app%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-connect-to-azure-storage%3Ftabs%3Dportal%26amp%3Bpivots%3Dcontainer-linux%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-connect-to-azure-storage%3Ftabs%3Dportal%26amp%3Bpivots%3Dcontainer-linux%3C%2FA%3E%20)%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3E%3CFONT%20color%3D%22%23FF6600%22%3E***%3C%2FFONT%3E%3C%2FU%3E%20Mount%20same%20Azure%20File%20Share%20for%20both%20the%20web%20apps%20for%20content%20sharing%20between%20these%20sample%20web%20applications%20provided%20with%20this%20blog%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3ESample%3A%3A%3A%3C%2FU%3E%20az%20webapp%20config%20storage-account%20add%20--resource-group%20sampleresourcegroup%20--name%20sampleapp2%20--custom-id%20customblogstore%20--storage-type%20AzureFiles%20--share-name%20blogshare%20--account-name%20samplestorageaccountname%20--access-key%20%22samplestorageaccountkey%22%20--mount-path%20%2Fblogstore%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EVerify%20your%20configuration%20by%20running%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eaz%20webapp%20config%20storage-account%20list%20%E2%80%93resource-group%20%3CRESOURCE-GROUP%3E%20--name%20%3CAPP-NAME%3E%3C%2FAPP-NAME%3E%3C%2FRESOURCE-GROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3ESample%20%3A%3A%3A%3C%2FU%3E%26nbsp%3Baz%20webapp%20config%20storage-account%20list%20%E2%80%93resource-group%20sampleresourcegroup%20--name%20sampleapp2%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23FF6600%22%3E%3CU%3E%3CSTRONG%3EImportant%3A%3A%3A%3C%2FSTRONG%3E%3C%2FU%3E%20%3C%2FFONT%3EWe%20also%20need%20to%20provide%20mount%20path%20in%20both%20the%20sample%20application%20code%20provided%20.%20Now%20there%20are%202%20ways%20to%20provide%20value%20of%20mount%20path%20app%20setting%20for%20the%20sample%20applications%20%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1)%20Using%20an%20app%20setting%20in%20appsettings.json%20file%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gauravseth_1-1635543610975.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F321647i9DC3CC72AC33A6BF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22gauravseth_1-1635543610975.png%22%20alt%3D%22gauravseth_1-1635543610975.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2)%20Using%20Azure%20Portal%20to%20Create%20an%20%22Application%20Setting%20%22%20for%20your%20web%20app%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapp-service%2Fconfigure-common%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EConfigure%20apps%20in%20the%20portal%20-%20Azure%20App%20Service%20%7C%20Microsoft%20Docs%3C%2FA%3E)%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gauravseth_0-1635543420568.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F321646i881BE70C901F3374%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22gauravseth_0-1635543420568.png%22%20alt%3D%22gauravseth_0-1635543420568.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23FF6600%22%3E***%20Important%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EIf%20you%20define%20%22uploadPath%E2%80%9D%20App%20Setting%20in%20both%20the%20places%20as%20shown%20above%20then%20the%20value%20of%20%22uploadPath%22%20provided%20in%20the%20Azure%20Portal%20will%20override%20the%20value%20provided%20in%20appsettings.json%20file.%3C%2FLI%3E%0A%3CLI%3EApp%20setting%20is%20named%20%22uploadPath%22%20for%20successful%20execution%20of%20sample%20code%20provided%20as%20part%20of%20this%20blog.%20You%20may%20choose%20any%20name%20for%20the%20app%20setting%20for%20your%20web%20applications%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20are%20many%20different%20scenarios%20that%20can%20be%20enabled%20using%20the%20sample%20described%20above%20and%20the%20apps%20that%20are%20producing%20and%20consuming%20the%20content%20may%20be%20developed%20in%20technology%20of%20your%20choice%20including%20legacy%20frameworks%20enabling%20wide%20variety%20of%20app%20dev%20scenarios%20on%20Azure%20App%20Services%20ex%3A%20Invoice%20processing%2C%20Image%20processing%2C%20Content%20publishing%20to%20name%20a%20few.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%20that%20the%20content%20stored%20on%20same%20custom%20mounted%20storage%20can%20be%20shared%20across%20multiple%20web%20apps%20hosted%20within%20Azure%20App%20services%20and%20even%20across%20other%20Azure%20services%20like%20Azure%20VMS%E2%80%99s%20etc.%20while%20ensuring%20secure%20end%20to%20end%20access%20to%20your%20content%20across%20these%20Azure%20resources%20via%20Azure%20VNET%20integration.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2898095%22%20slang%3D%22en-US%22%3E%3CP%3ELearn%20different%20scenarios%20along%20with%20sample%20application%20on%20how%20to%20mount%20Azure%20Storage%20as%20a%20local%20share%20in%20a%20container%20app%20in%20Azure%20App%20Service%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2898095%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E.%20NET%20Core%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EASP%20.NET%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20App%20Service%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWeb%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Oct 29 2021 03:01 PM
Updated by: