简体   繁体   中英

How to deploy a asp.net core web application to azure b2c tenant?

I was able to redirect the login link to azure ad on my localhost, but I get a useless error message on the deployed version:

在此处输入图像描述

I created the ad b2c application and it looks lie this:

在此处输入图像描述

On visual studio, the asp.net core web project was created using the out-of-the-box way:

在此处输入图像描述

As you can see I also created the policies. Like I said, it works fine when I tested the same approach on localhost (instead of the app URL, I use https://localhost:45341/signin-oidc ), but when I deploy, it does not work. What I am missing?

PD: The project I created is not using a windows server, but instead, linux, that might be the issue? I haven't found any tutorial online, all the ones out there are examples within localhost.

As the error message says "For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application".

You can just do like this simply to resolve this issue:

Go to Azure, click on your Web App –> "Configuration" –> click “+New application setting” and add the “ASPNETCORE_ENVIRONMENT” and “Development”.

在此处输入图像描述

Don't forget to restart the application and wait a few minutes for it to take effect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM