Skip to content

Instantly share code, notes, and snippets.

@andrewmatveychuk
Created November 11, 2024 12:42
Show Gist options
  • Save andrewmatveychuk/ba3046eaf9203f40a132e3acf20ca366 to your computer and use it in GitHub Desktop.
Save andrewmatveychuk/ba3046eaf9203f40a132e3acf20ca366 to your computer and use it in GitHub Desktop.
Referencing Storage account access keys in Bicep
resource existingStorageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = {
name: storageAccountName
}
resource existingWebApp 'Microsoft.Web/sites@2020-09-01' existing = {
name: webAppName
}
resource siteConfig 'Microsoft.Web/sites/config@2023-12-01' = {
parent: existingWebApp
name: 'web'
properties: {
// ... redacted
azureStorageAccounts: {
ContentFilesVolume: {
type: 'AzureFiles'
accountName: existingStorageAccount.name
shareName: fileShareName
mountPath: containerMountPath
accessKey: existingStorageAccount.listKeys().keys[0].value
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment