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
To grant your VM access to a database in an Azure SQL Server, you can use an existing SQL server or create a new one. To create a new server and database using the Azure portal, follow this [Azure SQL quickstart](https://docs.microsoft.com/azure/sql-database/sql-database-get-started-portal). There are also quickstarts that use the Azure CLI and Azure PowerShell in the [Azure SQL documentation](https://docs.microsoft.com/azure/sql-database/).
@@ -42,9 +47,9 @@ There are two steps to granting your VM access to a database:
42
47
1. Enable Azure AD authentication for the SQL server.
43
48
2. Create a **contained user** in the database that represents the VM's system-assigned identity.
44
49
45
-
## Enable Azure AD authentication
50
+
###Enable Azure AD authentication
46
51
47
-
[Configure Azure AD authentication for the SQL server](/azure/sql-database/sql-database-aad-authentication-configure) using the following steps:
52
+
**To [configure Azure AD authentication for the SQL server](/azure/sql-database/sql-database-aad-authentication-configure):**
48
53
49
54
1. In the Azure portal, select **SQL servers** from the left-hand navigation.
50
55
2. Click the SQL server to be enabled for Azure AD authentication.
@@ -53,7 +58,7 @@ There are two steps to granting your VM access to a database:
53
58
5. Select an Azure AD user account to be made an administrator of the server, and click **Select.**
54
59
6. In the command bar, click **Save.**
55
60
56
-
## Create user
61
+
###Create contained user
57
62
58
63
This section shows how to create a contained user in the database that represents the VM's system assigned identity. For this step, you need [Microsoft SQL Server Management Studio](https://docs.microsoft.com/sql/ssms/download-sql-server-management-studio-ssms) (SSMS). Before beginning, it may also be helpful to review the following articles for background on Azure AD integration:
59
64
@@ -62,6 +67,8 @@ This section shows how to create a contained user in the database that represent
62
67
63
68
SQL DB requires unique AAD display names. With this, the AAD accounts such as users, groups and Service Principals (applications) and VM names enabled for managed identity must be uniquely defined in AAD regarding their display names. SQL DB checks the AAD display name during T-SQL creation of such users and if it is not unique, the command fails requesting to provide a unique AAD display name for a given account.
64
69
70
+
**To create a contained user:**
71
+
65
72
1. Start SQL Server Management Studio.
66
73
2. In the **Connect to Server** dialog, Enter your SQL server name in the **Server name** field.
67
74
3. In the **Authentication** field, select **Active Directory - Universal with MFA support**.
@@ -94,7 +101,7 @@ SQL DB requires unique AAD display names. With this, the AAD accounts such as us
94
101
95
102
Code running in the VM can now get a token using its system-assigned managed identity and use the token to authenticate to the SQL server.
96
103
97
-
## Get an access token
104
+
## Access data
98
105
99
106
This section shows how to get an access token using the VM's system-assigned managed identity and use it to call Azure SQL. Azure SQL natively supports Azure AD authentication, so it can directly accept access tokens obtained using managed identities for Azure resources. You use the **access token** method of creating a connection to SQL. This is part of Azure SQL's integration with Azure AD, and is different from supplying credentials on the connection string.
100
107
@@ -188,6 +195,12 @@ Alternatively, a quick way to test the end to end setup without having to write
188
195
189
196
Examine the value of `$DataSet.Tables[0]` to view the results of the query.
Enabling a system-assigned managed identity is a one-click experience. You can either enable it during the creation of a VM or in the properties of an existing VM.
14
+
15
+

16
+
17
+
18
+
**To enable a system-assigned managed identity on a new VM:**
19
+
20
+
1.[Sign in to Azure portal](https://portal.azure.com)
21
+
22
+
2.[Create a virtual machine with system-assigned identity enabled](/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#system-assigned-managed-identity)
Copy file name to clipboardExpand all lines: includes/active-directory-msi-tut-prereqs.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,13 @@
2
2
title: include file
3
3
description: include file
4
4
services: active-directory
5
-
author: daveba
5
+
author: MarkusVi
6
6
ms.service: active-directory
7
7
ms.topic: include
8
-
ms.date: 11/13/2018
9
-
ms.author: daveba
8
+
ms.date: 01/14/2020
9
+
ms.author: markvi
10
10
ms.custom: include file
11
11
---
12
12
13
13
- If you're not familiar with the managed identities for Azure resources feature, see this [overview](../articles/active-directory/msi-overview.md). If you don't have an Azure account, [sign up for a free account](https://azure.microsoft.com/free/) before you continue.
14
14
- To perform the required resource creation and role management, your account needs "Owner" permissions at the appropriate scope (your subscription or resource group). If you need assistance with role assignment, see [Use Role-Based Access Control to manage access to your Azure subscription resources](../articles/role-based-access-control/role-assignments-portal.md).
15
-
-[Sign in to Azure portal](https://portal.azure.com)
16
-
-[Create a virtual machine with system-assigned identity enabled](/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#system-assigned-managed-identity)
0 commit comments