New-AzFunctionApp
Creates a function app.
Syntax
New-AzFunctionApp
-ResourceGroupName <String>
-Name <String>
-StorageAccountName <String>
-Location <String>
-Runtime <String>
[-SubscriptionId <String>]
[-ApplicationInsightsName <String>]
[-ApplicationInsightsKey <String>]
[-OSType <String>]
[-RuntimeVersion <String>]
[-FunctionsVersion <String>]
[-DisableApplicationInsights]
[-PassThru]
[-Tag <Hashtable>]
[-AppSetting <Hashtable>]
[-IdentityType <ManagedServiceIdentityType>]
[-IdentityID <String[]>]
[-DefaultProfile <PSObject>]
[-NoWait]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzFunctionApp
-ResourceGroupName <String>
-Name <String>
-StorageAccountName <String>
-Runtime <String>
[-SubscriptionId <String>]
[-ApplicationInsightsName <String>]
[-ApplicationInsightsKey <String>]
[-OSType <String>]
[-RuntimeVersion <String>]
[-FunctionsVersion <String>]
[-DisableApplicationInsights]
[-PassThru]
[-Tag <Hashtable>]
[-AppSetting <Hashtable>]
[-IdentityType <ManagedServiceIdentityType>]
[-IdentityID <String[]>]
-PlanName <String>
[-DefaultProfile <PSObject>]
[-NoWait]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzFunctionApp
-ResourceGroupName <String>
-Name <String>
-StorageAccountName <String>
[-SubscriptionId <String>]
[-ApplicationInsightsName <String>]
[-ApplicationInsightsKey <String>]
[-DisableApplicationInsights]
[-PassThru]
[-Tag <Hashtable>]
[-AppSetting <Hashtable>]
[-IdentityType <ManagedServiceIdentityType>]
[-IdentityID <String[]>]
-PlanName <String>
-DockerImageName <String>
[-DockerRegistryCredential <PSCredential>]
[-DefaultProfile <PSObject>]
[-NoWait]
[-AsJob]
[-WhatIf]
[-Confirm]
[<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
Azure PowerShell
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for