< Back

New-AzureRmWebAppSSLBinding

Tue Jan 29, 2019 10:12 pm

NAME New-AzureRmWebAppSSLBinding



SYNOPSIS

Creates an SSL certificate binding for an Azure Web App.





SYNTAX

New-AzureRmWebAppSSLBinding [-ResourceGroupName] <String> [-WebAppName] <String> [[-Slot] <String>] [-Name] <String> [-CertificateFilePath]

<String> [[-SslState] {Disabled | SniEnabled | IpBasedEnabled}] [-CertificatePassword] <String> [-DefaultProfile <IAzureContextContainer>]

[<CommonParameters>]



New-AzureRmWebAppSSLBinding [-WebApp] <Site> [-Name] <String> [-CertificateFilePath] <String> [[-SslState] {Disabled | SniEnabled |

IpBasedEnabled}] [-CertificatePassword] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]



New-AzureRmWebAppSSLBinding [-ResourceGroupName] <String> [-WebAppName] <String> [[-Slot] <String>] [-Name] <String> [[-SslState] {Disabled |

SniEnabled | IpBasedEnabled}] [-Thumbprint] <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]



New-AzureRmWebAppSSLBinding [-WebApp] <Site> [-Name] <String> [[-SslState] {Disabled | SniEnabled | IpBasedEnabled}] [-Thumbprint] <String>

[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]





DESCRIPTION

The New-AzureRmWebAppSSLBinding cmdlet creates a Secure Socket Layer (SSL) certificate binding for an Azure Web App. The cmdlet creates an SSL

binding in two ways:



- You can bind a Web App to an existing certificate.



- You can upload a new certificate and then bind the Web App to this new certificate.





Regardless of which approach you use, the certificate and the Web App must be associated with the same Azure resource group. If you have a Web App

in Resource Group A and you want to bind that Web App to a certificate in Resource Group B, the only way to do that is to upload a copy of the

certificate to Resource Group A.



If you upload a new certificate, keep in mind the following requirements for an Azure SSL certificate:



- The certificate must contain a private key.



- The certificate must use the Personal Information Exchange (PFX) format.



- The certificate's subject name must match the domain used to access the Web App.

- The certificate must use a minimum of 2048-bit encryption.







PARAMETERS

-CertificateFilePath <String>

Specifies the file path for the certificate to be uploaded.



The CertificateFilePath parameter is only required if the certificate has not yet been uploaded to Azure.



Required? true

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CertificatePassword <String>

Specifies the decryption password for the certificate.



Required? true

Position? 5

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the Web App.



Required? true

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group that the certificate is assigned to.



You cannot use the ResourceGroupName parameter and the WebApp parameter in the same command.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Slot <String>

Specifies the name of the Web App deployment slot. You can use the Get-AzureRMWebAppSlot cmdlet to get a slot.



Deployment slots provide a way for you to stage and validate web apps without those apps being accessible over the Internet. Typically you

will deploy your changes to a staging site, validate those changes, and then deploy to the production (Internet-accessible) site.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SslState <SslState>

Specifies whether the certificate is enabled. Set the SSLState parameter to 1 to enable the certificate, or set SSLState to 0 to disable the

certificate.



Required? false

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Thumbprint <String>

Specifies the unique identifier for the certificate.



Required? true

Position? 6

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WebApp <Site>

Specifies a Web App. To get a Web App, use the Get-AzureRmWebApp cmdlet.



You cannot use the WebApp parameter in the same command as the ResourceGroupName parameter and/or the WebAppName .



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-WebAppName <String>

Specifies the name of the Web App for which the new SSL binding is being created.



You cannot use the WebAppName parameter and the WebApp parameter in the same command.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Site

Parameter 'WebApp' accepts value of type 'Site' from the pipeline





OUTPUTS



NOTES









Example 1: Bind a certificate to a Web App



PS C:\\>New-AzureRmWebAppSSLBinding -ResourceGroupName "ContosoResourceGroup" -WebAppName "ContosoWebApp" -Thumbprint

"E3A38EBA60CAA1C162785A2E1C44A15AD450199C3" -Name "www.contoso.com"



This command binds an existing Azure certificate (a certificate with the Thumbprint E3A38EBA60CAA1C162785A2E1C44A15AD450199C3) to the web app

named ContosoWebApp.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... sslbinding

Get-AzureRmWebAppSSLBinding

Remove-AzureRmWebAppSSLBinding

Get-AzureRmWebAppSlot

Get-AzureRmWebApp