Set Azure Storage Account mount path with Bicep

Previously, with Azure CLI script, I had the following Storage Account config:

az webapp config storage-account add \
  --resource-group $resourceGroup \
  --name $functionAppName \
  --storage-type AzureFiles \
  --share-name $shareName \
  --custom-id $shareId \
  --account-name $AZURE_STORAGE_ACCOUNT \
  --mount-path $mountPath \

Now, I'm trying to write this with Bicep, but I can't find any config for mount-path. Is there any possibility to set this in a Bicep file?

1 answer

  • answered 2021-09-12 10:53 Thomas

    The Web Apps - Update Azure Storage Accounts accepts a dictionary of storage properties, so something like that should work:

    var webAppName = 'web app name'
    var storageAccountName = 'storage account name'
    var shareName = 'share name'
    var mountPath = 'mount path'
    
    resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
      name: storageAccountName
    }
    
    resource storageSetting 'Microsoft.Web/sites/config@2021-01-15' = {
      name: '${webAppName}/azurestorageaccounts'
      properties: {
        '${shareName}': {
          type: 'AzureFiles'
          shareName: shareName
          mountPath: mountPath
          accountName: storageAccount.name      
          accessKey: listKeys(storageAccount.id, storageAccount.apiVersion).keys[0].value
        }
      }
    }
    
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum