Azure / Azure/azure-cli

Unable to create function app against existing consumption plan

Open
#8,388 56 comments 25 reactions 0 assignees View on GitHub
act-observability-squad azf_feature_request azf_reviewed customer-reported feature-request Functions Functions-cli needs-team-attention Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**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\"}}"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.