-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyvault.bicep
31 lines (27 loc) · 883 Bytes
/
keyvault.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
param name string
param location string = resourceGroup().location
param tags object = {}
@description('Service principal that should be granted read access to the KeyVault. If unset, no service principal is granted access by default')
param principalId string = ''
var defaultAccessPolicies = !empty(principalId) ? [
{
objectId: principalId
permissions: { secrets: [ 'get', 'list' ] }
tenantId: subscription().tenantId
}
] : []
resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: name
location: location
tags: tags
properties: {
tenantId: subscription().tenantId
sku: { family: 'A', name: 'standard' }
enabledForTemplateDeployment: true
accessPolicies: union(defaultAccessPolicies, [
// define access policies here
])
}
}
output endpoint string = keyVault.properties.vaultUri
output name string = keyVault.name