Skip to content

Commit 398ae9d

Browse files
authored
Merge pull request #107808 from orspod/2020-3-1-CMK-updates
CMK updates
2 parents fe579db + 09a049d commit 398ae9d

File tree

4 files changed

+69
-10
lines changed

4 files changed

+69
-10
lines changed

articles/data-explorer/managed-identities.md

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,49 @@ ms.author: itsagui
66
ms.reviewer: orspodek
77
ms.service: data-explorer
88
ms.topic: conceptual
9-
ms.date: 01/06/2020
9+
ms.date: 03/12/2020
1010
---
1111

1212
# Configure managed identities for your Azure Data Explorer cluster
1313

1414
A [managed identity from Azure Active Directory](/azure/active-directory/managed-identities-azure-resources/overview) allows your cluster to easily access other AAD-protected resources such as Azure Key Vault. The identity is managed by the Azure platform and doesn't require you to provision or rotate any secrets. This article shows you how to create a managed identity for Azure Data Explorer clusters. Managed identity configuration is currently supported only to [enable customer-managed keys for your cluster](/azure/data-explorer/security#customer-managed-keys-with-azure-key-vault).
1515

1616
> [!Note]
17-
> Managed identities for Azure Data Explorer won't behave as expected if your app is migrated across subscriptions or tenants. The app will need to obtain a new identity, which can be done by disabling and re-enabling the feature using [remove an identity](#remove-an-identity). Access policies of downstream resources will also need to be updated to use the new identity.
17+
> Managed identities for Azure Data Explorer won't behave as expected if your app is migrated across subscriptions or tenants. The app will need to obtain a new identity, which can be done by [disabling](#remove-a-system-assigned-identity) and [re-enabling](#add-a-system-assigned-identity) the feature. Access policies of downstream resources will also need to be updated to use the new identity.
1818
1919
## Add a system-assigned identity
20+
21+
Assign a system-assigned identity that is tied to your cluster, and is deleted if your cluster is deleted. A cluster can only have one system-assigned identity. Creating a cluster with a system-assigned identity requires an additional property to be set on the cluster. The system-assigned identity is added using C#, ARM templates, or the Azure portal as detailed below.
2022

