file share as virtual directory on Azure App service RRS feed

  • Question

  • I have a web app deployed as Azure App Service and also using Azure Storage Files (both under same resource group).  How do I create a virtual directory under my web app that points to the Azure Storage file share?
    Friday, January 3, 2020 9:24 PM

All replies

  • Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused. Kindly try the following steps to isolate the issue:  

    Link storage to your web app (preview)

    To mount an Azure Files Share to a directory in your App Service app, you use the az webapp config storage-account add command. Storage Type must be AzureFiles.

    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 of form c:<directory name> >

    For more information, you may refer to this article: https://docs.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage#link-storage-to-your-web-app-preview

    This article is bit old however you may refer to  the suggestion mentioned here, It will be useful 

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.

    Please take a moment to "Mark as Answer" and/or "Vote as Helpful" wherever applicable. Thanks!

    Wednesday, January 8, 2020 9:04 AM
  • According to the docs, the "az webapp config storage-account" implies that my webapp is installed under a "custom Windows container" which it is not, unless that is something that is automatically created.  I simply created an App Service and installed my web app there.  When I try the suggested az webapp config in the Cloud Shell the response returned is "Bad Request".  I don't know if there is a problem with my command or if it won't work because of this "custom Windows container" limitation.  As for the command itself, it's unclear whether the mount-path should already exist of if this command creates it.  Here is the command I am running:

    az webapp config storage-account add --resource-group MyResourceGroupName --name mywebappname --custom-id dcsCustomId --storage-type AzureFiles --share-name music --account-name mystorageaccountname --access-key "jkld;sjfkdl;jfkdslafjkdsl;fjl" --mount-path c:\music

    The older link you referred me to looks like it will only work if my web app is hosted under a Windows virtual machine, which it is not.



    Wednesday, January 8, 2020 4:08 PM