external help file | Module Name | ms.assetid | online version | schema |
---|---|---|---|---|
Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml |
Az.Network |
6FFE1B64-C80B-423D-A043-55C90A224752 |
2.0.0 |
Creates an SSL certificate for an Azure application gateway.
New-AzApplicationGatewaySslCertificate -Name <String> [-CertificateFile <String>] [-Password <SecureString>]
[-KeyVaultSecretId <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
The New-AzApplicationGatewaySslCertificate cmdlet creates an SSL certificate for an Azure application gateway.
$password = ConvertTo-SecureString $passwordPlainString -AsPlainText -Force
$cert = New-AzApplicationGatewaySslCertificate -Name "Cert01" -CertificateFile "D:\cert01.pfx" -Password $password
This command creates a SSL certificate named Cert01 for the default application gateway and stores the result in the variable named $Cert.
Example 2: Create an SSL certificate using KeyVault Secret (version-less secretId) and add to an application gateway.
$secret = Get-AzKeyVaultSecret -VaultName "keyvault01" -Name "sslCert01"
$secretId = $secret.Id.Replace($secret.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/
$cert = New-AzApplicationGatewaySslCertificate -Name "Cert01" -KeyVaultSecretId $secretId
Get the secret and create an SSL Certificate using New-AzApplicationGatewaySslCertificate
.
Note: As version-less secretId is provided here, Application Gateway will sync the certificate in regular intervals with the KeyVault.
$secret = Get-AzKeyVaultSecret -VaultName "keyvault01" -Name "sslCert01"
$secretId = $secret.Id # https://<keyvaultname>.vault.azure.net/secrets/<hash>
$cert = New-AzApplicationGatewaySslCertificate -Name "Cert01" -KeyVaultSecretId $secretId
Get the secret and create an SSL Certificate using New-AzApplicationGatewaySslCertificate
.
Note: If it is required that Application Gateway syncs the certificate with the KeyVault, please provide the version-less secretId.
Specifies the path of the .pfx file of the SSL certificate that this cmdlet creates.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
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: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential
Required: False
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: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the SSL certificate that this cmdlet creates.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the password of the SSL that this cmdlet creates.
Type: System.Security.SecureString
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Add-AzApplicationGatewaySslCertificate
Get-AzApplicationGatewaySslCertificate