azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

'az functionapp create' fails with '... AlwaysOn cannot be set ...'

Open clinsted opened this issue 6 years ago • 9 comments

This is autogenerated. Please review and update as needed.

Describe the bug

When creating a function with the --plan arg and specifying an existing F1\FREE app service plan the command fails with '... AlwaysOn cannot be set for this site as the plan does not allow it....'. However it is possible to create a Function App through the Azure Portal on a F1\FREE plan.

Command Name az functionapp create

Errors:

There was a conflict. AlwaysOn cannot be set for this site as the plan does not allow it. For more information on pricing and features, please see: https://aka.ms/appservicepricingdetails

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...

az group create ...

az appservice plan create.... (F1\FREE)

az storage account create...

  • az functionapp create --name {} --resource-group {} --storage-account {} --functions-version {} --os-type {} --plan {} --runtime {} --runtime-version {} --subscription {}

Expected Behavior

The same functionality as the Azure Portal should be allowed.

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6

azure-cli 2.1.0

Extensions:
application-insights 0.1.3
interactive 0.4.3
storage-preview 0.2.10

Additional Context

clinsted avatar Feb 19 '20 13:02 clinsted

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

ghost avatar Feb 20 '20 08:02 ghost

Thanks for reporting this. Free tier does not work well with Functions because some triggers require always on enabled, and Free tier does not support it. The recommendation is to use Consumption. We'll investigate what's required to make this a better experience.

anthonychu avatar Feb 20 '20 19:02 anthonychu

@anthonychu - We want to create a function app to use the existing consumption app service plan we have created (i.e. myexistingappserviceplan is a app service consumption plan which is windows and location is eastus).

The below command throws

az functionapp create
--name myfunctionAppName
--storage-account storageName
--plan myexistingappserviceplan
--resource-group myResourceGroup
--functions-version 3

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

Request your suggestion.

Thank you Sekar

sekarsadasivamv avatar Nov 19 '20 14:11 sekarsadasivamv

@sekarsadasivamv Can you create it without specifying an app service plan (specify --consumption-plan-location instead)? Consumption plans should not be shared between function apps. That setting is meant for App Service plans. Perhaps we can make the description of the options a bit clearer.

anthonychu avatar Nov 20 '20 04:11 anthonychu

Thanks you @anthonychu. When I run with --consumption-plan-location eastus it works. I see its gets linked to a specific App Service Plan which has already been created. How does azure pick which App Service Plan to get associated? Is there an way we could configure or change or point to an existing app service plan using any azure cli commands?

sekarsadasivamv avatar Nov 20 '20 08:11 sekarsadasivamv

Also when you mention "Consumption plans should not be shared between function apps" - do you mean that there can be only one function app per consumption plan? But I can see many functions app getting created under one consumption app service plan (please refer my attachments)?

Also, I do not understand how this consumption app service plan gets picked up by Azure? Please help me understand?

Thank you MS-AppServicePlan-Command MS-AppServicePlan

sekarsadasivamv avatar Nov 20 '20 09:11 sekarsadasivamv

Hi @sekarsadasivamv Currently, we do not support accepting an existing consumption plan in the az functionapp create command. Instead, we either create a new one or use an existing one. We have an item in our backlog to accept an existing consumption plan in the az functionapp create command and to make sure that an existing one is not used (i.e. each function app is mapped to its own plan) and we will work on that.

Please let me know @clinsted and @sekarsadasivamv if we can close this issue. Thank you.

kamperiadis avatar Jan 31 '24 16:01 kamperiadis

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

@kamperiadis yes, I am happy for this issue to be closed. Thank you for your feedback.

clinsted avatar Feb 01 '24 08:02 clinsted