[英]Azure Active Directory Authentication - 500 Error on Azure
我有一个针对 Azure AD 进行身份验证的 ASP.Net Core 3.1 应用程序。 当我从 VS 在本地运行它时,一切都会进行身份验证,但是当我将应用程序部署到 Azure 时,我收到 500 错误:[myappname].azurewebsites.net 当前无法处理此请求。 这是我在 startup.cs 文件中的配置。
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
.AddAzureAD(options => Configuration.Bind("AzureAD", options));
我在 Azure 中将重定向 URI 设置为 https://[my-appname].azurewebsites.net/signin-oidc 以及 localhost。 我不确定我错过了什么。
HTTP 500 表示内部错误。 您的代码中的某些地方存在未处理的异常。
当我遇到这个问题时,我设置了 Application Insights 并查看日志 stream,以查看实际失败的原因。
请参阅: https://microsoft.github.io/AzureTipsAndTricks/blog/tip30.html
事实证明,这与 Azure Active Directory 无关。 这是访问 SQL 数据库的问题,我通过在 SQL 服务器中添加权限来解决它,以允许我的应用程序访问 SQL 数据库。 这篇文章帮助我解决了这个问题: https://docs.microsoft.com/en-us/answers/questions/8602/msdn-redirect-publishing-aspnet-web-api-to-azure-a.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.