Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-AzWebApp

Creates an Azure Web App.

Syntax

SimpleParameterSet (Default)

New-AzWebApp
 [[-ResourceGroupName] <String>]
 [-Name] <String>
 [[-Location] <String>]
 [[-AppServicePlan] <String>]
 [-ContainerImageName <String>]
 [-EnableContainerContinuousDeployment]
 [-AsJob]
 [-GitRepositoryPath <String>]
 [-Tag <Hashtable>]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [-AcquirePolicyToken]
 [-ChangeReference <String>]
 [<CommonParameters>]

PrivateRegistry

New-AzWebApp
 [-ResourceGroupName] <String>
 [-Name] <String>
 [[-Location] <String>]
 [[-AppServicePlan] <String>]
 -ContainerImageName <String>
 -ContainerRegistryUrl <String>
 -ContainerRegistryUser <String>
 -ContainerRegistryPassword <SecureString>
 [-EnableContainerContinuousDeployment]
 [-AsJob]
 [-Tag <Hashtable>]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [-AcquirePolicyToken]
 [-ChangeReference <String>]
 [<CommonParameters>]

WebAppParameterSet

New-AzWebApp
 [-ResourceGroupName] <String>
 [-Name] <String>
 [-Location] <String>
 [[-AppServicePlan] <String>]
 [[-SourceWebApp] <PSSite>]
 [[-TrafficManagerProfile] <String>]
 [[-AppSettingsOverrides] <Hashtable>]
 [[-AseName] <String>]
 [[-AseResourceGroupName] <String>]
 [-EnableContainerContinuousDeployment]
 [-IgnoreSourceControl]
 [-IgnoreCustomHostNames]
 [-IncludeSourceWebAppSlots]
 [-AsJob]
 [-Tag <Hashtable>]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [-AcquirePolicyToken]
 [-ChangeReference <String>]
 [<CommonParameters>]

Description

The New-AzWebApp cmdlet creates an Azure Web App in a given a resource group that uses the specified App Service plan and data center.

Examples

Example 1: Create a Web App

New-AzWebApp -ResourceGroupName Default-Web-WestUS -Name "ContosoSite" -Location "West US" -AppServicePlan "ContosoServicePlan"

This command creates an Azure Web App named ContosoSite in the existing resource group named Default-Web-WestUS in data center West US. The command uses an existing App Service plan named ContosoServicePlan.

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

-AppServicePlan

App Service Plan Name or App Service Plan Id. If a WebApp and App Service Plan are in different Resource Groups, use the ID instead of the name. The App Service Plan Id can be retrieved using: $asp = Get-AzAppServicePlan -ResourceGroup myRG -Name MyWebapp $asp.id returns the App Service Plan Id.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-AppSettingsOverrides

App Settings Overrides HashTable. It works only with SourceWebApp parameter.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-AseName

App Service Environment Name

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-AseResourceGroupName

App Service Environment Resource Group Name

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ChangeReference

The change reference resource ID for this resource operation.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-ContainerImageName

Container Image Name and optional tag, for example (image:tag)

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ContainerRegistryPassword

Private Container Registry Password

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ContainerRegistryUrl

Private Container Registry Server Url

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ContainerRegistryUser

Private Container Registry Username

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-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

-EnableContainerContinuousDeployment

Enables/Disables container continuous deployment webhook

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-GitRepositoryPath

Path to the GitHub repository containing the web application to deploy.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-IgnoreCustomHostNames

Ignore Custom Host Names Option

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-IgnoreSourceControl

Ignore Source Control Option

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-IncludeSourceWebAppSlots

Include Source WebApp Slots Option

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Location

Location

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Name

WebApp Name

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:WebAppName

Parameter sets

-ResourceGroupName

Resource Group Name

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-SourceWebApp

Source WebApp Object

Parameter properties

Type:PSSite
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Tag

Tags are name/value pairs that enable you to categorize resources

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-TrafficManagerProfile

Resource Id of existing traffic manager profile

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:TrafficManagerProfileName, TrafficManagerProfileId

Parameter sets

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

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.

Inputs

PSSite

Outputs

PSSite

Related Links


Feedback

Was this page helpful?