Azure websites complaining Role environment . FAILED TO INITIALIZE on startup

匿名 (未验证) 提交于 2019-12-03 10:03:01

问题:

my question is similar to Azure websites complaining Role environment . FAILED TO INITIALIZE

Error that I see in the Azure App Service Support Event Viewer:

" 9236 w3wp Role environment . FAILED TO INITIALIZE. hr: -2147024891 "

It happens every single time on startup of the website. Other than that - website functions just fine. Except, randomly (it might take 10-30 minutes) it stops with "The application was terminated." (i see this error through azure application logs). I am not sure if these two things are related, but I am trying to first fix the "FAILED TO INITIALIZE" issue.

I don't have references to RoleEnvironment anywhere in my code (some users on StackOverflow mentioned that this might be an issue).

I read through many posts but none seem to work for my case.

回答1:

Check your Web.Config for references to Microsoft.WindowsAzure.Diagnostics” or “Microsoft.WindowsAzure.ServiceRuntime"

If you have these , they are designed for use with Cloud services and not required or needed with Web Apps.



回答2:

So, the issue was the reference to "Microsoft.WindowsAzure.Configuration". Once this assembly is not referenced anymore - no more errors on startup. Apparently, this assembly is designed to be used with Cloud Services, not Web Applications.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!