New-AzWebApp
Creates an Azure Web App.
Syntax
SimpleParameterSet (Default)
New-AzWebApp
[[-ResourceGroupName] ]
[-Name]
[[-Location] ]
[[-AppServicePlan] ]
[-ContainerImageName ]
[-EnableContainerContinuousDeployment]
[-AsJob]
[-GitRepositoryPath ]
[-Tag ]
[-DefaultProfile ]
[-WhatIf]
[-Confirm]
[-AcquirePolicyToken]
[-ChangeReference ]
[]
PrivateRegistry
New-AzWebApp
[-ResourceGroupName]
[-Name]
[[-Location] ]
[[-AppServicePlan] ]
-ContainerImageName
-ContainerRegistryUrl
-ContainerRegistryUser
-ContainerRegistryPassword
[-EnableContainerContinuousDeployment]
[-AsJob]
[-Tag ]
[-DefaultProfile ]
[-WhatIf]
[-Confirm]
[-AcquirePolicyToken]
[-ChangeReference ]
[]
WebAppParameterSet
New-AzWebApp
[-ResourceGroupName]
[-Name]
[-Location]
[[-AppServicePlan] ]
[[-SourceWebApp] ]
[[-TrafficManagerProfile] ]
[[-AppSettingsOverrides] ]
[[-AseName] ]
[[-AseResourceGroupName] ]
[-EnableContainerContinuousDeployment]
[-IgnoreSourceControl]
[-IgnoreCustomHostNames]
[-IncludeSourceWebAppSlots]
[-AsJob]
[-Tag ]
[-DefaultProfile ]
[-WhatIf]
[-Confirm]
[-AcquirePolicyToken]
[-ChangeReference ]
[]
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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: 3
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
WebAppParameterSet
Position: 6
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AseName
App Service Environment Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
WebAppParameterSet
Position: 7
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AseResourceGroupName
App Service Environment Resource Group Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
WebAppParameterSet
Position: 8
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AsJob
Run cmdlet in the background
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
-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
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
SimpleParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ContainerRegistryPassword
Private Container Registry Password
Parameter properties
Type: SecureString
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PrivateRegistry
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ContainerRegistryUrl
Private Container Registry Server Url
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PrivateRegistry
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ContainerRegistryUser
Private Container Registry Username
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PrivateRegistry
Position: Named
Mandatory: True
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
-EnableContainerContinuousDeployment
Enables/Disables container continuous deployment webhook
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
-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
SimpleParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IgnoreCustomHostNames
Ignore Custom Host Names Option
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
WebAppParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IgnoreSourceControl
Ignore Source Control Option
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
WebAppParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-IncludeSourceWebAppSlots
Include Source WebApp Slots Option
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
WebAppParameterSet
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Location
Location
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SimpleParameterSet
Position: 0
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
PrivateRegistry
Position: 0
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
WebApp Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: WebAppName
Parameter sets
(All)
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Resource Group Name
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SimpleParameterSet
Position: 0
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-SourceWebApp
Source WebApp Object
Parameter properties
Type: PSSite
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
WebAppParameterSet
Position: 4
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
WebAppParameterSet
Position: 5
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-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
(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 .
Outputs