Editar

Partilhar via


New-AzWebAppCertificate

Creates an App service managed certificate for an Azure Web App.

Syntax

New-AzWebAppCertificate
   [-ResourceGroupName] <String>
   [-WebAppName] <String>
   [-Name <String>]
   [[-Slot] <String>]
   [-HostName] <String>
   [-AddBinding]
   [-SslState <SslState>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzWebAppCertificate cmdlet creates an Azure App Service Managed Certificate

Examples

Example 1

New-AzWebAppCertificate -ResourceGroupName Default-Web-WestUS -WebAppName "ContosoSite" -Name "ContosoCert" -HostName "www.ContosoSite.net"

This command create an App Service Managed Certificate for the given WebApp

Example 2

New-AzWebAppCertificate -ResourceGroupName Default-Web-WestUS -WebAppName "ContosoSite" -Name "ContosoCert" -HostName "www.ContosoSite.net" -Slot "test" -AddBinding

This command create an App Service Managed Certificate and binds to the given WebApp Slot.

Example 3

New-AzWebAppCertificate -ResourceGroupName Default-Web-WestUS -WebAppName "ContosoSite" -Name "ContosoCert" -HostName "www.ContosoSite.net" -AddBinding

This command create an App Service Managed Certificate and binds to the given WebApp.

Parameters

-AddBinding

To add the created certificate to WebApp/slot.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HostName

Custom hostname associated with web app/slot.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the certificate.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Slot

The name of the web app slot.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SslState

Ssl state option. Use either 'SniEnabled' or 'IpBasedEnabled'. Default option is 'SniEnabled'.

Type:Nullable<T>[SslState]
Accepted values:Disabled, SniEnabled, IpBasedEnabled
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WebAppName

The name of the web app.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.Azure.Commands.WebApps.Models.WebApp.PSCertificate