How to add Azure AD Authentication to existing .NET MVC Web Application?

Viewed 911

I have an existing .NET MVC Web application which is using Windows Authentication. As we are migrating the project from On-Premise to Azure, there is a necessity of updating the application to use Azure AD Authentication. I was trying to use Connected Services using VS 2019, but not able to find Azure AD Authentication related service. Can anyone please share the process to add Azure AD to existing app?

enter image description here

1 Answers

Solution 1:

1) I tried with creating new ASP .NET MVC application project in Visual studio 2019 .click on the Change Under the Authentication

enter image description here

2) Select Work or School Accounts .

enter image description here

3) you can enter a domain name and also select the Read directory data option as desired. Developers typically include this option.

enter image description here

Solution 2:

1) Select the Project > Add Connected Service... menu command, or double-click the Connected Services node found under the project in Solution Explorer

2) On the Connected Services page, select Authentication with Azure Active Directory

enter image description here

3) On the Introduction page, select Next. If you see errors on this page, refer to Diagnosing errors with the Azure Active Directory Connected Service

enter image description here

4) On the Single-Sign On page, select a domain from the Domain drop-down list. The list contains all domains accessible by the accounts listed in the Account Settings dialog of Visual Studio (File > Account Settings...). As an alternative, you can enter a domain name if you don’t find the one you’re looking for, such as mydomain.onmicrosoft.com. You can choose the option to create an Azure Active Directory app or use the settings from an existing Azure Active Directory app. Select Next when done.

enter image description here

5) On the Directory Access page, select the Read directory data option as desired. Developers typically include this option.

enter image description here

6) Select Finish to start modifications to your project to enable Azure AD authentication

For more details refer this document

Related