Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function in .Net 8 with in-process model failed to startup in Linux container hosted in AKS #10413

Open
anupamk1506 opened this issue Aug 21, 2024 · 8 comments

Comments

@anupamk1506
Copy link

anupamk1506 commented Aug 21, 2024

Is your question related to a specific version? If so, please specify:
.NET 8
dotnet-inproc
linux Container
AKS
V4

What language does your question apply to? (e.g. C#, JavaScript, Java, All)
C#

Question

We migrated the function to .Net 8 with in-process model using the steps mentioned in #9951 (comment).

It is working fine locally on windows machine with Visual studio. We deployed function in AKS with Linux containers using base image mcr.microsoft.com/azure-functions/dotnet:4.

The function is not working in AKS, we checked the pod logs where it shows it has issue with Startup.

image

We checked the application insights, where is shows : Error configuring services in an external startup class. Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

image

We tried downgrading the version and removing the package 'Microsoft.Extensions.Configuration.Abstractions. However it didn’t work. And got the same error.

The NuGet package used are :
image

image

We have added keys in local.setting.json and appsetting.json

image

The same function is working in .Net6 InProc and we are facing this issue after .Net8 upgrade to InProc.

This is blocker to us for our .Net 8 upgrade. Need help in resolving/investigation of this issue.

Let me know if you need more information.

Thanks!

@kshyju
Copy link
Member

kshyju commented Aug 21, 2024

What is the HOST_VERSION environment variable value you are seeing in your container?

@anupamk1506
Copy link
Author

anupamk1506 commented Aug 21, 2024

What is the HOST_VERSION environment variable value you are seeing in your container?

@kshyju Currently we haven't set the HOST_VERSION environment variable in docker file

image

Do we require to add this for inproc function ? As per this thread Azure/azure-functions-docker#1105
HOST_VERSION should be set for isolated function for Open telemetry. Please suggest.

@kshyju
Copy link
Member

kshyju commented Aug 21, 2024

The base image sets it. Run the container and you should be able to inspect the env variables.

@anupamk1506
Copy link
Author

anupamk1506 commented Aug 21, 2024

The base image sets it. Run the container and you should be able to inspect the env variables.

@kshyju , yes, I can this variable is being set when we build the docker image

image

At Pod level, I can see the variable HOST_VERSION is properly set

image

Do we need to override this? Please suggest

@kshyju
Copy link
Member

kshyju commented Aug 21, 2024

I believe you are using an incorrect base image. @satvu Could you please point the image which supports in-proc net8 ?

@anupamk1506
Copy link
Author

I believe you are using an incorrect base image. @satvu Could you please point the image which supports in-proc net8 ?

@kshyju Thanks for update. @satvu Can you please share image which supports in-proc net8?

@kshyju
Copy link
Member

kshyju commented Aug 22, 2024

Please try mcr.microsoft.com/azure-functions/dotnet:4-dotnet8.0

@KlausHans
Copy link

I have the same problem and unfortunately mcr.microsoft.com/azure-functions/dotnet:4-dotnet8.0 didn't solved it for me. Any other ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants