Cannot create consumption function app plan
az feedbackauto-generates most of the information requested below, as of CLI version 2.0.76
Describe the bug Cannot create azure function app plan of type consumption? Get following error message:
Invalid sku(pricing tier), please refer to command help for valid values
To Reproduce
Run following command:
az functionapp plan create --name myplan --resource-group mygroup --location westeurope --sku Y1
or
az functionapp plan create --name myplan --resource-group mygroup --location westeurope --sku Dynamic
Expected behavior
Creates a consumption function app plan in azure
Environment summary Install CLI version 2.0.76
Additional context Have tried both Y1 and Dynamic and it doesn't work? Would be nice to have some examples what values it should be for the sku in the documentation also?
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ ahmedelnably, @fabiocav
@David-Stark did you find a solution or work around for this?
I am also wondering about this one. I want to provision the function in the Azure DevOps pipeline using the "Azure Cli task"
I would love to have this option so that I can downgrade my ASE from premium to consumption.
We currently don't support the ability to create a consumption plan by itself. For downgrade scenarios from Premium to Consumption, please create a new function app for the time being. We'll look into whether we can enable this.
@anthonychu is there a way to set the name of the created dynamic plan? I would like to get it to follow our conventions, the dynamic plan name sticking out just doesn't look all the professional.
@chbe8475 Sorry i have not =/
@Silvenga Yeah i wonder the same
It's not an optimal solution, but until they add this functionality to az cli, here's a small ARM template that will let you customize the name of the ASP (obviously you'll want to change the region to suit your needs):
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"asp-name": {
"defaultValue": "THE-NAME-OF-THE-APP-SERVICE-PLAN-GOES-HERE",
"type": "String"
},
"region-name": {
"defaultValue": "West US",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"name": "[parameters('asp-name')]",
"location": "[parameters('region-name')]",
"sku": {
"name": "Y1",
"tier": "Dynamic",
"size": "Y1",
"family": "Y",
"capacity": 0
},
"kind": "functionapp",
"properties": {
"perSiteScaling": false,
"maximumElasticWorkerCount": 1,
"isSpot": false,
"reserved": false,
"isXenon": false,
"hyperV": false,
"targetWorkerCount": 0,
"targetWorkerSizeId": 0
}
}
]
}
Still no fix?
function service team should look into this
Just discovered this too. I wanted to control the name of the app service plan that is created for me. E.g
az functionapp create \
--name $functionAppName \
--resource-group $resourceGroup \
--storage-account $storageName \
--app-insights $appInsightsName \
--consumption-plan-location westeurope \
--functions-version 4 \
--os-type Windows \
--runtime powershell \
--runtime-version 7.0
Creates an app service plan resource of the name WestEuropePlan.
I tried adding in az functionapp plane create only to discover I can't if targeting the consumption tier.
Absolutely ridiculous that the only way to create a consumption plan is via an ARM template.
Either allow us to edit the plan name in the portal UI when the function app service is created, or allow us to create a consumption plan via the cli.
Currently, this is the workaround I use to create a consumption plan and to let it have a name I choose: https://github.com/Azure/azure-cli/issues/8388#issuecomment-618601562
@davidstarkcab Apologies for the late reply. Could you please check this and this and see if it helps? Awaiting your reply.
@navba-MSFT No problems! What i can see from these commands is that they will only create a new azure function? I want to be able to set the name on the plan.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Stefanus Hinardi, @Francisco-Gamino.
Issue Details
az feedbackauto-generates most of the information requested below, as of CLI version 2.0.76
Describe the bug Cannot create azure function app plan of type consumption? Get following error message:
Invalid sku(pricing tier), please refer to command help for valid values
To Reproduce
Run following command:
az functionapp plan create --name myplan --resource-group mygroup --location westeurope --sku Y1
or
az functionapp plan create --name myplan --resource-group mygroup --location westeurope --sku Dynamic
Expected behavior
Creates a consumption function app plan in azure
Environment summary Install CLI version 2.0.76
Additional context Have tried both Y1 and Dynamic and it doesn't work? Would be nice to have some examples what values it should be for the sku in the documentation also?
| Author: | davidstarkcab |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
@Francisco-Gamino Could you please look into this issue and provide an update once you get a chance ? Awaiting your reply.
Hello @navba-MSFT -- I do not work on the Az CLI. Adding @panchagnula @gzuber who might be able to help.
This seems to still be an issue. The Y1 SKU is still not an option when creating an app service plan via the Azure CLI.
https://learn.microsoft.com/en-us/cli/azure/appservice/plan?view=azure-cli-latest#az-appservice-plan-create
Any updates on this? @panchagnula @gzuber
Another work around is az resource create, passing in the properties for Y1 sku.
From: http://chamindac.blogspot.com/2021/01/create-windows-or-linux-consumption.html
e.g. (replace xxxx with your business details). Works with SKU = Y1, Tier = Dynamic
$rgName = "rg-xxxx-$Environment-01".ToLowerInvariant()
$funcAspName = "asp-xxxx-$Environment-01".ToLowerInvariant()
$TagDictionary = @{ DataClassification = 'Confidential'; Criticality = $criticality;
BusinessUnit = 'xxxx'; Env = $Environment }
$tagsJson = $TagDictionary.Keys | ForEach-Object { $key = $_; '\"'+ $key + '\":\"' + $TagDictionary[$key] + '\"' }
$funcAspProperties = '{\"kind\":\"functionapp\", ' `
+ '\"location\":\"' + $Location + '\", ' `
+ '\"sku\":{\"name\":\"' + $FuncPlanSku + '\",\"tier\":\"' + $FuncPlanTier + '\"}, ' `
+ '\"tags\":{' + [string]::Join(', ', $tagsJson) + '}' `
+ '}'
Write-Verbose "Creating with properties: $funcAspProperties"
az resource create `
--resource-group $rgName `
--name $funcAspName `
--resource-type 'Microsoft.web/serverfarms' `
--is-full-object `
--properties $funcAspProperties
Adding Functions Az CLI team: @amamounelsayed @shreyabatra4 @kaibocai
any updates on this? Seems like a relatively easy fix and it's really annoying to have those location-based auto-generated names....
Any updates on this?
Please can we have an update on this? It is causing a real headache...
Really need this... any updates? Given the issues with intermittent errors from v8 isolated workers this is really needed for testing app plan alternatives see https://learn.microsoft.com/en-us/answers/questions/1705006/azure-function-intermittent-error-during-cold-star
it is such a shame this issue is open for FIVE years now and no one looks into it and the official documentation of microsoft is still the same