New-AzApplicationGatewaySslCertificate
Creates an SSL certificate for an Azure application gateway.
Syntax
Default (Default)
New-AzApplicationGatewaySslCertificate
-Name <String>
[-CertificateFile <String>]
[-Password <SecureString>]
[-KeyVaultSecretId <String>]
[-HsmKeyId <String>]
[-HsmPublicCertData <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The New-AzApplicationGatewaySslCertificate cmdlet creates an SSL certificate for an Azure application gateway.
Examples
Example 1: Create an SSL certificate for an Azure application gateway.
$password = ConvertTo-SecureString -String "****" -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.
Example 3: Create an SSL certificate using KeyVault Secret and add to an Application Gateway.
$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.
Example 4: Create an SSL certificate using Managed HSM and add to an application gateway.
$cert = New-AzApplicationGatewaySslCertificate -Name "Cert01" -HsmKeyId "https://myhsm.managedhsm.azure.net/keys/mykey/abc123"
Create an SSL Certificate referencing a key stored in Managed HSM using New-AzApplicationGatewaySslCertificate.
Parameters
-AcquirePolicyToken
Acquire an Azure Policy token automatically for this resource operation.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CertificateFile
Specifies the path of the .pfx file of the SSL certificate that this cmdlet creates.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ChangeReference
The change reference resource ID for this resource operation.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HsmKeyId
Key identifier of a key stored in Managed HSM.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HsmPublicCertData
Base-64 encoded public certificate data corresponding to the key stored in Managed HSM.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-KeyVaultSecretId
SecretId (uri) of the KeyVault Secret. Use this option when a specific version of secret needs to be used.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
Specifies the name of the SSL certificate that this cmdlet creates.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Password
Specifies the password of the SSL that this cmdlet creates.
Parameter properties
Type: SecureString
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
None
Outputs