Skip to content

Commit 1f3f7df

Browse files
GitHubber17ghogen
andauthored
Freshness Edit: Visual Studio - MSBuild (#14042)
* article freshness * edits * update images * Apply suggestions from code review Co-authored-by: Gordon Hogenson <[email protected]> * edits --------- Co-authored-by: Gordon Hogenson <[email protected]>
1 parent 5e86aa1 commit 1f3f7df

File tree

5 files changed

+65
-59
lines changed

5 files changed

+65
-59
lines changed
14.9 KB
Loading
15.9 KB
Loading
-949 Bytes
Loading
2.98 KB
Loading
Lines changed: 65 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,120 @@
11
---
2-
title: Use the Microsoft Identity platform connected service to use Microsoft Entra ID for authentication
3-
description: Connect Microsoft Entra ID (formerly Azure Active Directory) to your application by using Connected Services in Visual Studio on Windows.
2+
title: Entra ID Authentication With Connected Services
3+
description: Connect Microsoft Entra ID (formerly Azure Active Directory) to your application with Connected Services in Visual Studio on Windows.
44
author: ghogen
55
manager: mijacobs
66
ms.subservice: azure-development
77
ms.custom: devx-track-csharp
88
ms.topic: how-to
9-
ms.date: 12/19/2023
9+
ms.date: 06/27/2025
1010
ms.author: ghogen
11+
#customer intent: As a developer, I want to use Connected Services in Visual Studio on Windows, so I can connect Microsoft Entra ID with my application for authentication.
1112
---
1213

13-
# Add Microsoft Entra ID authentication by using Connected Services in Visual Studio
14+
# Add Microsoft Entra ID authentication with Connected Services in Visual Studio
1415

15-
You can add support for Microsoft Entra ID to an ASP.NET web app by using the Microsoft Identity platform connected service.
16+
You can add support for Microsoft Entra ID to an ASP.NET web application with the Microsoft identity platform connected service. Microsoft Entra ID enables support for user authentication to ASP.NET Model-View-Controller (MVC) web apps or Active Directory Authentication in web API services.
1617

17-
By using Microsoft Entra ID, you can support user authentication for ASP.NET Model-View-Controller (MVC) web applications, or Active Directory Authentication in web API services. With Microsoft Entra authentication, your users can use their accounts from Microsoft Entra ID to connect to your web applications. The advantages of Microsoft Entra authentication with web API include enhanced data security when exposing an API from a web application. With Microsoft Entra ID, you do not have to manage a separate authentication system with its own account and user management.
18+
Microsoft Entra ID authentication offers many advantages:
1819

19-
This article and its companion articles provide details of using the Visual Studio Connected Service feature for Active Directory.
20+
- Users can authenticate with their accounts from Microsoft Entra ID to connect to your web apps.
21+
- You gain enhanced data security when you expose an API from a web app.
22+
- You don't have to manage a separate authentication system with its own account and user management.
23+
24+
This article and its [companion articles](#related-content) describe how to use the Visual Studio Connected Service feature for Active Directory.
2025

2126
## Prerequisites
2227

28+
To complete the procedures in this article, the following prerequisites must be satisfied:
29+
2330
- [!INCLUDE [prerequisites-azure-subscription](includes/prerequisites-azure-subscription.md)]
24-
- **Visual Studio 2015** or later. [Download Visual Studio now](https://aka.ms/vsdownload?utm_source=mscom&utm_campaign=msdocs).
2531

26-
<a name='connect-to-azure-active-directory-using-the-connected-services-dialog'></a>
32+
- **Visual Studio**. [Download Visual Studio now](https://aka.ms/vsdownload?utm_source=mscom&utm_campaign=msdocs).
2733

28-
### Connect to Microsoft Identity platform
34+
## Connect to Microsoft identity platform
2935

30-
:::moniker range=">=vs-2022"
36+
Add Microsoft identity platform as a connected service to your application by following these steps:
3137

3238
1. In Visual Studio, create or open an ASP.NET MVC project, or an ASP.NET Web API project.
3339

34-
1. Select the **Project**, **Connected Services**, **Add** menu command, or right-click the **Connected Services** node found under the project in Solution Explorer, and choose **Add**, **Microsoft Identity platform**.
35-
36-
If you are missing the .NET MSIdentity tool, the screen prompts you to install it.
37-
38-
![Screenshot of required components window.](./media/vs-azure-active-directory/required-components.png)
39-
40-
1. The **Configure Microsoft identity platform** screen appears. If you haven't signed in to Azure, you're asked to sign in. Once you're signed in, you see a list of your applications.
40+
1. Use one of the following methods to add the Microsoft identity platform connected service:
4141

42-
![Screenshot showing list of owned applications.](./media/vs-azure-active-directory/owned-applications.png)
42+
:::moniker range=">=vs-2022"
4343

44-
1. If you don't have an application, choose **Create new**, and enter the application name. For Microsoft Entra ID, choose Microsoft as the tenant.
44+
- Select **Project** > **Connected Services** > **Add** > **Microsoft identity platform**.
45+
46+
- In **Solution Explorer**, right-click the **Connected Services** node for the project, and select **Add** > **Microsoft identity platform**.
4547

46-
![Screenshot showing how to register a new application.](./media/vs-azure-active-directory/register-an-application.png)
48+
:::moniker-end
49+
:::moniker range="<=vs-2019"
4750

48-
The application you entered now shows in the list. Select it and choose **Next**.
51+
- Select **Project** > **Manage Connected Services** > **Add a service dependency** > **Microsoft identity platform**.
52+
53+
- In **Solution Explorer**, right-click the **Connected Services** node for the project, and select **Manage Connected Services > Add a service dependency** > **Microsoft identity platform**.
4954

50-
1. On the next screen, you can choose to enable Microsoft.Graph or allow another API project to have access. You can configure this later if you don't have the information yet.
55+
:::image type="content" source="./media/vs-azure-active-directory/vs-2019/add-dependency-microsoft-identity-platform.png" border="false" alt-text="Screenshot showing the Microsoft identity platform option in Visual Studio.":::
5156

52-
![Screenshot of additional options for adding APIs.](./media/vs-azure-active-directory/additional-settings.png)
57+
:::moniker-end
5358

54-
1. Choose **Next**. The **Summary of changes** screen appears showing what is being changed in the project.
59+
If your installation is missing the .NET MSIdentity tool, the **Required components** window opens with a message to complete the install:
5560

56-
![Screenshot showing Summary of changes screen.](./media/vs-azure-active-directory/summary-of-changes.png)
61+
:::image type="content" source="./media/vs-azure-active-directory/required-components.png" border="false" alt-text="Screenshot of the Required Components window with a message to install the .NET MSIdentity tool.":::
5762

58-
1. The **Dependency configuration process** screen shows the specific changes that are being made to your project.
63+
As needed, follow the steps to install the .NET MSIdentity tool, and then continue with this procedure.
5964

60-
Now the new service dependency shows on the Connected Services screen.
65+
1. The **Microsoft identity platform** configuration screen opens.
6166

62-
![Screenshot showing the Microsoft Identity platform service dependency has been created.](./media/vs-azure-active-directory/identity-platform-service-dependency.png)
63-
64-
If you want to modify it, such as to add support for an API such as Microsoft.Graph, click on the three dots, and then choose **Edit dependency**. You can repeat the steps and choose the APIs that you want to grant access to.
65-
66-
You can also see the Active Directory domain on the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040).
67-
68-
:::moniker-end
69-
:::moniker range="<=vs-2019"
70-
1. In Visual Studio, create or open an ASP.NET MVC project, or an ASP.NET Web API project.
67+
As needed, sign in to Azure. After you sign in, you see a list of your applications for the selected **Tenant**:
7168

72-
1. Select the **Project**, **Manage Connected Services** menu command, or right-click the **Connected Services** node found under the project in Solution Explorer, and choose **Manage Connected Services**, and then select the link **Add a service dependency** and choose **Microsoft Identity platform**.
69+
:::image type="content" source="./media/vs-azure-active-directory/owned-applications.png" border="false" alt-text="Screenshot showing the list of owned applications.":::
7370

74-
![Screenshot showing the Microsoft Identity platform option.](./media/vs-azure-active-directory/vs-2019/add-dependency-microsoft-identity-platform.png)
71+
If you don't have an application, select **Create new**:
72+
73+
1. For Microsoft Entra ID, select **Microsoft** as the tenant.
74+
75+
1. Enter the display name for the new application.
76+
77+
1. Select **Register**:
7578

76-
If you are missing the .NET MSIdentity tool, the screen prompts you to install it.
79+
:::image type="content" source="./media/vs-azure-active-directory/register-an-application.png" border="false" alt-text="Screenshot showing how to register a new application.":::
7780

78-
![Screenshot of required components window.](./media/vs-azure-active-directory/required-components.png)
81+
After the new application registers, it appears in the application list.
82+
83+
1. In the application list, select the application to use, and select **Next**.
7984

80-
If you had to install the tool, you might need to restart the process again from step 1.
85+
<a name="update-service-settings"> </a>
86+
87+
1. On the **Additional settings** screen, choose your preferred settings. You can enable Microsoft Graph or allow another API project to have access. You can also configure these settings later.
8188

82-
1. The **Configure Microsoft identity platform** screen appears. If you haven't signed in to Azure, you're asked to sign in. Once you're signed in, you see a list of your applications.
89+
:::image type="content" source="./media/vs-azure-active-directory/additional-settings.png" border="false" alt-text="Screenshot of additional options for the application, including enable Microsoft Graph and allow API access.":::
8390

84-
![Screenshot showing list of owned applications.](./media/vs-azure-active-directory/owned-applications.png)
91+
1. Select **Next**. The **Summary of changes** screen appears for the project, including updates to dependencies to support Microsoft identity platform:
8592

86-
1. If you don't have an application, choose **Create new**, and enter the application name. For Microsoft Entra ID, choose Microsoft as the tenant.
93+
:::image type="content" source="./media/vs-azure-active-directory/summary-of-changes.png" border="false" alt-text="Screenshot showing Summary of changes screen for the project.":::
8794

88-
![Screenshot showing how to register a new application.](./media/vs-azure-active-directory/register-an-application.png)
95+
1. Select **Finish**. The **Dependency configuration progress** screen shows the process status. When the process finishes successfully, the status shows the statement "Complete. Microsoft identity platform \<application> is configured."
8996

90-
The application you entered now shows in the list. Select it and choose **Next**.
97+
1. Select **Close** to close the window.
9198

92-
1. On the next screen, you can choose to enable Microsoft.Graph or allow another API project to have access. You can configure this later if you don't have the information yet.
99+
The new connection is listed under **Service Dependencies** in the **Connected Services** screen for the project:
93100

94-
![Screenshot of additional options for adding APIs.](./media/vs-azure-active-directory/additional-settings.png)
101+
:::image type="content" source="./media/vs-azure-active-directory/identity-platform-service-dependency.png" border="false" alt-text="Screenshot showing the Microsoft identity platform service dependency listed as a connected service for the project.":::
95102

96-
1. Choose **Next**. The **Summary of changes** screen appears showing what is being changed in the project.
103+
You can also see the Microsoft Entra ID domain for the application connection in the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040).
97104

98-
![Screenshot showing Summary of changes screen.](./media/vs-azure-active-directory/summary-of-changes.png)
105+
## Modify connected service settings
99106

100-
1. The **Dependency configuration process** screen shows the specific changes that are being made to your project.
107+
After you add Microsoft identity platform as a connected service, you can modify the settings as needed:
101108

102-
Now the new service dependency shows on the Connected Services screen.
109+
1. In the **Connected Services** > **Service Dependencies** screen, locate the **Microsoft identity platform** service.
103110

104-
![Screenshot showing the Microsoft Identity platform service dependency has been created.](./media/vs-azure-active-directory/identity-platform-service-dependency.png)
111+
1. Select **More options** (**...**) for the service, and then select **Edit dependency**.
105112

106-
If you want to modify it, such as to add support for an API such as Microsoft.Graph, click on the three dots, and then choose **Edit dependency**. You can repeat the steps and choose the APIs that you want to grant access to.
113+
1. Select the tenant that contains the application, select the application, and then select **Next**.
107114

108-
You can also see the Active Directory domain on the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040).
109-
:::moniker-end
115+
Follow the process described earlier to [modify and apply your preferred settings](#update-service-settings). Repeat the process as needed to grant project access for necessary APIs.
110116

111117
## Related content
112118

113-
- [Authentication scenarios for Microsoft Entra ID](/azure/active-directory/develop/authentication-vs-authorization)
114-
- [Add sign-in with Microsoft to an ASP.NET web app](/azure/active-directory/develop/quickstart-v2-aspnet-webapp)
119+
- [Authentication scenarios for Microsoft Entra ID](/entra/identity-platform/authentication-vs-authorization)
120+
- [Add sign-in with Microsoft to an ASP.NET web app](/entra/identity-platform/quickstart-web-app-sign-in)

0 commit comments

Comments
 (0)