0
votes

When I try to create a FunctionApp Premium Plan using the following commands:

# Create a Resource Group
az group create \
    --name $rg_name \
    --location $az_loc

# Create a Function App Storage Account
az storage account create \
    --name $fa_storage_name \
    --resource-group $rg_name \
    --location $az_loc \
    --sku Standard_LRS

# Create a Premium plan
az functionapp plan create \
    --name $fap_name \
    --resource-group $rg_name \
    --location $az_loc \
    --sku P2v2

I receive an error:

The requested app service plan cannot be created in the current resource group because it is hosting Linux apps. Please choose a different resource group or create a new one.

I also tried the sku EP2 with same result. The SKU's are really hard to find in the docs(!). Does anyone know which sku's work with Linux Azure Functions and what I might be missing here?

3
This is function plan conflict. Please create it in a new resourse group or create it in a resourse group with no conflict plan..Cindy Pau

3 Answers

0
votes

This is common error.

The solution is to create a new Resourse Group and put the function app in.

The problem comes from the conflict between azure function plan based on windows and based on linux.

Create a new Resource group is the only way, and notice to separate function based on linux and windows in your development.

0
votes

Here is what ended up working for me. Note the --is-linux true flag in az functionapp plan create and the --plan flag in az functionapp create:

# Create a Premium plan
az functionapp plan create \
  --name $fap_name \
  --is-linux true \
  --resource-group $rg_name \
  --location $az_loc \
  --sku EP2

# Create Function App (container for Azure Function)
#--consumption-plan-location $az_loc \
az functionapp create \
  --name $fa_name \
  --resource-group $rg_name \
  --storage-account $fa_storage_name \
  --plan $fap_name \
  --os-type Linux \
  --runtime python \
  --runtime-version 3.7 \
  --subscription $az_sub \
  --functions-version 2
-1
votes

There is a current limitation where Windows and Linux apps cannot exist in the same resource group.

https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-intro#limitations

Therefore, it was failing when deploying a Windows resource and worked when --is-linux was set to true