New-AzFunctionApp

Creates a function app.

Syntax

New-AzFunctionApp
   -Location <String>
   -Name <String>
   -ResourceGroupName <String>
   -Runtime <String>
   -StorageAccountName <String>
   [-ApplicationInsightsKey <String>]
   [-ApplicationInsightsName <String>]
   [-AppSetting <Hashtable>]
   [-DisableApplicationInsights]
   [-FunctionsVersion <String>]
   [-IdentityID <String[]>]
   [-IdentityType <ManagedServiceIdentityType>]
   [-OSType <String>]
   [-PassThru]
   [-RuntimeVersion <String>]
   [-SubscriptionId <String>]
   [-Tag <Hashtable>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzFunctionApp
   -Name <String>
   -PlanName <String>
   -ResourceGroupName <String>
   -Runtime <String>
   -StorageAccountName <String>
   [-ApplicationInsightsKey <String>]
   [-ApplicationInsightsName <String>]
   [-AppSetting <Hashtable>]
   [-DisableApplicationInsights]
   [-FunctionsVersion <String>]
   [-IdentityID <String[]>]
   [-IdentityType <ManagedServiceIdentityType>]
   [-OSType <String>]
   [-PassThru]
   [-RuntimeVersion <String>]
   [-SubscriptionId <String>]
   [-Tag <Hashtable>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzFunctionApp
   -DockerImageName <String>
   -Name <String>
   -PlanName <String>
   -ResourceGroupName <String>
   -StorageAccountName <String>
   [-ApplicationInsightsKey <String>]
   [-ApplicationInsightsName <String>]
   [-AppSetting <Hashtable>]
   [-DisableApplicationInsights]
   [-DockerRegistryCredential <PSCredential>]
   [-IdentityID <String[]>]
   [-IdentityType <ManagedServiceIdentityType>]
   [-PassThru]
   [-SubscriptionId <String>]
   [-Tag <Hashtable>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

Creates a function app.

Examples

Example 1: Create a consumption PowerShell function app in Central US.

New-AzFunctionApp -Name MyUniqueFunctionAppName `
                  -ResourceGroupName MyResourceGroupName `
                  -Location centralUS `
                  -StorageAccountName MyStorageAccountName `
                  -Runtime PowerShell

This command creates a consumption PowerShell function app in Central US.

Example 2: Create a PowerShell function app which will be hosted in a service plan.

New-AzFunctionApp -Name MyUniqueFunctionAppName `
                  -ResourceGroupName MyResourceGroupName `
                  -PlanName MyPlanName `
                  -StorageAccountName MyStorageAccountName `
                  -Runtime PowerShell

This command creates a PowerShell function app which will be hosted in a service plan.

Example 3: Create a function app using a using a private ACR image.

New-AzFunctionApp -Name MyUniqueFunctionAppName `
                  -ResourceGroupName MyResourceGroupName `
                  -PlanName MyPlanName `
                  -StorageAccountName MyStorageAccountName `
                  -DockerImageName myacr.azurecr.io/myimage:tag

This command creates a function app using a using a private ACR image.

Parameters

-ApplicationInsightsKey

Instrumentation key of App Insights to be added.

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

-ApplicationInsightsName

Name of the existing App Insights project to be added to the function app.

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

-AppSetting

Function app settings.

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

-AsJob

Runs the cmdlet as a background job.

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

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableApplicationInsights

Disable creating application insights resource during the function app creation. No logs will be available.

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

-DockerImageName

Linux only. Container image name from Docker Registry, e.g. publisher/image-name:tag.

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

-DockerRegistryCredential

The container registry user name and password. Required for private registries.

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

-FunctionsVersion

The Functions version.

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

-IdentityID

Specifies the list of user identities associated with the function app. The user identity references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'

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

-IdentityType

Specifies the type of identity used for the function app. The acceptable values for this parameter are: - SystemAssigned - UserAssigned

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

-Location

The location for the consumption plan.

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

-Name

The name of the function app.

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

-NoWait

Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.

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

-OSType

The OS to host the function app.

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

-PassThru

Returns true when the command succeeds.

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

-PlanName

The name of the service plan.

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

-ResourceGroupName

The name of the resource group.

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

-Runtime

The function runtime.

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

-RuntimeVersion

The function runtime.

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

-StorageAccountName

The name of the storage account.

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

-SubscriptionId

The Azure subscription ID.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Resource tags.

Type:Hashtable
Position:Named
Default value:None
Required:False
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

Outputs

ISite