Example 2 is incorrect
Type of issue
Other (describe below)
Feedback
Example 2 is incorrect, it's using the wrong cmdlet
$CertBase64 = Get-AzKeyVaultSecret -VaultName $vaultName -Name $certName -AsPlainText
$CertBytes = [Convert]::FromBase64String($CertBase64)
Set-Content -Path cert.pfx -Value $CertBytes -AsByteStream
I believe it should be using Get-AzKeyVaultCertificate as the article is about retrieving certificates
Page URL
https://learn.microsoft.com/en-us/powershell/module/az.keyvault/get-azkeyvaultcertificate?view=azps-10.4.1
Content source URL
https://github.com/Azure/azure-powershell/blob/main/src/KeyVault/KeyVault/help/Get-AzKeyVaultCertificate.md
Author
mikefrobbins
Document Id
63263710-e864-310a-6a42-c618857872b0
actually. i understand now. get-azkeyvaultcertificate retrieves the public key without private key. the get-azkeyvaultsecret example is used to retrieve the private keywith it
comment closed.