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: articles/azure-sql/database/authentication-azure-ad-logins-tutorial.md
+41-41Lines changed: 41 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,11 +100,49 @@ In this tutorial, you learn how to:
100
100
>
101
101
> For example, `CREATE USER [[email protected]] FROM EXTERNAL PROVIDER`.
102
102
103
-
## Grant roles to the Azure AD login
103
+
## Grant server-level roles to Azure AD logins
104
104
105
-
[Special roles for SQL Database](/sql/relational-databases/security/authentication-access/database-level-roles#special-roles-for--and-azure-synapse) can be assigned to logins in the virtual master database.
105
+
You can add logins to the [built-in server-level roles](security-server-roles.md#built-in-server-level-roles), such as the **##MS_DefinitionReader##**, **##MS_ServerStateReader##**, or **##MS_ServerStateManager##** role.
106
106
107
-
In order to grant one of the special database roles, an Azure AD user with a login must be created in the virtual master database.
107
+
> [!NOTE]
108
+
> The server-level roles mentioned here are not supported for Azure AD groups.
109
+
110
+
```sql
111
+
ALTER SERVER ROLE ##MS_DefinitionReader## ADD MEMBER [AzureAD_object];
112
+
```
113
+
114
+
```sql
115
+
ALTER SERVER ROLE ##MS_ServerStateReader## ADD MEMBER [AzureAD_object];
116
+
```
117
+
118
+
```sql
119
+
ALTER SERVER ROLE ##MS_ServerStateManager## ADD MEMBER [AzureAD_object];
120
+
```
121
+
122
+
Permissions aren't effective until the user reconnects. Flush the DBCC cache as well:
123
+
124
+
```sql
125
+
DBCC FLUSHAUTHCACHE
126
+
DBCC FREESYSTEMCACHE('TokenAndPermUserStore') WITH NO_INFOMSGS
127
+
```
128
+
129
+
To check which Azure AD logins are part of server-level roles, run the following query:
[Special roles for SQL Database](/sql/relational-databases/security/authentication-access/database-level-roles#special-roles-for--and-azure-synapse) can be assigned to users in the virtual master database.
144
+
145
+
In order to grant one of the special database roles to a user, the user must exist in the virtual master database.
108
146
109
147
To add a user to a role, you can run the following query:
110
148
@@ -150,44 +188,6 @@ In our example, we created the user `[email protected]`. Let's give the user the *
You can also choose to give the user additional [built-in server-level roles](security-server-roles.md#built-in-server-level-roles), such as the **##MS_DefinitionReader##**, **##MS_ServerStateReader##**, or **##MS_ServerStateManager##** role.
156
-
157
-
> [!NOTE]
158
-
> The server-level roles mentioned here are not supported for Azure AD groups.
159
-
160
-
```sql
161
-
ALTER SERVER ROLE ##MS_DefinitionReader## ADD MEMBER [AzureAD_object];
162
-
```
163
-
164
-
```sql
165
-
ALTER SERVER ROLE ##MS_ServerStateReader## ADD MEMBER [AzureAD_object];
166
-
```
167
-
168
-
```sql
169
-
ALTER SERVER ROLE ##MS_ServerStateManager## ADD MEMBER [AzureAD_object];
170
-
```
171
-
172
-
Permissions aren't effective until the user reconnects. Flush the DBCC cache as well:
173
-
174
-
```sql
175
-
DBCC FLUSHAUTHCACHE
176
-
DBCC FREESYSTEMCACHE('TokenAndPermUserStore') WITH NO_INFOMSGS
177
-
```
178
-
179
-
To check which Azure AD logins are part of server-level roles, run the following query:
The [ALTER LOGIN (Transact-SQL)](/sql/t-sql/statements/alter-login-transact-sql?view=azuresqldb-current&preserve-view=true) DDL syntax can be used to enable or disable an Azure AD login in Azure SQL Database.
Copy file name to clipboardExpand all lines: articles/azure-sql/database/authentication-azure-ad-logins.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,8 @@ ms.date: 03/14/2022
19
19
20
20
You can now create and utilize Azure AD server principals, which are logins in the virutal master database of a SQL Database. There are several benefits of using Azure AD server principals for SQL Database:
21
21
22
-
- Support multiple Azure AD login accounts with [special roles for SQL Database](/sql/relational-databases/security/authentication-access/database-level-roles#special-roles-for--and-azure-synapse), such as the `loginmanager` and `dbmanager` roles.
23
22
- Support [Azure SQL Database server roles for permission management](security-server-roles.md).
23
+
- Support multiple Azure AD users with [special roles for SQL Database](/sql/relational-databases/security/authentication-access/database-level-roles#special-roles-for--and-azure-synapse), such as the `loginmanager` and `dbmanager` roles.
24
24
- Functional parity between SQL logins and Azure AD logins.
25
25
- Increase functional improvement support, such as utilizing [Azure AD-only authentication](authentication-azure-ad-only-authentication.md). Azure AD-only authentication allows SQL authentication to be disabled, which includes the SQL server admin, SQL logins and users.
26
26
- Allows Azure AD principals to support geo-replicas. Azure AD principals will be able to connect to the geo-replica of a user database, with a *read-only* permission and *deny* permission to the primary server.
0 commit comments