0

Today we pushed a .net 7 web app to Azure and suddenly everything crashed:

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
Common solutions to this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect

We had to republish as self contained (+ had to change the publish settings from 32bit to 64bit (also in the App service general configuration)).

Now, with self contained, it seems to work.

No idea why it never happened before. Yesterday we published and everything was working. Today just a css update, and the resulting HTTP 500.31 error.

After searching I found a SO thread where an update in the Extensions (App Service > Development Tools) was causing the 500.31 error, but in our case it didn't solve it.

When we did dotnet --info via the Azure console of the app service we saw that Microsoft.NetCore.Appcore / Microsoft.AspNetCore.App 7.0.2 was installed and .net sdk 7.0.102.

However when viewing our projectname.runtimeconfig.json via App Service Editor it was set to "version": "7.0.5"

What does this mean regarding the installed .net (sdk) versions?

Does Microsoft update/deploy only specific versions of .net / .net sdk's to Azure App Services? (If so, is there a list of the updates/supported versions and when they update?)

Or do we manually need to install new .net / .net sdk for an App Service in Azure using the version specific dotnet-install scripts ?

juFo
  • 17,849
  • 10
  • 105
  • 142
  • Check Event logs on Server. See : https://stackoverflow.com/questions/60839745/troubleshooting-500-31-ancm-on-azure-app-service – jdweng May 04 '23 at 14:11
  • no clue there, that post gave us the hint for selfcontained. – juFo May 04 '23 at 14:17
  • Can you please share your code repo? – Harshitha May 04 '23 at 14:35
  • HTTP error 501 is not implemented. So you connection completed and you passed authentication. So most likely a header like Content-Type is wrong. – jdweng May 04 '23 at 14:59
  • Once check the .NET Runtime in `Azure App Service`? [Image](https://i.stack.imgur.com/mpviG.png).Make sure it is set to `.NET 7`. – Harshitha May 05 '23 at 07:37

1 Answers1

1

[HTTP 500.31 Error

This error generally occurs when there is compatibility issue with the version we are using and the deployed Azure App.

  • I have deployed the .NET Core 7 WebApp to Azure App Service.

enter image description here

do we manually need to install new .net / .net sdk for an App Service in Azure using the version specific dotnet-install scripts ?

No, It is not required to install the new .net / .net sdk for an App Service.

As you have mentioned check the versions of the .NET available in KUDU Console using dotnet --info.

enter image description here

enter image description here

If you want to use any specific version which is not there is Azure App Service, then you can install it manually using the dotnet-install script.

  • Just we need to check the version in Configuration => General Settings.

enter image description here

  • Even my WebApplication1.runtimeconfig.json version in App Service editor is also 7.0.0.

enter image description here

  • To know more about the error in detail, update the stdoutLogEnabled to true in web.config and check the logs in C:\home\LogFiles.

As your Azure console of the app service is showing Microsoft.NetCore.Appcore / Microsoft.AspNetCore.App 7.0.2 and .net sdk 7.0.102. and the projectname.runtimeconfig.json is set to "version": "7.0.5"`,

  • It clearly says that the version 7.0.5 is not available in the Azure App Service.

  • If you don't want to deploy the app as self-contained, either change the version in runtimeconfig.json or install the new version from Extensions.

enter image description here

Refer similar type of issue in SO which I have resolved.

Harshitha
  • 3,784
  • 2
  • 4
  • 9