none
AspNetCore 1.0 web app does not running on Azure web app RRS feed

  • Question

  • Hi

    Three month ago, I wrote an ASP.NET MVC5 web app with DNX46. THe project based on a asp.net mvc template of VS 2015. The is already running on Azure as website.

    Now I started the update to AspNetCore 1.0. After solving problems between the new and previous framework, is the app running on my developer computer, but not on Azure.

    The web address is http://s4utest.azurewebsites.net/ and the server returned "The specified CGI application encountered an error and the server terminated the process."

    File list on server: filelist.txt

    The project.json:

    {
      "version": "1.0.0",
    
      "dependencies": {
        "AutoMapper": "5.1.1",
        "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0",
        "Microsoft.AspNetCore.Hosting": "1.0.0",
        "Microsoft.AspNetCore.Html.Abstractions": "1.0.0",
        "Microsoft.AspNetCore.Http": "1.0.0",
        "Microsoft.AspNetCore.Http.Abstractions": "1.0.0",
        "Microsoft.AspNetCore.Mvc": "1.0.0",
        "Microsoft.AspNetCore.Mvc.Core": "1.0.0",
        "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
        "Microsoft.AspNetCore.Razor": "1.0.0",
        "Microsoft.AspNetCore.Razor.Runtime": "1.0.0",
        "Microsoft.AspNetCore.Razor.Tools": {
          "version": "1.0.0-preview2-final",
          "type": "build"
        },
        "Microsoft.AspNetCore.Routing": "1.0.0",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
        "Microsoft.Extensions.Configuration.Json": "1.0.0",
        "Microsoft.Extensions.DependencyInjection": "1.0.0",
        "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0",
        "Microsoft.Extensions.Logging": "1.0.0",
        "Microsoft.Extensions.Logging.Console": "1.0.0",
        "Microsoft.Extensions.Logging.Debug": "1.0.0",
        "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
        "Microsoft.NETCore.Platforms": "1.0.1",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
        "Newtonsoft.Json": "9.0.1",
        "Software4u.Web.Data.Repositories": "1.0.0-*",
        "Software4u.Web.Data.Repositories.Contracts": "1.0.0-*",
        "Software4u.Web.Data2": "1.0.0-*",
        "System.Diagnostics.FileVersionInfo": "4.0.0",
        "System.Diagnostics.StackTrace": "4.0.1",
        "System.Text.Encoding.CodePages": "4.0.1",
        "System.Threading.Thread": "4.0.0",
        "System.Xml.XmlDocument": "4.0.1",
        "System.Xml.XPath.XDocument": "4.0.1"
      },
    
      "tools": {
        "BundlerMinifier.Core": "2.2.281",
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
          "version": "1.0.0-preview1-final",
          "imports": "portable-net45+win8+dnxcore50"
        }
      },
    
      "frameworks": {
        "DNX46": {}
      },
    
      "buildOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true
      },
    
      "publishOptions": {
        "include": [
          "wwwroot",
          "Views",
          "Areas/**/Views",
          "appsettings.json",
          "appsettings.production.json",
          "web.config",
          "web.production.config"
        ]
      },
      "scripts": {
        "prepublish": [ "dotnet bundle" ],
        //"prepublish": [ "bower install", "dotnet bundle" ],
        "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
      }
    }

    global.json

    {
      "projects": [
        "src",
        "test",
        "../../Trunk"
      ],
      "sdk": {
        "version": "1.0.0-preview2-003121"
      }
    }

    I tested web server with x64 and x86 and with mode "classic" and "integrated". No success!

    The environment variable "ASPNETCORE_ENVIRONMENT" is set to production. The web app instance runs on a Basic: 1 Small pricing tier.

    Anybody an idea?

    Kind regards

    Tino


    TM


    • Edited by Tino M_ Monday, August 22, 2016 8:56 PM
    Monday, August 22, 2016 8:30 PM

Answers

  • Hey Guys

    I found the issue.

    I implemented a ActionFilterAttribute to handle unauthorized access to website from private DNS names like the Azure internal web address <name>.azurewebsites.net. This feature was created as protection for bot accesses. Otherwise is it possible to spam the Google or Bing search engine index with duplicate content from multiple domains. After changing the logic or disabling this feature works the web site.

    Kind regards

    Tino


    TM

    Thursday, August 25, 2016 7:50 PM

