You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: azure-sql/database/authentication-aad-directory-readers-role-tutorial.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: This article guides you through enabling the Directory Readers role
5
5
author: VanMSFT
6
6
ms.author: vanto
7
7
ms.reviewer: wiassaf, vanto, mathoma
8
-
ms.date: 06/10/2025
8
+
ms.date: 06/30/2025
9
9
ms.service: azure-sql
10
10
ms.subservice: security
11
11
ms.topic: tutorial
@@ -42,17 +42,17 @@ For more information on the benefits of assigning the Directory Readers role to
42
42
43
43
1. A user with [Privileged Role Administrator](/azure/active-directory/roles/permissions-reference#privileged-role-administrator) permissions is required for this initial setup.
44
44
1. Have the privileged user sign into the [Azure portal](https://portal.azure.com).
45
-
1. Go to the **Microsoft Entra ID** resource. Under **Managed**, go to **Groups**. Select **New group** to create a new group.
45
+
1. Go to the **Microsoft Entra ID** resource. Under **Manage**, go to **Groups**. Select **New group** to create a new group.
46
46
1. Select **Security** as the group type, and fill in the rest of the fields. Make sure that the setting **Microsoft Entra roles can be assigned to the group** is switched to **Yes**. Then assign the Microsoft Entra ID **Directory readers** role to the group.
47
-
1. Assign Microsoft Entra users as owner(s) to the group that was created. A group owner can be a regular AD user without any Microsoft Entra administrative role assigned. The owner should be a user that is managing your SQL Database, SQL Managed Instance, or Azure Synapse.
47
+
1. Assign Microsoft Entra users as an owner to the group that was created. A group owner can be a regular AD user without any Microsoft Entra administrative role assigned. The owner should be a user that is managing your SQL Database, SQL Managed Instance, or Azure Synapse.
48
48
1. Select **Create**
49
49
50
50
<aid="checking-the-group-that-was-created"></a>
51
51
52
52
### Check the group that was created
53
53
54
54
> [!NOTE]
55
-
> Make sure that the **Group Type** is **Security**. *Microsoft 365* groups are not supported for Azure SQL.
55
+
> Make sure that the **Group Type** is **Security**. *Microsoft 365* groups aren't supported for Azure SQL.
56
56
57
57
To check and manage the group that was created, go back to the **Groups** pane in the Azure portal, and search for your group name. Additional owners and members can be added under the **Owners** and **Members** menu of **Manage** setting after selecting your group. You can also review the **Assigned roles** for the group.
58
58
@@ -77,20 +77,18 @@ For subsequent steps, the Privileged Role Administrator user is no longer needed
77
77
78
78
:::image type="content" source="media/authentication-aad-directory-readers-role-tutorial/azure-ad-managed-instance-service-principal.png" alt-text="Screenshot of the Enterprise applications page for a Microsoft Entra ID resource with the Object ID of the SQL Managed instance highlighted." lightbox="media/authentication-aad-directory-readers-role-tutorial/azure-ad-managed-instance-service-principal.png":::
79
79
80
-
1. Go to the **Microsoft Entra ID** resource. Under **Managed**, go to **Groups**. Select the group that you created. Under the **Managed** setting of your group, select **Members**. Select **Add members** and add your SQL Managed Instance service principal as a member of the group by searching for the name found above.
81
-
82
-
:::image type="content" source="media/authentication-aad-directory-readers-role-tutorial/azure-ad-add-managed-instance-service-principal.png" alt-text="Screenshot of the Members page for a Microsoft Entra resource with the options highlighted for adding a SQL Managed instance as a new member." lightbox="media/authentication-aad-directory-readers-role-tutorial/azure-ad-add-managed-instance-service-principal.png":::
80
+
1. Go to the **Microsoft Entra ID** resource. Under **Manage**, go to **Groups**. Select the group that you created. Under the **Manage** setting of your group, select **Members**. Select **Add members** and add your SQL Managed Instance service principal as a member of the group by searching for the name found above.
83
81
84
82
> [!NOTE]
85
-
> It can take a few minutes to propagate the service principal permissions through the Azure system, and allow access to Microsoft Graph API. You might have to wait a few minutes before you provision a Microsoft Entra admin for SQL Managed Instance.
83
+
> It can take a few minutes to propagate the service principal permissions through the Azure system, and allow access to Microsoft Graph. You might have to wait a few minutes before you provision a Microsoft Entra admin for SQL Managed Instance.
86
84
87
85
### Remarks
88
86
89
87
For SQL Database and Azure Synapse, the server identity can be created during [logical server](logical-servers.md) creation or after the server is created. For more information on how to create or set the server identity in SQL Database or Azure Synapse, see [Enable service principals to create Microsoft Entra users](authentication-aad-service-principal.md#enable-service-principals-to-create-azure-ad-users).
90
88
91
-
For SQL Managed Instance, the **Directory Readers** role must be assigned to managed instance identity before you can [set up a Microsoft Entra admin for the managed instance](authentication-aad-configure.md#provision-azure-ad-admin-sql-managed-instance).
89
+
For SQL Managed Instance, the **Directory Readers** role must be assigned to the managed instance identity before you can [set up a Microsoft Entra admin for the managed instance](authentication-aad-configure.md#provision-azure-ad-admin-sql-managed-instance).
92
90
93
-
Assigning the **Directory Readers** role to the server identity isn't required for SQL Database or Azure Synapse when setting up a Microsoft Entra admin for the logical server. However, to enable Microsoft Entra object creation in SQL Database or Azure Synapse on behalf of a Microsoft Entra application, the **Directory Readers** role is required. If the role isn't assigned to the logical server identity, creating Microsoft Entra users in Azure SQL will fail. For more information, see [Microsoft Entra service principals with Azure SQL](authentication-aad-service-principal.md).
91
+
Assigning the **Directory Readers** role to the server identity isn't required for SQL Database or Azure Synapse when setting up a Microsoft Entra admin for the logical server. However, to enable Microsoft Entra object creation in SQL Database or Azure Synapse on behalf of a Microsoft Entra application, the **Directory Readers** role (or lower level permissions discussed in [Managed identities in Microsoft Entra for Azure SQL](authentication-azure-ad-user-assigned-managed-identity.md)) is required. If the role isn't assigned to the logical server identity, creating Microsoft Entra users in Azure SQL will fail. For more information, see [Microsoft Entra service principals with Azure SQL](authentication-aad-service-principal.md).
94
92
95
93
## Directory Readers role assignment using PowerShell
This article guides you through creating an Azure Policy that would enforce Microsoft Entra-only authentication when users create an Azure SQL Managed Instance, or a [logical server](logical-servers.md) for Azure SQL Database. To learn more about Microsoft Entra-only authentication during resource creation, see [Create server with Microsoft Entra-only authentication enabled in Azure SQL](authentication-azure-ad-only-authentication-create-server.md).
20
20
21
21
> [!NOTE]
22
-
> Although Azure Active Directory (Azure AD) has been [renamed to Microsoft Entra ID](/entra/fundamentals/new-name), Microsoft Entra-only and Azure AD-only authentication are used interchangeably in this article.
22
+
> Although Azure Active Directory (Azure AD) has been [renamed to Microsoft Entra ID](/entra/fundamentals/new-name), Microsoft Entra-only and Azure AD-only authentication are used interchangeably in this article.
23
23
24
24
In this article, you learn how to:
25
25
@@ -33,44 +33,43 @@ In this article, you learn how to:
33
33
34
34
## Create an Azure Policy
35
35
36
-
Start off by creating an Azure Policy enforcing SQL Database or Managed Instance provisioning with Azure AD-only authentication enabled.
36
+
Start off by creating an Azure Policy enforcing SQL Database or SQL Managed Instance provisioning with Microsoft Entra-only authentication enabled.
37
37
38
38
1. Go to the [Azure portal](https://portal.azure.com).
39
39
1. Search for the service **Policy**.
40
40
1. Under the Authoring settings, select **Definitions**.
41
-
1. In the **Search** box, search for *Azure Active Directory only authentication*.
41
+
1. In the **Search** box, search for *Microsoft Entra-only authentication*.
42
42
43
-
There are two built-in policies available to enforce Azure AD-only authentication. One is for SQL Database, and the other is for SQL Managed Instance.
43
+
There are a few built-in policies available to enforce Microsoft Entra-only authentication. Look for the one available for your service:
44
44
45
-
- Azure SQL Database should have Azure Active Directory Only Authentication enabled
46
-
- Azure SQL Managed Instance should have Azure Active Directory Only Authentication enabled
45
+
- Azure SQL Database should have Microsoft Entra-only Authentication enabled
46
+
- Azure SQL Managed Instance should have Microsoft Entra-only Authentication enabled
47
47
48
-
49
-
1. Select the policy name for your service. In this example, we'll use Azure SQL Database. Select **Azure SQL Database should have Azure Active Directory Only Authentication enabled**.
50
-
1. Select **Assign** in the new menu.
48
+
1. Select the policy name for your service. In this example, we'll use Azure SQL Database. Select **Azure SQL Database should have Microsoft Entra-only authentication enabled**.
49
+
1. Select **Assign policy** in the new menu.
51
50
52
51
> [!NOTE]
53
52
> The JSON script in the menu shows the built-in policy definition that can be used as a template to build a custom Azure Policy for SQL Database. The default is set to `Audit`.
54
53
55
-
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/assign-policy-azure-ad-only-authentication.png" alt-text="Screenshot of assigning Azure Policy for Azure AD-only authentication." lightbox="media/authentication-azure-ad-only-authentication-policy-how-to/assign-policy-azure-ad-only-authentication.png":::
54
+
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/assign-policy-azure-ad-only-authentication.png" alt-text="Screenshot of assigning Azure Policy for Microsoft Entra-only authentication." lightbox="media/authentication-azure-ad-only-authentication-policy-how-to/assign-policy-azure-ad-only-authentication.png":::
56
55
57
56
1. In the **Basics** tab, add a **Scope** by using the selector (**...**) on the side of the box.
58
57
1. In the **Scope** pane, select your **Subscription** from the dropdown list menu, and select a **Resource Group** for this policy. Once you're done, use the **Select** button to save the selection.
59
58
60
59
> [!NOTE]
61
-
> If you do not select a resource group, the policy will apply to the whole subscription.
60
+
> If you don't select a resource group, the policy applies to the whole subscription.
62
61
63
-
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/adding-scope-policy-azure-ad-only-authentication.png" alt-text="Screenshot of adding Azure Policy scope for Azure AD-only authentication.":::
62
+
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/adding-scope-policy-azure-ad-only-authentication.png" alt-text="Screenshot of adding Azure Policy scope for Microsoft Entra-only authentication.":::
64
63
65
64
1. Once you're back on the **Basics** tab, customize the **Assignment name** and provide an optional **Description**. Make sure the **Policy enforcement** is **Enabled**.
66
65
1. Go over to the **Parameters** tab. Unselect the option **Only show parameters that require input**.
67
-
1. Under **Effect**, select **Deny**. This setting prevents creating a logical server without Azure AD-only authentication enabled.
66
+
1. Under **Effect**, select **Deny**. This setting prevents creating a logical server without Microsoft Entra-only authentication enabled.
68
67
69
-
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/deny-policy-azure-ad-only-authentication.png" alt-text="Screenshot of Azure Policy effect parameter for Azure AD-only authentication." lightbox="media/authentication-azure-ad-only-authentication-policy-how-to/deny-policy-azure-ad-only-authentication.png":::
68
+
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/deny-policy-azure-ad-only-authentication.png" alt-text="Screenshot of Azure Policy effect parameter for Microsoft Entra-only authentication." lightbox="media/authentication-azure-ad-only-authentication-policy-how-to/deny-policy-azure-ad-only-authentication.png":::
70
69
71
70
1. In the **Non-compliance messages** tab, you can customize the policy message that displays if a violation of the policy has occurred. The message will let users know what policy was enforced during server creation.
72
71
73
-
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/non-compliance-message-policy-azure-ad-only-authentication.png" alt-text="Screenshot of Azure Policy non-compliance message for Azure AD-only authentication." lightbox="media/authentication-azure-ad-only-authentication-policy-how-to/non-compliance-message-policy-azure-ad-only-authentication.png":::
72
+
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/non-compliance-message-policy-azure-ad-only-authentication.png" alt-text="Screenshot of Azure Policy noncompliance message for Microsoft Entra-only authentication." lightbox="media/authentication-azure-ad-only-authentication-policy-how-to/non-compliance-message-policy-azure-ad-only-authentication.png":::
74
73
75
74
1. Select **Review + create**. Review the policy and select the **Create** button.
76
75
@@ -83,18 +82,16 @@ You can check the **Compliance** setting under the **Policy** service to see the
83
82
84
83
Search for the assignment name that you have given earlier to the policy.
85
84
86
-
:::image type="content" source="media/authentication-azure-ad-only-authentication-policy-how-to/compliance-policy-azure-ad-only-authentication.png" alt-text="Screenshot of Azure Policy compliance for Azure AD-only authentication." lightbox="media/authentication-azure-ad-only-authentication-policy-how-to/compliance-policy-azure-ad-only-authentication.png":::
87
-
88
-
Once the logical server is created with Azure AD-only authentication, the policy report will increase the counter under the **Resources by compliance state** visual. You'll be able to see which resources are compliant, or non-compliant.
85
+
Once the logical server is created with Microsoft Entra-only authentication, the policy report will increase the counter under the **Resources by compliance state** visual. You'll be able to see which resources are compliant, or noncompliant.
89
86
90
-
If the resource group that the policy was chosen to cover contains already created servers, the policy report will indicate those resources that are compliant and non-compliant.
87
+
If the resource group that the policy was chosen to cover contains already created servers, the policy report will indicate those resources that are compliant and noncompliant.
91
88
92
89
> [!NOTE]
93
-
> Updating the compliance report can take some time. Changes related to resource creation or Microsoft Entra-only authentication settings are not reported immediately.
90
+
> Updating the compliance report can take some time. Changes related to resource creation or Microsoft Entra-only authentication settings aren't reported immediately.
94
91
95
92
## Provision a server
96
93
97
-
You can then try to provision a logical server or managed instance in the resource group that you assigned the Azure Policy. If Azure AD-only authentication is enabled during server creation, the provision will succeed. When Azure AD-only authentication isn't enabled, the provision will fail.
94
+
You can then try to provision a logical server or managed instance in the resource group that you assigned the Azure Policy. If Microsoft Entra-only authentication is enabled during server creation, the provision will succeed. When Microsoft Entra-only authentication isn't enabled, the provision will fail.
98
95
99
96
For more information, see [Create server with Microsoft Entra-only authentication enabled in Azure SQL](authentication-azure-ad-only-authentication-create-server.md).
0 commit comments