简体   繁体   中英

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.

When I create the project in MVC web app itself it asks authentication mode of the project . 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.

After clicking create, the visual studio itself generates the following file for Work or school account authentication I beleive,

  1. Startup.Auth.cs in app_start folder
  2. AdalTokenCache.cs, ApplicationDbContext in Moldels folder

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.

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. 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)

As @Chetan said , you can't use localdb/sqlexpress with Azure app service. 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

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