21-
Your cluster can be assigned a **system-assigned identity** that is tied to your cluster, and is deleted if your cluster is deleted. A cluster can only have one system-assigned identity. Creating a cluster with a system-assigned identity requires an additional property to be set on the cluster.
23+
# [Azure portal](#tab/portal)
24+
25+
### Add a system-assigned identity using the Azure portal
26+
27+
1. Sign in to the [Azure portal](https://portal.azure.com/).
28+
1. [Create an Azure Data Explorer cluster](/azure/data-explorer/create-cluster-database-portal#create-a-cluster)
29+
1. Select **Settings** > **Identity** in left pane of portal.
30+
1. In the **Identity** pane > **System assigned** tab:
31+
1. Move the **Status** slider to **On**.
32+
1. Select **Save**
33+
1. In the pop-up window, select **Yes**
34+
35+
![Add system assigned identity](media/managed-identities/turn-system-assigned-identity-on.png)
36+
37+
1. After a few minutes, the resulting screen shows **Object ID** and **Role assignments**.
38+
39+
![System assigned identity on](media/managed-identities/system-assigned-identity-on.png)
40+
41+
# [C#](#tab/c-sharp)
2242

2343
### Add a system-assigned identity using C#
2444

25-
To set up a managed identity using the Azure Data Explorer C# client, do the following:
45+
#### Prerequisites
46+
47+
To set up a managed identity using the Azure Data Explorer C# client:
2648

2749
* Install the [Azure Data Explorer (Kusto) NuGet package](https://www.nuget.org/packages/Microsoft.Azure.Management.Kusto/).
2850
* Install the [Microsoft.IdentityModel.Clients.ActiveDirectory NuGet package](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/) for authentication.
29-
* To run the following example, [create an Azure AD application](/azure/active-directory/develop/howto-create-service-principal-portal) and service principal that can access resources. You can add role assignment at the subscription scope and get the required `Directory (tenant) ID`, `Application ID`, and `Client Secret`.
51+
* [Create an Azure AD application](/azure/active-directory/develop/howto-create-service-principal-portal) and service principal that can access resources. You add role assignment at the subscription scope and get the required `Directory (tenant) ID`, `Application ID`, and `Client Secret`.
3052

3153
#### Create or update your cluster
3254

@@ -47,7 +69,7 @@ To set up a managed identity using the Azure Data Explorer C# client, do the fol
4769
{
4870
SubscriptionId = subscriptionId
4971
};
50-
72+
5173
var resourceGroupName = "testrg";
5274
var clusterName = "mykustocluster";
5375
var location = "Central US";
@@ -67,13 +89,15 @@ To set up a managed identity using the Azure Data Explorer C# client, do the fol
6789
```
6890

6991
If the result contains `ProvisioningState` with the `Succeeded` value, then the cluster was created or updated, and should have the following properties:
70-
92+
7193
```csharp
7294
var principalId = cluster.Identity.PrincipalId;
7395
var tenantId = cluster.Identity.TenantId;
7496
```
7597

76-
`PrincipalId` and `TenantId` are replaced with GUIDs. The `TenantId` property identifies the AAD tenant to which the identity belongs. The `PrincipalId` is a unique identifier for the cluster's new identity. Within AAD, the service principal has the same name that you gave to your App Service or Azure Functions instance.
98+
`PrincipalId` and `TenantId` are replaced with GUIDs. The `TenantId` property identifies the AAD tenant to which the identity belongs. The `PrincipalId` is a unique identifier for the cluster's new identity. Within AAD, the service principal has the same name that you gave to your App Service or Azure Functions instance.
99+
100+
# [ARM template](#tab/arm)
77101

78102
### Add a system-assigned identity using an Azure Resource Manager template
79103

@@ -120,16 +144,51 @@ When the cluster is created, it has the following additional properties:
120144

121145
`<TENANTID>` and `<PRINCIPALID>` are replaced with GUIDs. The `TenantId` property identifies the AAD tenant to which the identity belongs. The `PrincipalId` is a unique identifier for the cluster's new identity. Within AAD, the service principal has the same name that you gave to your App Service or Azure Functions instance.
122146

123-
## Remove an identity
147+
---
148+
149+
## Remove a system-assigned identity
150+
151+
Removing a system-assigned identity will also delete it from AAD. System-assigned identities are also automatically removed from AAD when the cluster resource is deleted. A system-assigned identity can be removed by disabling the feature. The system-assigned identity is removed using C#, ARM templates, or the Azure portal as detailed below.
124152

125-
Removing a system-assigned identity will also delete it from AAD. System-assigned identities are also automatically removed from AAD when the cluster resource is deleted. A system-assigned identity can be removed by disabling the feature:
153+
# [Azure portal](#tab/portal)
154+
155+
### Remove a system-assigned identity using the Azure portal
156+
157+
1. Sign in to the [Azure portal](https://portal.azure.com/).
158+
1. Select **Settings** > **Identity** in left pane of portal.
159+
1. In the **Identity** pane > **System assigned** tab:
160+
1. Move the **Status** slider to **Off**.
161+
1. Select **Save**
162+
1. In the pop-up window, select **Yes** to disable the system-assigned identity. The **Identity** pane reverts to same condition as before the addition of the system-assigned identity.
163+
164+
![System assigned identity off](media/managed-identities/system-assigned-identity.png)
165+
166+
# [C#](#tab/c-sharp)
167+
168+
### Remove a system-assigned identity using C#
169+
170+
Run the following to remove the system-assigned identity:
171+
172+
```csharp
173+
var identity = new Identity(IdentityType.None);
174+
var cluster = new Cluster(location, sku, identity: identity);
175+
await kustoManagementClient.Clusters.CreateOrUpdateAsync(resourceGroupName, clusterName, cluster);
176+
```
177+
178+
# [ARM template](#tab/arm)
179+
180+
### Remove a system-assigned identity using an Azure Resource Manager template
181+
182+
Run the following to remove the system-assigned identity:
126183

127184
```json
128185
"identity": {
129186
"type": "None"
130187
}
131188
```
132189

190+
---
191+
133192
## Next steps
134193

135194
* [Secure Azure Data Explorer clusters in Azure](security.md)
78.8 KB
Loading
91.5 KB
Loading
91.1 KB
Loading

0 commit comments

Comments
 (0)