Skip to content

Commit 3b4ac7a

Browse files
authored
Merge pull request #101129 from MarkusVi/arturo111
arturo111
2 parents 142532a + b446c8c commit 3b4ac7a

File tree

6 files changed

+63
-11
lines changed

6 files changed

+63
-11
lines changed

articles/active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-sql.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ services: active-directory
55
documentationcenter: ''
66
author: MarkusVi
77
manager: daveba
8-
editor: bryanla
98

109
ms.service: active-directory
1110
ms.subservice: msi
1211
ms.devlang: na
1312
ms.topic: tutorial
1413
ms.tgt_pltfrm: na
1514
ms.workload: identity
16-
ms.date: 01/10/2020
15+
ms.date: 01/14/2020
1716
ms.author: markvi
1817
ms.collection: M365-identity-device-management
1918
---
@@ -33,6 +32,12 @@ This tutorial shows you how to use a system-assigned identity for a Windows virt
3332

3433
[!INCLUDE [msi-tut-prereqs](../../../includes/active-directory-msi-tut-prereqs.md)]
3534

35+
36+
## Enable
37+
38+
[!INCLUDE [msi-tut-enable](../../../includes/active-directory-msi-tut-enable.md)]
39+
40+
3641
## Grant access
3742

3843
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:
4247
1. Enable Azure AD authentication for the SQL server.
4348
2. Create a **contained user** in the database that represents the VM's system-assigned identity.
4449

45-
## Enable Azure AD authentication
50+
### Enable Azure AD authentication
4651

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):**
4853

4954
1. In the Azure portal, select **SQL servers** from the left-hand navigation.
5055
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:
5358
5. Select an Azure AD user account to be made an administrator of the server, and click **Select.**
5459
6. In the command bar, click **Save.**
5560

56-
## Create user
61+
### Create contained user
5762

5863
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:
5964

@@ -62,6 +67,8 @@ This section shows how to create a contained user in the database that represent
6267

6368
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.
6469

70+
**To create a contained user:**
71+
6572
1. Start SQL Server Management Studio.
6673
2. In the **Connect to Server** dialog, Enter your SQL server name in the **Server name** field.
6774
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
94101
95102
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.
96103
97-
## Get an access token
104+
## Access data
98105
99106
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.
100107
@@ -188,6 +195,12 @@ Alternatively, a quick way to test the end to end setup without having to write
188195
189196
Examine the value of `$DataSet.Tables[0]` to view the results of the query.
190197
198+
199+
## Disable
200+
201+
[!INCLUDE [msi-tut-disable](../../../includes/active-directory-msi-tut-disable.md)]
202+
203+
191204
## Next steps
192205
193206
In this tutorial, you learned how to use a system-assigned managed identity to access Azure SQL server. To learn more about Azure SQL Server see:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: include file
3+
description: include file
4+
services: active-directory
5+
author: MarkusVi
6+
ms.service: active-directory
7+
ms.topic: include
8+
ms.date: 01/14/2020
9+
ms.author: markvi
10+
ms.custom: include file
11+
---
12+
13+
14+
15+
16+
17+
To disable the system-assigned identity on your VM, set the status of the system-assigned identity to **Off**.
18+
19+
![Create new storage account](./media/active-directory-msi-tut-disable/identity.png)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: include file
3+
description: include file
4+
services: active-directory
5+
author: MarkusVi
6+
ms.service: active-directory
7+
ms.topic: include
8+
ms.date: 01/14/2020
9+
ms.author: markvi
10+
ms.custom: include file
11+
---
12+
13+
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+
![Create new storage account](./media/active-directory-msi-tut-enable/identity.png)
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)

includes/active-directory-msi-tut-prereqs.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
title: include file
33
description: include file
44
services: active-directory
5-
author: daveba
5+
author: MarkusVi
66
ms.service: active-directory
77
ms.topic: include
8-
ms.date: 11/13/2018
9-
ms.author: daveba
8+
ms.date: 01/14/2020
9+
ms.author: markvi
1010
ms.custom: include file
1111
---
1212

1313
- 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.
1414
- 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)
37.9 KB
Loading
37.9 KB
Loading

0 commit comments

Comments
 (0)