Reputation: 4405
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?
Upvotes: 0
Views: 1611
Reputation: 338
There is a current limitation where Windows and Linux apps cannot exist in the same resource group.
https://learn.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
Upvotes: -1
Reputation: 4405
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
Upvotes: 0
Reputation: 14108
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.
Upvotes: 0