Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

Unable to create function app against existing consumption plan #8388

Open Jameskmonger opened 5 years ago

Jameskmonger commented 5 years ago

Describe the bug It is not possible to create a function app against a specified consumption app service plan. The following error occurs:

There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it.

I think that setting --consumption-plan-location disables AlwaysOn, but --plan doesn't.

To Reproduce

  1. Create a consumption plan (see "Additional context" section)
  2. Try to create a function app against the plan created in step 1: az functionapp create --resource-group myresourcegroup --storage-account mystorageaccount --name myfunction --plan PlanFromStepOne
  3. Get the error:

    There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it.

Expected behavior It should create the function app against the specified plan, and not set "AlwaysOn" if the plan does not support it.

Environment summary Install method: MSI CLI version: 2.0.52 OS version: Windows 10, Version 1803, OS Build 17134.523 Shell type: cmd

Additional context You can create a consumption app service plan in two ways.

The first way will create a plan called "NorthEuropePlan" with no option to specify the name (it's also part of creating a function app, rather than a discrete step):

az functionapp create
    --resource-group myresourcegroup 
    --storage-account mystorageaccount 
    --name myfunctionapp
    --runtime node
    --consumption-plan-location northeurope

The second is to use the az resource command. I consider this a much better approach as it is a discrete step, and also lets you specify the name:

az resource create
    --resource-group myresourcegroup
    --name myconsumptionplan
    --resource-type Microsoft.web/serverfarms
    --is-full-object
    --properties "{\"location\":\"northeurope\",\"sku\":{\"name\":\"Y1\",\"tier\":\"Dynamic\"}}"
pfranco22 commented 5 years ago

Hi, if you are using an Consumption Plan (Dynamic) you only need to set --consumption-plan-location, not --plan. Consumption plans does not allow Always-On. If you create an App Service plan, then you can use Always On.

Jameskmonger commented 5 years ago

@pfranco22 What if I already have a consumption plan and I want to create a new app against that plan? --consumption-plan-location does not meet that requirement

uberchris2 commented 5 years ago

@Jameskmonger it seems like if you specify --consumption-plan-location, the function app will use the consumption plan in that region.

However, the documentation and error message does not imply this, and both should be updated to clarify.

bigdatamoore commented 5 years ago

I just ran into this. @uberchris2 is right, if you don't specify a plan, but instead give the consumption-plan-location of your current plan, it creates the functionapp in the existing plan. not what I expected...

Vannevelj commented 5 years ago

Had the same issue but using --consumption-plan-location didn't work and I'd just end up with WestEuropePlan and WestEuropePlan2.

In order to get around this, I've changed the tier from F1 to B1 (the free tier does not allow the AlwaysOn setting).

ManuelGalindo commented 5 years ago

I have the same issue with an App Service, when I try to create a Service Plan and then assign to a shared SKU App Service I got this message

az appservice plan create --name "MyAwesomePlan" --resource-group "Super" --location "canadacentral" --sku SHARED az webapp create -g "Super" -p "MyAwesomePlan" -n "MySuperWebApp" --verbose

Is possible to still doing so or cancel the property of Always On from Az CLI?

TheBlueSky commented 5 years ago

I have the same issue and I'm using the latest version of the CLI (as of this writing it's v2.0.69).

Is there a way to create a functionapp without setting "AlwaysOn"?

davidstarkcab commented 4 years ago

Hi, if you are using an Consumption Plan (Dynamic) you only need to set --consumption-plan-location, not --plan. Consumption plans does not allow Always-On. If you create an App Service plan, then you can use Always On.

Sorry, but this method creates a very bad name for the consumption plan. If you have 5 azure functions in north europe, they will all be named NorthEuropePlan.

mrscommentor commented 4 years ago

This is extremely bad, I should be able to use an F1 free tier plan, which I can through the portal, but via the az cli it assumes for some reason that always on is true even though I don't need always on. Also using consumption based ruins our naming standards as we can't control the name of the auto generated plan, so that is not an option either. Please default to always on false, or give us the option to set that flag via the cli (az functionapp create).

IanKemp commented 4 years ago

Come ON, Microsoft. How difficult is it to fix this?

hentie commented 4 years ago

I've also ran into this issue. Creating a functionapp with Consumption Plan with a name that conforms to our naming convention is a breeze in ARM, but to create it with Azure CLI, I had to do a horrible workaround:

  1. Create a consumption plan like @Jameskmonger described

az resource create --resource-group myresourcegroup --name myconsumptionplan --resource-type Microsoft.web/serverfarms --is-full-object --properties "{\"location\":\"westeurope\",\"sku\":{\"name\":\"Y1\",\"tier\":\"Dynamic\"}}"

  1. Create a function app with the --consumption-plan-location i.e.

