Azure WebApp: Scheme not set to HTTPS, breaks RequireHttps and OAuth/OIDC #140
Description
I have an RC2 Application running on Azure Web App Role.
on the browser side:
https://mydummycisiteci.azurewebsites.net redirected you too many times.
On the stdout log for aspnetcoremodule:
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
Azure Web Sites environment detected. Using 'D:\home\ASP.NET\DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Hosting environment: Production
Content root path: D:\home\site\wwwroot
Now listening on: http://localhost:15934/
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://mydummycisite.azurewebsites.net/
warn: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.RequireHttpsAttribute'.
info: Microsoft.AspNetCore.Mvc.RedirectResult[1]
Executing RedirectResult, redirecting to https://mydummycisite.azurewebsites.net/.
The most interesting fact is that if if download a resource (image for example)
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET http://mydummycisite.azurewebsites.net/favicon.ico info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 1227.537ms 404
on the browser side:
http://mydummycisite.azurewebsites.net/favicon.ico Failed to load resource: the server responded with a status of 404 (Not Found)
I have the exact same configuration on Local IIS and works like a candy...
web.config - Azure App
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="D:\home\Microsoft\dotnet\cli\dotnet.exe" arguments=".\..\approot\mydummycisite.dll" stdoutLogEnabled="true" stdoutLogFile=".\..\logs\stdoutcm" startupTimeLimit="3600" />
</system.webServer>
</configuration>
Am i doing something wrong, or AspNetCoreModule still in the forge in Azure?