aspnetcore: ASP.NET Core 1.1 fails to deploy to azure web app via CI web.config is not created with the correct values

I updated my existing web app from 1.0.1 to 1.1. I have set up a continuous deliver process from the azure portal before I updated the app and all went without problems. After updating the app to 1.1 the continuous delivery still works but the app stopps with a “HTTP Error 502.5 - Process Failure”. I created a new app from scratch updated to 1.1 and tried to upload it to azure and I get the same result. I investigated the error and from what I see the problem is that the web.config file is not automatically updated. The web.config on azure looks like: <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" forwardWindowsAuthToken="false" stdoutLogEnabled="false" /> so none of the placeholders is filled out.

The project.json looks like this

{
  "userSecretsId": "8272f1fc-3e6e-44fc-b1af-54bfabe2a6ba",

  "dependencies": {
    "AutoMapper": "5.1.1",
    "BundlerMinifier.Core": "2.2.306",
    "MailKit": "1.10.0",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Routing": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.AzureAppServicesIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
      "version": "1.1.0-preview4-final",
      "type": "build"
    },
    "Newtonsoft.Json": "9.0.1",
    "StructureMap.Microsoft.DependencyInjection": "1.2.0",
    "WindowsAzure.Storage": "7.2.1"
  },

  "tools": {
    "BundlerMinifier.Core": "2.2.306",
    "Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
    "Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.1.0-preview4-final",
      "imports": [
        "portable-net45+win8"
      ]
    }
  },

  "frameworks": {
    "netcoreapp1.1": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },


  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [
      "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
    ]
  }
}

The continoous delivery is set up like this: Azure portal -> App Services -> Continuous Delivery -> Choose a repo from VSTS and thats it. As said before with 1.0.1 it worked pretty good but now it stopped. If I change the web.config by hand and enter values like this

<aspNetCore processPath="dotnet"
        arguments=".\MyApp.dll"
        stdoutLogEnabled="true"
        stdoutLogFile="\\?\%home%\LogFiles\aspnetcore-stdout">
</aspNetCore>

I can make the app running.

Thanks for your help in advance!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

System.BadImageFormatException

Occurs when there is a bitness mismatch: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis#platform-conflicts-with-rid

One thing that can go sideways with Azure App deployments is incompatible assemblies hanging around. Some devs have had to go in and manually delete every file+folder in an Azure App deployment … then redeploy to clear a problem. You might want to try that on your 1st app service to see if you can clear it.