az functionapp create --resource-group myresourcegroup --name myfunctionapp --consumption-plan-location westeurope

  1. Update the functionapp to use the plan created in step 1 i.e.

az functionapp update --resource-group myresourcegroup --name myfunctionapp --plan myconsumptionplan

  1. Delete the consumption plan auto generated in step 2 i.e. (I prefer az resource delete for this)

az resource delete --name WestEurope --resource-group myresourcegroup

I've also found that ver 2.0.8 Azure CLI does not give the "Always On" issue that @Jameskmonger described, but 2.3.1 and 2.4.0 do. But regardless, it just makes sense to be able to specify a newly created consumption plan name for a functionapp in the Azure-CLI and in my opinion should be implemented a.s.a.p.

vikaskk13 commented 4 years ago

I also ran into this issue. and followed the steps mentioned by @hentie .. But what I noticed is that, after step 2 If I look at the function app, it has automatically linked to the existing consumption app service plan..

TulyOpt commented 4 years ago

Hi, any update ?

lilyjma commented 4 years ago

@ahmedelnably, @fabiocav please take a look at the issue.

hentie commented 4 years ago

I also ran into this issue. and followed the steps mentioned by @hentie .. But what I noticed is that, after step 2 If I look at the function app, it has automatically linked to the existing consumption app service plan..

@vikaskk13 That is exactly why I call it a horrible work-around. You have to temporarily create a resource just to delete it again :(

graphicsxp commented 4 years ago

Having the same issue. Why is this still not assigned for fixing?

yonzhan commented 4 years ago

functions service team should look into this.

Silvenga commented 4 years ago

Wonder if you tried your workaround recently @hentie - it looks like it's causing the Azure management API to throw 500's when trying to create a new function app. Or maybe Azure is just having a bad day - can never really tell. 🤷

hentie commented 4 years ago

Wonder if you tried your workaround recently @hentie - it looks like it's causing the Azure management API to throw 500's when trying to create a new function app. Or maybe Azure is just having a bad day - can never really tell. 🤷

Hi @Silvenga , I just tested it this morning and the 'terrible workaround' is still working on my side. I was using Azure CLI version 2.4.0 and deploying the resources to West Europe region for the test.

Silvenga commented 4 years ago

Perfect, thanks for checking @hentie!

Silvenga commented 4 years ago

Spoke with Azure Support - trying to create a Linux consumption plan with a custom name will return a 500 error, which seems to be a "works as designed". I may be in the minority, but that seems a little, uhm, wrong.

So it looks like something is fundamentally broken in Azure that needs to be fixed before this feature can be supported.

IOrlandoni commented 3 years ago

Still broken...

igor-mamaliga commented 3 years ago

I had the same issue and have achieved the result by manually creating the function from the Azure portal. Since the portal allows the creation of a function for F1:Free service plan I am wondering how do they do it ?

furey commented 3 years ago

A --consumption-plan-name option for az functionapp create […] would be great.

Used in conjunction with --consumption-plan-location, the value of --consumption-plan-name would be the name of the generated app service plan (instead of the current app service plan naming convention of camel-cased consumption plan location + Plan e.g. NorthEuropePlan).

So if my command was something like…

$ az functionapp create --consumption-plan-location australiaeast --consumption-plan-name hello-world [etc…]

…the generated app service plan would be named hello-world and not AustraliaEastPlan.

Apologies for being so long-winded—just want to ensure my suggestion is crystal clear.

Cheers!

🤓 🙏

norvegec commented 3 years ago

2 years gone by and this is still open?

fabiocav commented 3 years ago

@norvegec I hope the fact that a lot of the work done by the team is in the open provides good evidence that the team has been addressing problems. Issues do need to be prioritized and, unfortunately, as much as we would love to, particularly with the challenges we all had to deal with this previous year, we can't always address them in a timely manner. I do agree that there should have been a response and proper triage on this, and I'm sorry this didn't happen (it looks like this was created prior to some processes that would trigger the triage and somehow, feel through). I'm flagging this for discussion in the next triage meeting.

@apawast can we please add this to our next triage list? We may need to loop in Web Apps (Antares) folks as the plan for consumption differs from a traditional plan and there might be some limitations there. At the very least, we need to have clear documentation and guidance on this so we can have closure on this issue.

norvegec commented 3 years ago

@fabiocav agree, given 16 👍 this looks like low-priority issue. My point is to either provide an estimate for a fix, mark @hentie solution as recommended or an alternative solution(s) and close this.

IanKemp commented 3 years ago

@fabiocav Problems have been addressed, yes, but they honestly haven't been addressed as quickly as they should have been. I don't blame you or other teams that are similarly slow to provide feedback (NuGet comes to mind), because I'm quite certain that the reason is that you simply don't have enough people to deal with the number of issues reported. That's a management problem not a dev team problem, but unfortunately since the dev team (you) are the only points of contact for customers, you are the ones feeling the pain.

And that sucks, but... as a paying customer none of the above should be my responsibility or concern. If Microsoft is going to understaff its product teams in order to maximize shareholder profits that's their choice, but then they shouldn't be surprised when customers get unhappy and/or start jumping ship to AWS.

ghost commented 2 years ago

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

Issue Details
**Describe the bug** It is not possible to create a function app against a specified consumption app service plan. The following error occurs: > There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. I think that setting `--consumption-plan-location` disables `AlwaysOn`, but `--plan` doesn't. **To Reproduce** 1. Create a consumption plan (see "Additional context" section) 2. Try to create a function app against the plan created in step 1: `az functionapp create --resource-group myresourcegroup --storage-account mystorageaccount --name myfunction --plan PlanFromStepOne` 3. Get the error: >There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. **Expected behavior** It should create the function app against the specified plan, and not set "AlwaysOn" if the plan does not support it. **Environment summary** Install method: MSI CLI version: 2.0.52 OS version: Windows 10, Version 1803, OS Build 17134.523 Shell type: cmd **Additional context** You can create a consumption app service plan in two ways. The first way will create a plan called "NorthEuropePlan" with no option to specify the name (it's also part of creating a function app, rather than a discrete step): ``` az functionapp create --resource-group myresourcegroup --storage-account mystorageaccount --name myfunctionapp --runtime node --consumption-plan-location northeurope ``` The second is to use the `az resource` command. I consider this a **much** better approach as it is a discrete step, and also lets you specify the name: ``` az resource create --resource-group myresourcegroup --name myconsumptionplan --resource-type Microsoft.web/serverfarms --is-full-object --properties "{\"location\":\"northeurope\",\"sku\":{\"name\":\"Y1\",\"tier\":\"Dynamic\"}}" ```
Author: Jameskmonger
Assignees: -
Labels: `Service Attention`, `Functions`, `customer-reported`, `Functions-cli`, `feature-request`
Milestone: -
navba-MSFT commented 2 years ago

