Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thepaulmacca/af1b991af95cf64f008ae432957f5c0d to your computer and use it in GitHub Desktop.
Save thepaulmacca/af1b991af95cf64f008ae432957f5c0d to your computer and use it in GitHub Desktop.
Bicep - Key Vault Secret - Storage Account Connection String
resource keyVault 'Microsoft.KeyVault/vaults@2019-09-01' existing = {
name: last(split(keyVaultId, '/'))
resource storageSecret 'secrets' = {
name: 'StorageAccount-ConnectionString'
properties: {
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccountName};AccountKey=${listKeys(storageAccount.id, storageAccount.apiVersion).keys[1].value}'
}
}
}
output storageSecretUri string = keyVault::storageSecret.properties.secretUriWithVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment