Reputation: 15
I'm automating certificate request in Azure Key Vault and I would like to list all certificate operations (In progress, Failed or Cancelled
) without knowing the exact certificate name in specific key vault, using powershell so that I can figure out if a new request needs to be created or just wait for approval if there is an existing request. It is only possible to list completed requests without knowing the certificate name.
The following command will only list completed certificates and I need those in progress, failed or cancelled to be listed.
Get-AzureKeyVaultCertificate -VaultName $VaultName
Any ideas on this?
Upvotes: 0
Views: 2979
Reputation: 15
Looks like this is not possible to achive using current stable AzureRM.KeyVault module (5.0.0) but there is a preview version 5.1.0 that supports listing certificates in a pending state. Just tested that version and yes it does what I want but must wait until it hits stable version.
https://www.powershellgallery.com/packages/AzureRM.KeyVault/5.1.0-preview
Anybody have a workaround until key vault module is stable?
Upvotes: 1
Reputation: 28224
You can get the certificate status one by one through this command:
Get-AzureKeyVaultCertificateOperation
update
you can use following scripts to achieve that:
$certs = Get-AzureKeyVaultCertificate -VaultName nancykeyvault
foreach ($cert in $certs)
{
Get-AzureKeyVaultCertificateOperation -VaultName nancykeyvault -Name $cert.Name
}
Upvotes: 1