Azure Functions Docker Deployment Linux workers are not available in resource group
Asked Answered
A

5

16

Trying to deploy a nginix container from Azure Container Registry through function app,

Getting an error as,

Linux workers are not available in resource group

How to enable linux workers to a resource group?

Dockerfile for deployment,

FROM nginx
COPY dist /usr/share/nginx/html
Armagh answered 25/6, 2018 at 22:49 Comment(2)
Are you trying to deploy it on Azure App Service? If this is the case, after creating app service plan using CLI, it shows information regarding worker like below, { "maximumNumberOfWorkers": 1, "name": "myAppServicePlan", < JSON data removed for brevity. > "targetWorkerSizeId": 0, "type": "Microsoft.Web/serverfarms", "workerTierName": null }Realist
In my case this error was thrown in the following scenario: I have two Linux Azure Functions with App Service Plan. I tried to create another Linux Azure Function with Consumption Plan(Serverless), and I got the error above. I guess the error is the same as the OP's but the source of the problem is different. Anyone faced an issue liked this?Bryant
B
18

Seems like you can't have linux and windows resources in the same resource group

There is a current limitation in regards to not mixing Windows and Linux apps in the same resource group as well.

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

So you're only option at the moment is to create a new resource group for linux resources

Burbage answered 24/7, 2018 at 2:59 Comment(3)
Thank you. That was the problem.Armagh
I had this problem as well, even after I deleted the Windows App. So I had to start with a new Resource GroupProfane
Note: Linux and Windows App Service plans can now share resource groups. This limitation has been lifted from the platform and existing resource groups have been updated to support this.Expediential
C
6

[Update 2022-02-16]

It seems to be possible to now to share a resource group between Linux and Windows app service plans: https://learn.microsoft.com/en-us/azure/app-service/overview#limitations

[Original]

It is not possible to create a linux app service plan and a windows app service plan in the same resource group AND in the same location, but you can use the same resource group and deploy both plans in different locations.

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

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

Though I have discovered that the same error can also occur if you have created an app service certificate via the REST api or via terraform (which is also using the REST api) BEFORE creating the linux app service plan. You must create the linux app service plan before creating the certificate in the same location.

Cirrate answered 1/10, 2019 at 14:22 Comment(1)
This changed in 2021 - it is now possible to create both ASP types in the same resource group / region : learn.microsoft.com/en-us/azure/app-service/… Annoyingly, VS2022 still enforces this as a rule with a right click publish deploy.Outsize
E
2

In some cases, when trying to create a Function App, you may receive the following error...

  • you're creating the Function App in an existing resource group
  • this resource group already contains regular (i.e. non-Dynamic or Premium) Web Apps in the same region that you're trying to create the Function App. This can even occur if you are creating a Azure Functions Premium Plan in a resource group that has an App Service Premium Plan of the same OS.
  • the scale unit that those non-Dynamic or Premium resources are in does not yet support this SKU
  • you are attempting to create a Linux Consumption app in a resource group with any other app service plan type.

...

Even in some situations we have pools specifically for one plan. For example, Linux consumption stamps can only run linux consumption apps, so you aren't able to place a linux consumption plan in the same resource group as any other app service plan. The functions themselves can be in the same resource group, but the plan cannot be.

Ref

Expediential answered 5/1, 2022 at 4:28 Comment(0)
C
1

If you create app service plan for LINUX app in different region (though resource group can be in same region as that of Windows App service plan), it should still work.

Carpophagous answered 14/9, 2020 at 12:50 Comment(0)
B
0

I encountered this issue today while deploying with Bicep. I'm creating 2 service plans with 'Microsoft.Web/serverfarms@2022-09-01', one for an App Service, and another for a Function App, both Linux runtime to run in the same resource group.

I managed to make it work by changing the order of the creation.

  1. I create the service plans first, and the Function App's service plan is also created before the App Service plan.
  2. Then, I create the App Service at the very end, after creating everything else that I need, and it works.
Blintze answered 6/8, 2023 at 19:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.