Azure / Azure-Functions

1.12k stars 199 forks source link

Func app throws Encountered an error (BadGateway) from host runtime upon migration from .net6 in-proc to .net8 isolated model #2483

Open twisha opened 6 months ago

twisha commented 6 months ago

Use this repo to file issues in documentation or the Functions Visual Studio tooling.

If you need technical help, you'll get the fastest response on the forums (https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=AzureFunctions) or Stack Overflow: http://stackoverflow.com/questions/tagged/azure-functions. The entire engineering team monitors those forums.

If you're not sure where to file your issue, feel free to file it here. Please provide detailed steps to reproduce, including code if applicable.

twisha commented 6 months ago

Upon deploying (using GHA) our updated azure func app, we get following error Encountered an error (BadGateway) from host runtime.

NOTE: Works as expected on local

We've updated our FUNCTIONS_WORKER_RUNTIME from dotnet -> dotnet-isolated AND updated our linuxFxVersion from DOTNET|6.0 -> DOTNET-ISOLATED|8.0 using az cli Here are the commands

az functionapp config appsettings set --name dev-vert-conference-svc --resource-group dev-azfunctions --settings FUNCTIONS_WORKER_RUNTIME="dotnet-isolated"
az functionapp config set --name dev-vert-conference-svc --resource-group dev-azfunctions --linux-fx-version '"DOTNET-ISOLATED|8.0"'

NOTE: There is NO change in our function version. We are on ~4. { "name": "FUNCTIONS_EXTENSION_VERSION", "slotSetting": false, "value": "~4" },

twisha commented 6 months ago

We tried creating a new func app. Its the same behavior/error i.e. Encountered an error (BadGateway) from host runtime.

asiqq23 commented 4 months ago

@twisha have you been able to solve the issue? I got exactly same error after migration from .NET 6 to .NET 8 isolated

twisha commented 4 months ago

@twisha have you been able to solve the issue? I got exactly same error after migration from .NET 6 to .NET 8 isolated

@asiqq23 it's still an issue for us.

tfisicaro commented 3 months ago

Facing the same issue when deploying with GHA or Azure CLI using zip deploy (run from package). Any help or insights in this issue would be greatly appreciated.

We're using the Linux consumption plan.

v007839 commented 3 months ago

Am also facing the same issue when I didn't even upgrade the functions, not sure how to resolve this error, does anyone help if anyone found this issue to be resolved. Thanks

pratyushCarestack commented 2 months ago

I am also facing the same issue when migrated the in-process function app of dotnet 6 to dotnet 8 isolated, while deploying I am getting. 2024-08-22T14:26:08.1660496Z ##[error]Error: Failed to sync triggers for function app 'function-app-name'. Error: BadRequest - Encountered an error (BadGateway) from host runtime. (CODE: 400)

Vaidual commented 1 month ago

In my case, the problem was with the function configuration extension. Previously, I used ConfigureFunctionsWebApplication in Program.cs, but when switched to ConfigureFunctionsWorkerDefaults function started to run in Azure, even though locally, both variants are fine.