Set-AzApplicationGatewaySslCertificate
Updates an SSL certificate for an application gateway.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Set-AzApplicationGatewaySslCertificate
-ApplicationGateway <PSApplicationGateway>
-Name <String>
[-CertificateFile <String>]
[-Password <SecureString>]
[-KeyVaultSecretId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Set-AzApplicationGatewaySslCertificate cmdlet updates an SSL certificate for an application gateway.
Examples
Example 1: Update an existing SSL certificate on Application Gateway
PS C:\> $appGW = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
PS C:\> $password = ConvertTo-SecureString $passwordPlainString -AsPlainText -Force
PS C:\> $cert = Set-AzApplicationGatewaySslCertificate -ApplicationGateway $AppGW -Name "Cert01" -CertificateFile "D:\cert01.pfx" -Password $password
Update an existing SSL certificate for the application gateway named ApplicationGateway01.
Example 2: Update an existing SSL certificate using KeyVault Secret (version-less secretId) on Application Gateway
PS C:\> $secret = Get-AzKeyVaultSecret -VaultName "keyvault01" -Name "sslCert01"
PS C:\> $secretId = $secret.Id.Replace($secret.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/
PS C:\> $cert = Set-AzApplicationGatewaySslCertificate -ApplicationGateway $AppGW -Name "Cert01" -KeyVaultSecretId $secretId
Get the secret and update an existing SSL Certificate using Set-AzApplicationGatewaySslCertificate.
Example 3: Update an existing SSL certificate using KeyVault Secret on Application Gateway
PS C:\> $secret = Get-AzKeyVaultSecret -VaultName "keyvault01" -Name "sslCert01"
PS C:\> $secretId = $secret.Id # https://<keyvaultname>.vault.azure.net/secrets/<hash>
PS C:\> $cert = Set-AzApplicationGatewaySslCertificate -ApplicationGateway $AppGW -Name "Cert01" -KeyVaultSecretId $secretId
Get the secret and update an existing SSL Certificate using Set-AzApplicationGatewaySslCertificate.
Note: If it is required that Application Gateway syncs the certificate with the KeyVault, please provide the version-less secretId.
Parameters
Specifies the application gateway with which the Secure Socket Layer (SSL) certificate is associated.
| Type: | PSApplicationGateway |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the path of the SSL certificate.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
SecretId (uri) of the KeyVault Secret. Use this option when a specific version of secret needs to be used.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the SSL certificate.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the password of the SSL certificate.
| Type: | SecureString |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |