Azure / azure-functions-docker

This repo contains the base Docker images for working with azure functions
MIT License
269 stars 118 forks source link

azure-functions/dotnet-isolated:4-dotnet-isolated6.0 seems to expect dotnet runtime 8.0 #1167

Closed ahmedaashour closed 2 months ago

ahmedaashour commented 2 months ago

Since Sept 14th , the Azure function runtime included in "azure-functions/dotnet-isolated:4-dotnet-isolated6.0" seems to be expecting dotnet runtime version >= 8.0 to run instead of runtime version 6.0.

Container fails to startup with the following error:

You must install or update .NET to run this application.

App: /azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.0' (x64)
.NET location: /usr/share/dotnet

The following frameworks were found:
  6.0.33 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=x64&rid=mariner.2.0-x64

Our dockerfile uses "dotnet/aspnet:6.0-cbl-mariner2.0" as the base image, and copies the function runtime from the "azure-functions/dotnet-isolated:4-dotnet-isolated6.0" image.

Is this a bug?

pragnagopa commented 2 months ago

This is expected; Dotnet-isolated images depend on Functions Runtime - https://github.com/Azure/azure-functions-host?search=1 which now requires .Net 8

CooperLink commented 2 months ago

Hi @ahmedaashour - To resolve your issue you should be able to download a dotnet8 mariner target. In the floating tag, the azure functions host now requires dotnet8. Prior to this change the host required dotnet6 which was supplied by your base image dotnet/aspnet:6.0-cbl-mariner2.0.

docker pull mcr.microsoft.com/dotnet/aspnet:8.0-cbl-mariner2.0

Install Dotnet from this image by copying the runtime like we do here. https://github.com/Azure/azure-functions-docker/blob/dev/host/4/mariner/dotnet-isolated/dotnet8-isolated-mariner.Dockerfile#L38C62-L38C64

ahmedaashour commented 2 months ago

Hello @CooperLink - Thank you very much for the suggestion. We've actually tried that out and seems to be working out fine. We're using mcr.microsoft.com/dotnet/aspnet:8.0-cbl-mariner2.0 and coping the Azure function isolated runtime v6.0 to that and running it.