1
votes

I have an problem with my web api hosted on a azure app service. On my local computer the webapi works totaly fine, but on the deployed webapi i get the message:

The page cannot be displayed because an internal server error has occurred.

in the log stream i get this exception:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Microsoft.Azure.AppService.Middleware.ModuleUtils' threw an exception. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.at System.Net.HttpWebRequest.GetResponse()at Microsoft.Azure.AppService.Middleware.OpenIdConnectConfiguration.Download(String url)at Microsoft.Azure.AppService.Middleware.OpenIdConnectConfiguration.ConfigManager.RefreshConfiguration()at Microsoft.Azure.AppService.Middleware.OpenIdConnectConfiguration.ConfigManager.GetCurrentConfiguration()at Microsoft.Azure.AppService.Middleware.AzureActiveDirectoryProvider.GetDefault()at Microsoft.Azure.AppService.Middleware.AzureActiveDirectoryProvider..ctor(EasyAuthConfig easyAuthConfig)at Microsoft.Azure.AppService.Middleware.Modules.ConfigFactory.GenerateMiddlewareModuleConfig(INameResolver resolver)at Microsoft.Azure.AppService.Middleware.Modules.ConfigFactory.GetCorsConfig(INameResolver resolver)at Microsoft.Azure.AppService.Cors.CorsModule.SetConfig(ConfigFactory configFactory)at Microsoft.Azure.AppService.Cors.CorsModule..ctor(ConfigFactory configFactory)at Microsoft.Azure.AppService.Middleware.ModuleUtils..cctor()--- End of inner exception stack trace ---at Microsoft.Azure.AppService.Middleware.ModuleUtils.get_Modules()at Microsoft.Azure.AppService.Middleware.ModuleConfig.ForceLoadConfig()at Microsoft.Azure.AppService.Middleware.ModuleConfig.EnsureConfigLoaded(HttpContextBase context)--- End of inner exception stack trace ---at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)at Microsoft.Azure.AppService.Middleware.ModuleManager.LoadModuleConfig(HttpContextBase context)at Microsoft.Azure.AppService.Middleware.ModuleManager.LoadAllModulesAndGetEnabledModules(HttpContextBase context)at Microsoft.Azure.AppService.Middleware.HttpModuleDispatcher.EnsureInitialized(HttpContextBase context)at Microsoft.Azure.AppService.Middleware.HttpModuleDispatcher.d__11.MoveNext()

1
This post may be helpful in trying to determine root cause: blogs.msdn.microsoft.com/benjaminperkins/2017/10/23/…David Tansey

1 Answers

0
votes

500.79: The request failed because of an unhandled exception in the Easy Auth module.

As correctly pointed by David , follow the blog which would be helpful in determine the cause for this.

https://docs.microsoft.com/en-us/archive/blogs/benjaminperkins/500-79-internal-server-error