I have an ASP.NET Core Web API that I’ve been running on Azure App Service Windows platform. This app was targeting .NET 7 and today I updated it to target .NET 8. It compiles and runs fine locally.
According to this announcement, .NET 8 is now available on Azure App Service: https://azure.github.io/AppService/2023/11/14/dotnet8-ga.html
I deployed the app to Azure App Service and then changed the .NET version to .NET 8 — see below:
This didn’t work and I kept getting the following error:
ANCM Failed to Find Native Dependencies
I then found this post on Reddit: https://www.reddit.com/r/dotnet/comments/17v7qb5/http_error_50031_ancm_failed_to_find_native/
So, I went ahead and installed ASP.NET Core .NET 8 x64
and x86
through Kudu under Advanced Tools — see below:
I then stopped and restarted the app on Azure App Service several times and it’s still not working. When I try to hit an endpoint on my API, it spins and spins for a long time and comes back with "Service Unavailable" error but according to app dashboard on Azure, it’s up and running.
Any suggestions? Anyone else is having upgrade to .NET 8 issues?
PS: the deployment of my API app is done through GitHub actions and I did update the .NET version to .NET 8 — see below:
2
Answers
I have created a basic ASP .NET Core Web API with version .NET-8.0 and deployed to Azure App Service using GitHub actions.
Steps Followed:
Created an ASP .NET Core Web API project with .NET 8 version and able to run locally.
Modified program.cs:
My Workflow:
Below is the workflow I have used to deploy the application.
Deployment Status:
Running the application successfully.
If the issue still persists while deploying the application, add
--self-contained
in dotnet’s publish command in the GitHub workflow.I have basically the same problem deploying to Azure with .NET Core 8 web app. You can use the ‘self-contained’ as a workaround.
However, I discovered that if you deploy to ‘East US’ it works fine, but ‘UK South’ produces ‘Service Unavailable’.