Creating a Microsoft.KeyVault/vaults/certificates #10044
-
Bicep version Describe the bug To Reproduce
param keyVaultName string = 'kv-${uniqueString(resourceGroup().id)}'
param certificateName string = 'cert-${uniqueString(resourceGroup().id)}'
param issuerName string = 'Self'
param subjectName string = 'CN=contoso.com'
resource keyVault 'Microsoft.KeyVault/vaults@2021-06-01-preview' = {
name: keyVaultName
location: resourceGroup().location
properties: {
sku: {
name: 'standard'
family: 'A'
}
tenantId: subscription().tenantId
accessPolicies: [
{
tenantId: subscription().tenantId
objectId: 'f520d84c-3fd3-4cc8-88d4-2ed25b00d27a'
permissions: {
keys: [
'get'
'create'
'delete'
'list'
'update'
'import'
'backup'
'restore'
'recover'
'purge'
]
secrets: [
'get'
'list'
'set'
'delete'
'backup'
'restore'
'recover'
'purge'
]
certificates: [
'get'
'list'
'delete'
'create'
'import'
'update'
'managecontacts'
'manageissuers'
'getissuers'
'listissuers'
'setissuers'
'deleteissuers'
'purge'
'recover'
]
}
}
]
enableSoftDelete: true
softDeleteRetentionInDays: 90
enableRbacAuthorization: false
networkAcls: {
defaultAction: 'Allow'
bypass: 'AzureServices'
}
}
}
resource certificate 'Microsoft.KeyVault/vaults/certificates@2021-06-01-preview' = {
name: '${keyVault.name}/${certificateName}'
properties: {
certificatePolicy: {
issuerParameters: {
name: 'Self'
certificateTransparency: null
}
x509CertificateProperties: {
subject: 'CN=wabbit-networks.io,O=Notary,L=Seattle,ST=WA,C=US'
validityInMonths: 60
enhancedKeyUsage: [ 'ServerAuthentication' ]
keyUsage: [ 'digitalSignature' ]
ekus: [ '1.3.6.1.5.5.7.3.3' ]
}
}
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
These api's are not published at this time... via ARM... You can only access via REST enpoints etc. TF, az cli, powershell. https://learn.microsoft.com/en-us/azure/templates/microsoft.keyvault/allversions
We have this open issue for this: in the meantime I use deployment scripts executed from Bicep... only downside is that i cannot enable my keyvault firewall because of this. Example of requesting the cert .. module createCertswithRotation 'x.newCertificatewithRotation.ps1.bicep' = { // if( Global.DomainNameExt != 'psthing.com') {
name: toLower('dp-createCert-${sfmname}')
params: {
userAssignedIdentityName: UAICert.name
CertName: sfmname
Force: false
SubjectName: 'CN=${commonName}'
VaultName: KV.name
DnsNames: union(array(commonName), array(friendlyName), array(fullName), array(shortName))
}
} The module to call the deployment script. The PowerShell used in the deployment script.
|
Beta Was this translation helpful? Give feedback.
These api's are not published at this time... via ARM... You can only access via REST enpoints etc.
TF, az cli, powershell.
https://learn.microsoft.com/en-us/azure/templates/microsoft.keyvault/allversions
We have this open issue for this:
in the meantime I use deployment scripts executed from Bicep... only downside is that i cannot enable my keyvault firewall because of this.
Example of requesting the cert ..
https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/SFM-Cluster.bicep#L78