Home
%3CLINGO-SUB%20id%3D%22lingo-sub-392589%22%20slang%3D%22en-US%22%3ETroubleshooting%20HTTP%20502.5%20startup%20issues%20in%20Azure%20AppService%20for%20ASP.NET%20Core%20Websites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-392589%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Jun%2010%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EWhenever%20ASP.NET%20Core%20website%20fails%20to%20start%20in%20Azure%20AppService%20we%20get%20HTTP%20%3CBR%20%2F%3E%20502.5%20error%20and%20this%20below%20error%20page%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F101193i03A61D6E59D570E6%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CSTRONG%3E%20To%20troubleshoot%20this%20startup%20error%2C%20we%20need%20to%20capture%20addition%20logs.%20%3CBR%20%2F%3E%20Here%20are%20the%20steps%20to%20capture%20logs%20%3A%20%3C%2FSTRONG%3E%3COL%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CLI%3E%3CBR%20%2F%3E%20Go%20to%20SCM%20site%2C%20just%20add%20%3CB%3E%20.scm%20%3C%2FB%3E%20before%20%3CB%3E%20.azurewebsites.net%20%3C%2FB%3E%20in%20%3CBR%20%2F%3E%20the%20URL%20as%20shown%20below%20%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F101194i5602C01EAACCCC5A%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EIn%20the%20SCM%20website%2C%20click%20on%20the%20%3CB%3E%20Debug%20Console%20%3C%2FB%3E%20%7C%20%3CB%3E%20CMD%3C%2FB%3E%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EClick%20on%20%3CB%3E%20Site%20%3C%2FB%3E%20%7C%20%3CB%3E%20WwwRoot%20%3C%2FB%3E%20folder%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ELook%20for%20%3CB%3E%20web.config%20%3C%2FB%3E%20file%2C%20now%20click%20on%20the%20pencil%20icon%20to%20edit%20it%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EChange%20the%20web.config%20as%20highlighted%20below%20%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F101195iF8868E92B8EE6700%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%20%20%3CP%3E%3CBR%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CTABLE%3E%0A%20%20%20%20%20%3CTBODY%3E%3CTR%3E%0A%20%20%20%20%20%20%3CTD%3E%3CBR%20%2F%3E%3CP%3E%3CASPNETCORE%3E%3CBR%20%2F%3E%20processPath%3D%22dotnet%22%20%3CBR%20%2F%3E%20arguments%3D%22.%5Cwebapp.dll%22%20%3CBR%20%2F%3E%20stdoutLogEnabled%3D%22true%22%20%3CBR%20%2F%3E%20stdoutLogFile%3D%22%5C%5C%3F%5C%25home%25%5CLogFiles%5Cstdout%22%26gt%3B%20%3CBR%20%2F%3E%3C%2FASPNETCORE%3E%3C%2FP%3E%0A%20%20%20%20%20%20%20%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%0A%20%20%20%20%20%3C%2FTR%3E%0A%20%20%20%20%3C%2FTBODY%3E%3C%2FTABLE%3E%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ENow%2C%20try%20to%20browse%20to%20the%20home%20page%20of%20your%20website%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20should%20see%20same%20startup%20failure%20error%20message%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EGo%20back%20to%20SCM%20website%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ENavigate%20to%20d%3A%5Chome%5CLogfiles%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20should%20now%20see%20stdout_xxx_datetime.log%20as%20shown%20below%20%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F101196i3B44246D0FCEE6D8%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%0A%20%20%20%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EClick%20on%20the%20pencil%20icon%20to%20view%20it.%20%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20should%20see%20the%20callstack%20and%20line%20%23%20of%20the%20exception%20%3CBR%20%2F%3E%20as%20shown%20below%20%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F101197iE3C07EC33AED7146%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FOL%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-392589%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Jun%2010%2C%202018%20Whenever%20ASP.%3C%2FLINGO-TEASER%3E
Microsoft
First published on MSDN on Jun 10, 2018

Whenever ASP.NET Core website fails to start in Azure AppService we get HTTP
502.5 error and this below error page







To troubleshoot this startup error, we need to capture addition logs.
Here are the steps to capture logs :



  1. Go to SCM site, just add .scm before .azurewebsites.net in
    the URL as shown below







  2. In the SCM website, click on the Debug Console | CMD

  3. Click on Site | WwwRoot folder

  4. Look for web.config file, now click on the pencil icon to edit it

  5. Change the web.config as highlighted below













    <aspNetCore
    processPath="dotnet"
    arguments=".\webapp.dll"
    stdoutLogEnabled="true"
    stdoutLogFile="\\?\%home%\LogFiles\stdout">

    </aspNetCore>




  6. Now, try to browse to the home page of your website

  7. You should see same startup failure error message

  8. Go back to SCM website

  9. Navigate to d:\home\Logfiles

  10. You should now see stdout_xxx_datetime.log as shown below






  11. Click on the pencil icon to view it.

  12. You should see the callstack and line # of the exception
    as shown below