Last active
April 29, 2024 14:16
-
-
Save thepaulmacca/af1b991af95cf64f008ae432957f5c0d to your computer and use it in GitHub Desktop.
Bicep - Key Vault Secret - Storage Account Connection String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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