@Jameskmonger Apologies for the late reply. I am able to create function app with existing consumption plan now. Did you get a chance to test this and check? This issue is open for quite sometime now. Could you please let us know if you need any assistance on this ? Awaiting your reply.

ghost commented 2 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

hentie commented 2 years ago

@Jameskmonger Apologies for the late reply. I am able to create function app with existing consumption plan now. Did you get a chance to test this and check? This issue is open for quite sometime now. Could you please let us know if you need any assistance on this ? Awaiting your reply.

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

The issue still exists: You cannot specify the name of the consumption plan when creating a new function app. The name of the consumption plan is based on the location, which is not desired.

ghost commented 2 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

hentie commented 2 years ago

The issue still exists: You cannot specify the name of the consumption plan when creating a new function app. The name of the consumption plan is based on the location, which is not desired.

On Fri, 11 Mar 2022 at 15:01, msftbot[bot] @.***> wrote:

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-cli/issues/8388#issuecomment-1065139910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAESECQWWXNHDXO2GL3S2DLU7NG2DANCNFSM4GTJZ3HQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

ghost commented 2 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

davesouthard commented 2 years ago

It would be nice to have this fixed.

ghost commented 2 years ago

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

Issue Details
**Describe the bug** It is not possible to create a function app against a specified consumption app service plan. The following error occurs: > There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. I think that setting `--consumption-plan-location` disables `AlwaysOn`, but `--plan` doesn't. **To Reproduce** 1. Create a consumption plan (see "Additional context" section) 2. Try to create a function app against the plan created in step 1: `az functionapp create --resource-group myresourcegroup --storage-account mystorageaccount --name myfunction --plan PlanFromStepOne` 3. Get the error: >There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. **Expected behavior** It should create the function app against the specified plan, and not set "AlwaysOn" if the plan does not support it. **Environment summary** Install method: MSI CLI version: 2.0.52 OS version: Windows 10, Version 1803, OS Build 17134.523 Shell type: cmd **Additional context** You can create a consumption app service plan in two ways. The first way will create a plan called "NorthEuropePlan" with no option to specify the name (it's also part of creating a function app, rather than a discrete step): ``` az functionapp create --resource-group myresourcegroup --storage-account mystorageaccount --name myfunctionapp --runtime node --consumption-plan-location northeurope ``` The second is to use the `az resource` command. I consider this a **much** better approach as it is a discrete step, and also lets you specify the name: ``` az resource create --resource-group myresourcegroup --name myconsumptionplan --resource-type Microsoft.web/serverfarms --is-full-object --properties "{\"location\":\"northeurope\",\"sku\":{\"name\":\"Y1\",\"tier\":\"Dynamic\"}}" ```
Author: Jameskmonger
Assignees: -
Labels: `Service Attention`, `Functions`, `customer-reported`, `Functions-cli`, `feature-request`
Milestone: -
navba-MSFT commented 2 years ago

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

