Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create consumption function app plan #11195

Open
davidstarkcab opened this issue Nov 12, 2019 · 24 comments
Open

Cannot create consumption function app plan #11195

davidstarkcab opened this issue Nov 12, 2019 · 24 comments
Labels
azf_feature_request azf_reviewed customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.

Comments

@davidstarkcab
Copy link

davidstarkcab commented Nov 12, 2019

az feedback auto-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?

@fengzhou-msft fengzhou-msft added Functions az functionapp Service Attention This issue is responsible by Azure service team. labels Nov 13, 2019
@ghost
Copy link

ghost commented Nov 13, 2019

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ ahmedelnably, @fabiocav

@chbe8475
Copy link

@David-Stark did you find a solution or work around for this?

@markusfoss
Copy link

I am also wondering about this one. I want to provision the function in the Azure DevOps pipeline using the "Azure Cli task"

@danielkon96
Copy link

I would love to have this option so that I can downgrade my ASE from premium to consumption.

@anthonychu
Copy link
Member

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.

@Silvenga
Copy link

@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.

@davidstarkcab
Copy link
Author

@chbe8475 Sorry i have not =/

@Silvenga Yeah i wonder the same

@azure-sdk azure-sdk added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 24, 2020
@nexxai
Copy link
Contributor

nexxai commented Oct 30, 2020

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
            }
        }
    ]
}

@mildsar
Copy link

mildsar commented Jan 18, 2022

Still no fix?

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 18, 2022

function service team should look into this

@danijam
Copy link

danijam commented Feb 14, 2022

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.

@holtalanm
Copy link

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.

@thomasddn
Copy link

Currently, this is the workaround I use to create a consumption plan and to let it have a name I choose: #8388 (comment)

@navba-MSFT
Copy link
Contributor

@davidstarkcab Apologies for the late reply. Could you please check this and this and see if it helps? Awaiting your reply.

@navba-MSFT navba-MSFT added the needs-author-feedback More information is needed from author to address the issue. label Mar 21, 2022
@davidstarkcab
Copy link
Author

@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.

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Mar 21, 2022
@navba-MSFT navba-MSFT removed Service Attention This issue is responsible by Azure service team. needs-team-attention This issue needs attention from Azure service team or SDK team labels Mar 25, 2022
@ghost ghost added the needs-team-triage This issue needs the team to triage. label Mar 25, 2022
@navba-MSFT navba-MSFT added Service Attention This issue is responsible by Azure service team. needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-team-triage This issue needs the team to triage. labels Mar 25, 2022
@ghost
Copy link

ghost commented Mar 25, 2022

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Stefanus Hinardi, @Francisco-Gamino.

Issue Details

az feedback auto-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:

Service Attention, Functions, customer-reported, needs-team-attention

Milestone: -

@navba-MSFT
Copy link
Contributor

@Francisco-Gamino Could you please look into this issue and provide an update once you get a chance ? Awaiting your reply.

@Francisco-Gamino
Copy link

Hello @navba-MSFT -- I do not work on the Az CLI. Adding @panchagnula @gzuber who might be able to help.

@julius-gummersbach
Copy link

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

@sgryphon
Copy link

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

@Francisco-Gamino
Copy link

Adding Functions Az CLI team: @amamounelsayed @shreyabatra4 @kaibocai

@pflajszer
Copy link

any updates on this? Seems like a relatively easy fix and it's really annoying to have those location-based auto-generated names....

@linuxchata
Copy link

Any updates on this?

@WiltshireKate
Copy link

Please can we have an update on this? It is causing a real headache...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azf_feature_request azf_reviewed customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests