ASP.NET Core 1.1 fails to deploy to azure web app via CI web.config is not created with the correct values
See original GitHub issueI 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!
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (7 by maintainers)
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.
@GuardRex I’ve set stdoutLogEnabled to true, and for some very strange reason my app started deploying successfully from github (we use VSTS at work, but I’ve been testing in a new azure app service pointing at github so as not to keep breaking our manual app deployments)
I then pointed the second app service at VSTS and did a git push and all was working well. Thought that somehow the problem was resolved, just by enabling the stdout log (would have been very weird!) However, when turning back on the VSTS git deployments on the original azure app service, I still receive 502’s, and can’t for the life of me work out what’s different in the setup of these app services, they look identical!
Anyway, stdout log is reporting this error shortly after failing to startup:
System.AggregateException: One or more errors occurred. —> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
So ultimately, I now have 2 azure app services both configured to automatically deploy from the same VSTS git repo, and only one works!