sean717
sean717

Reputation: 12663

Azure CLI or PowerShell command to create new version of a certificate in keyvault

I want to create a new version of a certificate in keyvaule using command line (az cli or powershell). Does anyone know how to do that?

k

Upvotes: 1

Views: 2806

Answers (1)

Joy Wang
Joy Wang

Reputation: 42123

To create a new version, just use Add-AzKeyVaultCertificate powershell command, specify the name of the certificate, then it will create a new version.

Sample:

$Policy = New-AzKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -IssuerName "Self" -ValidityInMonths 6 -ReuseKeyOnRenewal
Add-AzKeyVaultCertificate -VaultName "keyvaultname" -Name "joycer" -CertificatePolicy $Policy

enter image description here

For Azure CLI, this command az keyvault certificate create should also work.

az keyvault certificate create --name
                               --policy
                               --vault-name
                               [--disabled {false, true}]
                               [--subscription]
                               [--tags]
                               [--validity]

Upvotes: 2

Related Questions