Identityserver4.admin: Host IdentityServer4.Admin on Azure

Created on 5 Nov 2018  ·  7Comments  ·  Source: skoruba/IdentityServer4.Admin

Hello,

the project looks really great. How should I do that the service is hosted in Azure?

Yours sincerely
Frank

high task

Most helpful comment

Anyone having the same problem with me, you should add an app setting with name WEBSITE_LOAD_CERTIFICATES and value * to make your certificates accessible from the app.

Reference: https://azure.microsoft.com/en-us/blog/using-certificates-in-azure-websites-applications/

All 7 comments

Hi Frank,
I will prepare the guide - how to create the “production” release. :)
I will contact you.

Thanks!

Hello skoruba,

thank you for the fast feedback. I would really appreciate it if you could show how to fully publish the IdentityService in Azure. I wanted to use this for an Alexa skill :).

Yours sincerely
Frank

Hi Skoruba,

I have no problem running on local and then I tried to deploy to Azure App Service using Visual Studio Publish feature. Before deploying I followed the documentation, but then it shows "Internal Server Error: An error occurred while starting the application." when I tried to access the STS.Identity UI. Here's the exception from Log table in database (Azure SQL):

System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'. ---> System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII is hidden]'. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager1.GetConfigurationAsync(CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.ConfigurationManager1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsync(AuthenticationProperties properties)
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.ChallengeAsync(AuthenticationProperties properties)
at Microsoft.AspNetCore.Authentication.AuthenticationService.ChallengeAsync(HttpContext context, String scheme, AuthenticationProperties properties)
at Microsoft.AspNetCore.Mvc.ChallengeResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultAsync(IActionResult result)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAlwaysRunResultFilters()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at NWebsec.AspNetCore.Middleware.Middleware.CspMiddleware.Invoke(HttpContext context)
at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Do you have any idea what causes the error?

The admin UI also returns HTTP 500 error. Only the API runs well since I can access the swagger UI.

Regards,
Tim

Found out the issue. I changed ASPNETCORE_ENVIRONMENT to Development (It was Production) and the error message shows up. Seems like the it can't find the certificate with the thumbprint provided from App Service TLS/SSL settings page. I'm still trying to figure out a solution for this.

Any help appreciated.

Anyone having the same problem with me, you should add an app setting with name WEBSITE_LOAD_CERTIFICATES and value * to make your certificates accessible from the app.

Reference: https://azure.microsoft.com/en-us/blog/using-certificates-in-azure-websites-applications/

Hi, I am having problems even after have been followed the step by step guide

here

image

here is my code

image

What do you suggest me to do?

thanks in advance

Was this page helpful?
0 / 5 - 0 ratings

Related issues

imabdul-dev picture imabdul-dev  ·  4Comments

weedkiller picture weedkiller  ·  4Comments

ekjuanrejon picture ekjuanrejon  ·  4Comments

Aegide picture Aegide  ·  4Comments

Mehrdad-Davoudi picture Mehrdad-Davoudi  ·  4Comments