Hi everyone,
I’m currently mucking around with Bicep as a replacement for plain ARM templates. I’ve just created a key vault and thought I’d share it in case anyone else finds it useful:
param namePrefix string param location string = resourceGroup().location param tenantId string var name = '${namePrefix}${uniqueString(resourceGroup().id)}' resource key_vault 'Microsoft.KeyVault/vaults@2019-09-01' = { name: name location: location properties: { sku: { family: 'A' name: 'standard' } tenantId: tenantId } } resource my_test_secret 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = { name: '${key_vault.name}/my-test-secret' properties: { attributes: { enabled: true } } }
If you want to add any other properties checkout the arm template definition: https://docs.microsoft.com/en-us/azure/templates/microsoft.keyvault/2019-09-01/vaults?tabs=json