Pratik Bhattacharya
Pratik Bhattacharya

Reputation: 3746

Unable to create Linux Function Apps (Consumption plan) and Linux App Service Plans and in the same Resource Group

I am unable to create an Azure Function App (hosted on Linux on a Consumption plan) in a Resource Group which already contains 2 App Services hosted on Linux. I am getting an Error (from the Azure portal) saying that the “Requested Feature is not available in the resource group”. Are there any restrictions in having a dynamic and app service plan on Linux in the same RG?

This is the complete error: <b> { "Code": "BadRequest", "Message": "Requested feature is not available in resource group *******. Please try using a different resource group or create a new one.", "Target": null, "Details": [ { "Message": "Requested feature is not available in resource group ********. Please try using a different resource group or create a new one." }, { "Code": "BadRequest" }, { "ErrorEntity": { "ExtendedCode": "59324", "MessageTemplate": "Requested feature is not available in resource group {0}. Please try using a different resource group or create a new one.", "Parameters": [ "************" ], "Code": "BadRequest", "Message": "Requested feature is not available in resource group *******. Please try using a different resource group or create a new one." } } ], "Innererror": null } </b>

I have also attached the screengrab of the Function App that I am trying to create: Event-Store-issue

Upvotes: 2

Views: 4087

Answers (4)

Sathish07
Sathish07

Reputation: 1

I had faced exactly same issue, trying to deploy Function App(python) from VS code. Below steps helped to successfully deploy into Azure from VS Code.

Activity at Azure portal:

  • Create a Function App(python) under a consumption plan.
  • Add the below into Configuration of your Function App [This setting is required for publishing consumption linux app]

Key: AzureWebJobsStorage

Value:

DefaultEndpointsProtocol=https;AccountName={storage account name};AccountKey={storage account access key};EndpointSuffix=core.windows.net

Activity from VS Code(local):

  • Install Azure Command-Line Interface (CLI), the OS for me was Windows and picked the same. https://learn.microsoft.com/en-us/cli/azure/
  • Install Az.Accounts module:
    Install-Module -Scope CurrentUser -Name Az.Accounts
    
  • Login into azure, az login. This will take you to sign-in by the browser.
  • Deploy into Azure from VS Code by func azure functionapp publish {your function app name}.

Upvotes: 0

Niels Patrick Jensen
Niels Patrick Jensen

Reputation: 21

Did you find a solution?

I have the same issue when creating it via an ARM template.

There is one way to do it (tried on EU West though):

  1. Create a new Resource Group
  2. Create your function in the new RG
  3. Move your function-plan, storage, and function to the desired RG

I hope it would be possible to create the same plan from ARM or via the interface. Let me know if someone has found a method. I would rather do it via ARM template and therefore can control the name of the plan..

Edit:

If you create a consumption plan first and then the app service plan, then it should work too.

From the interface: Just create a function app which is a linux version, then the plan should be created. Then add the linux app service plan.

From ARM: Just make the app service plan depend on the consumption plan.

I will update if we know more in the future..

Upvotes: 2

suziki
suziki

Reputation: 14108

As DixitArora says, you can not create both Window OS function and Linux OS function in a same resourcegroup on usual.

The Key is the service plan and the region.

On this way you can create successfully:

   1.The first way: As the Badrequest message show to you, you can recreate a new resource group and put your function app in that new resource group.(will success with consumption plan.)

   2.The second way: you can create a function with app service plan, like this:

enter image description here

   (I can create both Linux OS function app and Windows OS function app in the same resource group on my side. Please have a try on your side.)

enter image description here    (First is windows OS, consumption app. Second is Linux OS, App Service Plan. These two function are in the same region named 'Central US'.)

   3.The third way: If you still want to create a consumption app. Please choose another region which support consumption plan. And then you can create function successful.

Upvotes: 0

DixitArora-MSFT
DixitArora-MSFT

Reputation: 1811

You cannot create a Linux Web App in an App Service plan already hosting non-Linux Web Apps.

Based on a current limitation, for the same resource group you cannot mix Windows and Linux apps in the same region.

It is mentioned in Public doc https://learn.microsoft.com/en-us/azure/app-service/containers/app-service-linux-intro#limitations

More explanation is given here. https://github.com/Azure/Azure-Functions/wiki/Creating-Function-Apps-in-an-existing-Resource-Group

Upvotes: 1

Related Questions