Windows App Service - Connection to Storage File Share Fails

Bill B 1 Reputation point
2021-11-20T00:37:35.087+00:00

I am unable to connect my .net core (Windows) app service to my azure storage file share.
I've been through several articles to enable the mount to storage, which is in Preview but seems unusable.

Articles tried:
https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?tabs=portal&pivots=container-windows
https://azure.github.io/AppService/2018/09/24/Announcing-Bring-your-own-Storage-to-App-Service.html

Here are some commands I've tried:
az webapp config storage-account add --resource-group xxx --name ase-internal-xxxx --custom-id new-blob-mount --storage-type AzureFiles --share-name temp-space --account-name stinternalxxx --access-key "0bS" --mount-path "/local/Temp/Temp-Files"

If I omit the mount-path argument, it will mount the drive but it takes over the c drive. I am also unable to cd into any of the directories listed on my file share though I can see that they are there.

I have also tried using New-AzWebAppAzureStoragePath -Name "RemoteStorageAccount1" -AccountName "myaccount.files.core.windows.net" -Type AzureFiles -ShareName "temp-space" -AccessKey "0bS" -MountPath "/tmp/test"

with similar results.

The return error is 'Bad Request' on everything I enter into the mount-path argument. I've tried drive letters (C:\, e:), linux style paths (/local/tmp, /home/temp) all with the same result.

Please provide details of how to mount azure storage file shares on windows app service. I need additional drive space for the operations I'm performing.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,286 questions
Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
230 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,186 Reputation points Microsoft Employee
    2021-11-29T23:10:26.3+00:00

    Hi @Bill B ,

    BYOS for Windows App Service plans is not supported unless you're using a container app. You need to switch your app to a container app deployment, create a /tmp/test directory in your image and then configure your temp-space share mount to that directory. You can also switch to a Linux hosting plan, but it is advised that you don't map to /tmp or any subdirectories as that could lead to timeouts during app startup.

    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.