All replies

  • Hi,

    You could try remote debugging or simply scan your logs using Kudu, which you can find on [websitename].scm.azurewebsites.net (replace [websitename] with what would normally be in [websitename].azurewebsites.net), or Visual Studio server explorer.
    Check this link:
    https://azure.microsoft.com/nl-nl/documentation/articles/web-sites-dotnet-troubleshoot-visual-studio/#remotedebug

    Regards,
    Azam khan

    Tuesday, August 23, 2016 2:48 PM
  • Hi

    I tried to debug the app remote, but without success. The app will not start and that the reason because the remote debugging doesn't work.

    The log files contains not enough information for me to find the source of the issue.

    DetailedErrors\ErrorPage1.htm:

    HTTP Error 502.3 - Bad Gateway

    The specified CGI application encountered an error and the server terminated the process.

    http\RawLogs: 

    2016-08-24 19:25:45 S4UTEST GET / X-ARR-LOG-ID=cc4b9f04-c644-484a-b118-0f8fdf18f8bf 80 - 84.138.77.202 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/52.0.2743.116+Safari/537.36 ARRAffinity=fff1c22d8c848afcb9a6037c4dc64aaf2f57d60a091da8c1213ef0b2121cb54d - s4utest.azurewebsites.net 502 3 12152 464 954 31

    kudu\trace:

    logstream-application file:

    <step title="Incoming Request" date="2016-08-24T19:24:52.564" instance="fff1c2" url="/logstream/application/" method="GET" type="request" pid="25096,2,17" Connection="Keep-Alive" Host="s4utest.scm.azurewebsites.net" X-SITE-DEPLOYMENT-ID="s4utest" WAS-DEFAULT-HOSTNAME="s4utest.scm.azurewebsites.net" >
      <step title="Cleanup Xml Logs" date="2016-08-24T19:24:52.595" /><!-- duration: 0ms -->
      <step title="LogStreamHandler.BeginProcessRequest" date="2016-08-24T19:24:53.251" /><!-- duration: 473ms -->
      <step title="LogStreamHandler.EndProcessRequest" date="2016-08-24T19:26:53.576" /><!-- duration: 16ms -->
      <step title="Outgoing response" date="2016-08-24T19:26:53.592" type="response" statusCode="200" statusText="OK" Server="Microsoft-IIS/8.0" Cache-Control="private" X-AspNet-Version="4.0.30319" Content-Type="text/plain; charset=utf-8" /><!-- duration: 0ms -->
    </step><!-- duration: 121044ms -->

    api-diagnostics-settings file:

    <step title="Incoming Request" date="2016-08-24T19:06:37.654" instance="fff1c2" url="/api/diagnostics/settings" method="POST" type="request" pid="25096,2,15" Connection="Keep-Alive" Content-Length="169" Content-Type="application/json; charset=utf-8" Accept="application/json" Accept-Language="en-US" Expect="100-continue" Host="s4utest.scm.azurewebsites.net" User-Agent="Azure-Portal/6.2.00298.14" x-ms-client-request-id="b5e869de-e16f-493b-89db-1dde920a5273-2016-08-24 19:06:42Z" x-ms-client-session-id="9f9ada68-a239-4aaa-81fe-8cd46a305ac6" X-SITE-DEPLOYMENT-ID="s4utest" WAS-DEFAULT-HOSTNAME="s4utest.scm.azurewebsites.net" >
      <step title="Cleanup Xml Logs" date="2016-08-24T19:06:37.654" /><!-- duration: 16ms -->
      <step title="Outgoing response" date="2016-08-24T19:06:37.935" type="response" statusCode="204" statusText="No Content" Server="Microsoft-IIS/8.0" x-ms-request-id="5a173020-8d1d-4051-b49b-3ad2caac649b" Cache-Control="private" X-AspNet-Version="4.0.30319" /><!-- duration: 16ms -->
    </step><!-- duration: 297ms -->

    The eventlog.xml is empty.

    I think the issue comes not from the application, the IIS has a problem with my app.

    Any other idea?

    Tino


    TM

    Wednesday, August 24, 2016 7:48 PM
  • Hey Guys

    I found the issue.

    I implemented a ActionFilterAttribute to handle unauthorized access to website from private DNS names like the Azure internal web address <name>.azurewebsites.net. This feature was created as protection for bot accesses. Otherwise is it possible to spam the Google or Bing search engine index with duplicate content from multiple domains. After changing the logic or disabling this feature works the web site.

    Kind regards

    Tino


    TM

    Thursday, August 25, 2016 7:50 PM
  • Thanks Tino for sharing the solution!
    Thursday, August 25, 2016 9:23 PM
    Moderator