简体   繁体   English

具有Azure AD身份验证的MVC Webapp在本地运行良好,但在移植到Azure应用程序服务时无法正常运行

[英]MVC webapp with Azure AD authentication works fine in local but not when porting to Azure app services

I have created web app by following below steps to implement the Azure active directory authentication(Work or school account authentication) to my Mvc webapp. 我已按照以下步骤创建了Web应用,以对我的Mvc Web应用实施Azure Active Directory身份验证(工作或学校帐户身份验证)。

When I create the project in MVC web app itself it asks authentication mode of the project . 当我在MVC Web应用程序本身中创建项目时,它会询问该项目的身份验证模式。 So that I have changed the authenticate mode to Work or School account authentication. 因此,我已将身份验证模式更改为工作或学校帐户身份验证。 After checking this, it populates directory by default and I have checked the Read directory data. 选中此选项后,默认情况下将填充目录,而我已检查了Read目录数据。

After clicking create, the visual studio itself generates the following file for Work or school account authentication I beleive, 单击创建后,Visual Studio本身会生成以下文件以供我相信的Work或学校帐户身份验证,

  1. Startup.Auth.cs in app_start folder app_start文件夹中的Startup.Auth.cs
  2. AdalTokenCache.cs, ApplicationDbContext in Moldels folder AdelsTokenCache.cs,Moldels文件夹中的ApplicationDbContext

Once I run the app from visual studio it works fine that as usual it goes to Microsft online page and if it succeeds the authentication it came to the home controller of the web app. 一旦我从Visual Studio运行了该应用程序,它就可以正常工作,可以像往常一样转到Microsft的在线页面,如果它成功通过了身份验证,则会到达该Web应用程序的主控制器。

To check with azure app service, we have created the web app in Azure webservices and copied the code base to mentioed remote folder by FTP client. 为了检查azure应用程序服务,我们已经在Azure webservices中创建了该Web应用程序,并通过FTP客户端将代码库复制到了指定的远程文件夹中。 But now it gots the error like screen shot. 但是现在出现了屏幕截图之类的错误

(Ps : I'm using App Service plan/pricing tier as FREE TIER also not adding the SSL Certificates to my web app) (注:我使用App Service计划/定价层作为免费套餐,也没有将SSL证书添加到我的Web应用程序中)

As @Chetan said , you can't use localdb/sqlexpress with Azure app service. 如@Chetan所说,您不能将localdb / sqlexpress与Azure应用服务一起使用。 You could use SQL Azure , or you could connect to on-premises SQL Server from a web app in Azure App Service using Hybrid Connections 您可以使用SQL Azure,也可以使用混合连接从Azure App Service中的Web应用程序连接到本地SQL Server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure App Services身份验证 - Azure App Services Authentication Azure ASP.NET 核心 MVC WebApp 的 AD 身份验证 - 如何自定义应用程序的 Redirect_URI! 发送 - Azure AD Authentication for ASP.NET Core MVC WebApp - how to customize the Redirect_URI the APPLICATION! sends 使用Azure AD的Azure API APP身份验证 - Azure API APP authentication using Azure AD Azure上的C#MVC应用程序:新部署时站点工作正常,但闲置后失败 - C# MVC app on Azure: Site works fine when freshly deployed but fails after being left idle ASP.NET MVC 5 中的 Azure AD 身份验证 - Azure AD authentication in ASP.NET MVC 5 Azure 应用服务上的 ASP.NET Core MVC Azure AD 身份验证循环 - ASP.NET Core MVC Azure AD Authentication Loop on Azure App Service 不在azure服务器上工作但在本地环境中工作正常吗? - Not working on azure server but works fine in local environment? 具有Azure AD角色的MVC Webapp隐藏/显示网站选项卡 - MVC Webapp hide/show website tabs with Azure AD Roles 使用 dotnet Core Web MVC 应用程序找不到 Azure AD 身份验证的质询和身份验证方案 - Challenge and Authentication Schemes not found for Azure AD Authentication with dotnet Core Web MVC app 连接到Azure数据库的Azure网站在本地运行良好,但未部署 - Azure Website Connecting to Azure Database works fine on local but not deployed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM