New-AzureRmWebApp

Creates an Azure Web App.

Important

Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.

To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.

Syntax

New-AzureRmWebApp
   [[-ResourceGroupName] <String>]
   [-Name] <String>
   [[-Location] <String>]
   [[-AppServicePlan] <String>]
   [-ContainerImageName <String>]
   [-EnableContainerContinuousDeployment]
   [-AsJob]
   [-GitRepositoryPath <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmWebApp
   [-ResourceGroupName] <String>
   [-Name] <String>
   [[-Location] <String>]
   [[-AppServicePlan] <String>]
   -ContainerImageName <String>
   -ContainerRegistryUrl <String>
   -ContainerRegistryUser <String>
   -ContainerRegistryPassword <SecureString>
   [-EnableContainerContinuousDeployment]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmWebApp
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-Location] <String>
   [[-AppServicePlan] <String>]
   [[-SourceWebApp] <PSSite>]
   [[-TrafficManagerProfile] <String>]
   [-EnableContainerContinuousDeployment]
   [-IgnoreSourceControl]
   [-IgnoreCustomHostNames]
   [[-AppSettingsOverrides] <Hashtable>]
   [[-AseName] <String>]
   [[-AseResourceGroupName] <String>]
   [-IncludeSourceWebAppSlots]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzureRmWebApp 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

PS C:\>New-AzureRmWebApp -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

-AppServicePlan

App Service Plan Name

Type:String
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AppSettingsOverrides

App Settings Overrides HashTable

Type:Hashtable
Position:6
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AseName

App Service Environment Name

Type:String
Position:7
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AseResourceGroupName

App Service Environment Resource Group Name

Type:String
Position:8
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
-ContainerImageName

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

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

Private Container Registry Password

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ContainerRegistryUrl

Private Container Registry Server Url

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

Private Container Registry Username

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

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

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

Enables/Disables container continuous deployment webhook

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

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

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

Ignore Custom Host Names Option

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

Ignore Source Control Option

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

Include Source WebApp Slots Option

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

Location

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

WebApp Name

Type:String
Aliases:WebAppName
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Resource Group Name

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourceWebApp

Source WebApp Object

Type:PSSite
Position:4
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-TrafficManagerProfile

Resource Id of existing traffic manager profile

Type:String
Aliases:TrafficManagerProfileName, TrafficManagerProfileId
Position:5
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Site

Parameters: SourceWebApp (ByValue)

Outputs

Site