azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Example 2 is incorrect

Open jku-sr opened this issue 3 years ago • 1 comments

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

jku-sr avatar Nov 13 '23 19:11 jku-sr

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.

jku-sr avatar Nov 13 '23 19:11 jku-sr