Skip to content

Commit a08beff

Browse files
authored
Wrong cmdlet used to get the certifacte (#11613)
The example is using Get-AzKeyVaultSecret to get the certificate from Key Vault, Get-AzKeyVaultCertificate is the correct cmdlet to use.
1 parent 477207f commit a08beff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Network/Network/help/Add-AzApplicationGatewaySslCertificate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This command gets an application gateway named ApplicationGateway01 and then add
3636
### Example 2: Add an SSL certificate using KeyVault Secret (version-less secretId) to an application gateway.
3737
```
3838
PS C:\> $AppGW = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
39-
PS C:\> $secret = Get-AzKeyVaultSecret -VaultName "keyvault01" -Name "sslCert01"
39+
PS C:\> $secret = Get-AzKeyVaultCertificate -VaultName "keyvault01" -Name "sslCert01"
4040
PS C:\> $secretId = $secret.Id.Replace($secret.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/
4141
PS C:\> $AppGW = Add-AzApplicationGatewaySslCertificate -ApplicationGateway $AppGW -Name "Cert01" -KeyVaultSecretId $secretId
4242
```
@@ -47,7 +47,7 @@ Note: As version-less secretId is provided here, Application Gateway will sync t
4747
### Example 3: Add an SSL certificate using KeyVault Secret (versioned secretId) to an application gateway.
4848
```
4949
PS C:\> $AppGW = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
50-
PS C:\> $secret = Get-AzKeyVaultSecret -VaultName "keyvault01" -Name "sslCert01"
50+
PS C:\> $secret = Get-AzKeyVaultCertificate -VaultName "keyvault01" -Name "sslCert01"
5151
PS C:\> $secretId = $secret.Id # https://<keyvaultname>.vault.azure.net/secrets/<hash>
5252
PS C:\> $AppGW = Add-AzApplicationGatewaySslCertificate -ApplicationGateway $AppGW -Name "Cert01" -KeyVaultSecretId $secretId
5353
```

0 commit comments

Comments
 (0)