Francisco-Gamino commented 2 years ago

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

constantine1998 commented 2 years ago

The issue still exists, The name of the consumption cant be specified while creating the function, and the name of the consumption app is still based on location. Any Update on this!?

panchagnula commented 2 years ago

The issue still exists, The name of the consumption cant be specified while creating the function, and the name of the consumption app is still based on location. Any Update on this!?

This is not a CLI issue - I don't think this is possible on any client during functionapp create. @fabiocav can you comment on this?

thomasddn commented 2 years ago

This is not a CLI issue - I don't think this is possible on any client during functionapp create. @fabiocav can you comment on this?

It is possible with an ARM template.

Azrrael commented 2 years ago

We never had this issue before, and now it happens but intermittently. When creating a function using:

az functionapp create --consumption-plan-location $1 --name $2 --os-type $3 --resource-group $4 --runtime $5 --storage-account $6 --functions-version $7 --app-insights $8

sometimes it will create the function in a preexisting Function App on $4 resource group, sometimes it will create a new Function App called "EastUS2Plan" -- looks like it depends on the region. This is really bad as it means that random Function Apps might appear for no reason.

constantine1998 commented 2 years ago

Strange to see a new function app getting created! It creates a consumption plan("EastUS2Plan") based on your location name, but never creates a new function app("EastUS2Plan") !!

Jameskmonger commented 2 years ago

@navba-MSFT I don't use Azure anymore, I have changed jobs in the time since posting this thread, so I'm not able to give any more info. Hopefully the other users here can provide some

paul-sk commented 2 years ago

Create consumption plan using 'az resource create --name myconsumptionplan ...' as described above in the resource group where function app will be created. Then create function app with '...--consumption-plan-location mylocation...' in the resource group. This function app will use myconsumptionplan created, but not mylocationPlan. Just tested.

uglywarthog commented 2 years ago

Create consumption plan using 'az resource create --name myconsumptionplan ...' as described above in the resource group where function app will be created. Then create function app with '...--consumption-plan-location mylocation...' in the resource group. This function app will use myconsumptionplan created, but not mylocationPlan. Just tested.

Yes, this is how it works. I have been struggling with creating and using proper consumption plan for functions and just have found out that if you create a plan in given location, the if you create functionapp in the same location it will use the plan.

Not how it should work though 😕

MichielDeKoninck commented 1 year ago

This issue still exists: I cannot create a Linux based FunctionApp that is linked to an app service consumption plan (SKU: Y1). I currently see no way of elegantly fixing this.

Why are we unable to indicate that the property AlwaysOn should not be set for a FunctionApp we want to create on an existing consumption plan?

image

image

ghost commented 1 year ago

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

Issue Details
**Describe the bug** It is not possible to create a function app against a specified consumption app service plan. The following error occurs: > There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. I think that setting `--consumption-plan-location` disables `AlwaysOn`, but `--plan` doesn't. **To Reproduce** 1. Create a consumption plan (see "Additional context" section) 2. Try to create a function app against the plan created in step 1: `az functionapp create --resource-group myresourcegroup --storage-account mystorageaccount --name myfunction --plan PlanFromStepOne` 3. Get the error: >There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. **Expected behavior** It should create the function app against the specified plan, and not set "AlwaysOn" if the plan does not support it. **Environment summary** Install method: MSI CLI version: 2.0.52 OS version: Windows 10, Version 1803, OS Build 17134.523 Shell type: cmd **Additional context** You can create a consumption app service plan in two ways. The first way will create a plan called "NorthEuropePlan" with no option to specify the name (it's also part of creating a function app, rather than a discrete step): ``` az functionapp create --resource-group myresourcegroup --storage-account mystorageaccount --name myfunctionapp --runtime node --consumption-plan-location northeurope ``` The second is to use the `az resource` command. I consider this a **much** better approach as it is a discrete step, and also lets you specify the name: ``` az resource create --resource-group myresourcegroup --name myconsumptionplan --resource-type Microsoft.web/serverfarms --is-full-object --properties "{\"location\":\"northeurope\",\"sku\":{\"name\":\"Y1\",\"tier\":\"Dynamic\"}}" ```
Author: Jameskmonger
Assignees: -
Labels: `Service Attention`, `Functions`, `customer-reported`, `Functions-cli`, `feature-request`
Milestone: -
navba-MSFT commented 1 year ago

@Stefanus Hinardi, @Francisco-Gamino Could you please look into this once you get a chance ? Awaiting your reply.