Skip to content

Commit 257cf5c

Browse files
authored
Merge pull request #262532 from rcdun/aoi_quickstart_cli_powershell
Add Azure CLI experiences to quickstart for Operator Insights
2 parents cd3f3f3 + befe27b commit 257cf5c

File tree

4 files changed

+200
-7
lines changed

4 files changed

+200
-7
lines changed

articles/operator-insights/data-product-create.md

Lines changed: 199 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,188 @@ In this article, you learn how to create an Azure Operator Insights Data Product
2424
- (Optional) If you plan to integrate Data Product with Microsoft Purview, you must have an active Purview account. Make note of the Purview collection ID when you [set up Microsoft Purview with a Data Product](purview-setup.md).
2525
- After obtaining your subscription access, register the Microsoft.NetworkAnalytics and Microsoft.HybridNetwork Resource Providers (RPs) to continue. For guidance on registering RPs in your subscription, see [Register resource providers in Azure](../azure-resource-manager/management/resource-providers-and-types.md#azure-portal).
2626

27-
### For CMK-based data encryption or Microsoft Purview
27+
## Prepare your Azure portal or Azure CLI environment
28+
29+
You can use the Azure portal or the Azure CLI to follow the steps in this article.
30+
31+
32+
# [Portal](#tab/azure-portal)
33+
34+
Confirm that you can sign in to the [Azure portal](https://portal.azure.com) and can access the subscription.
35+
36+
# [Azure CLI](#tab/azure-cli)
37+
38+
You can run Azure CLI commands in one of two ways:
39+
40+
- You can run CLI commands from within the Azure portal, in Azure Cloud Shell.
41+
- You can install the CLI and run CLI commands locally.
42+
43+
### Use Azure Cloud Shell
44+
45+
Azure Cloud Shell is a free Bash shell that you can run directly within the Azure portal. The Azure CLI is preinstalled and configured to use with your account. Select the **Cloud Shell** button on the menu in the upper-right section of the Azure portal:
46+
47+
[![Screenshot of Cloud Shell menu.](./media/dp-quickstart-create/cloud-shell-menu.png)](https://portal.azure.com)
48+
49+
The button launches an interactive shell that you can use to run the steps outlined in this how-to article:
50+
51+
[![Screenshot showing the Cloud Shell window in the portal.](./media/dp-quickstart-create/cloud-shell.png)](https://portal.azure.com)
52+
53+
54+
### Install the Azure CLI locally
55+
56+
You can also install and use the Azure CLI locally. If you plan to use Azure CLI locally, make sure you have installed the latest version of the Azure CLI. See [Install the Azure CLI](/cli/azure/install-azure-cli).
57+
58+
To log into your local installation of the CLI, run the az sign-in command:
59+
60+
```azurecli-interactive
61+
az login
62+
```
63+
64+
### Change the active subscription
65+
66+
Azure subscriptions have both a name and an ID. You can switch to a different subscription with [az account set](/cli/azure/account#az-account-set), specifying the desired subscription name or ID.
67+
68+
- To use the name to change the active subscription:
69+
```azurecli-interactive
70+
az account set --subscription "<SubscriptionName>"
71+
```
72+
- To use the ID to change the active subscription:
73+
```azurecli-interactive
74+
az account set --subscription "<SubscriptionID>"
75+
```
76+
77+
> [!NOTE]
78+
> Replace any values shown in the form \<KeyVaultName\> with the values for your deployment.
79+
80+
---
81+
82+
## Create a resource group
83+
84+
A resource group is a logical container into which Azure resources are deployed and managed.
85+
86+
# [Portal](#tab/azure-portal)
87+
88+
If you plan to use CMK-based data encryption or Microsoft Purview, set up a resource group now:
89+
90+
1. Sign in to the [Azure portal](https://portal.azure.com).
91+
1. Select **Resource groups**.
92+
1. Select **Create** and follow the prompts.
93+
94+
For more information, see [Create resource groups](../azure-resource-manager/management/manage-resource-groups-portal.md#create-resource-groups).
95+
96+
If you don't plan to use CMK-based date encryption or Microsoft Purview, you can set up a resource group now or when you [create the Data Product resource](#create-an-azure-operator-insights-data-product-resource).
97+
98+
# [Azure CLI](#tab/azure-cli)
99+
100+
Use the `az group create` command to create a resource group named \<ResourceGroup\> in the region where you want to deploy.
101+
102+
```azurecli-interactive
103+
az group create --name "<ResourceGroup>" --location "<Region>"
104+
```
105+
---
106+
107+
## Set up resources for CMK-based data encryption or Microsoft Purview
28108

29109
If you're using CMK-based data encryption or Microsoft Purview, you must set up Azure Key Vault and user-assigned managed identity (UAMI) as prerequisites.
30110

31-
#### Set up Azure Key Vault
111+
### Set up Azure Key Vault
32112

33113
Azure key Vault Resource is used to store your Customer Managed Key (CMK) for data encryption. Data Product uses this key to encrypt your data over and above the standard storage encryption. You need to have Subscription/Resource group owner permissions to perform this step.
34-
1. [Create an Azure Key Vault resource](../key-vault/general/quick-create-portal.md) in the same subscription and resource group where you intend to deploy the Data Product resource.
114+
115+
# [Portal](#tab/azure-portal)
116+
117+
1. [Create an Azure Key Vault resource](../key-vault/general/quick-create-portal.md) in the same subscription and resource group that you set up in [Create a resource group](#create-a-resource-group).
35118
1. Provide your user account with the Key Vault Administrator role on the Azure Key Vault resource. This is done via the **Access Control (IAM)** tab on the Azure Key Vault resource.
36119
1. Navigate to the object and select **Keys**. Select **Generate/Import**.
37120
1. Enter a name for the key and select **Create**.
38121
1. Select the newly created key and select the current version of the key.
39122
1. Copy the Key Identifier URI to your clipboard to use when creating the Data Product.
40123

41-
#### Set up user-assigned managed identity
124+
# [Azure CLI](#tab/azure-cli)
125+
126+
<!-- CLI link is [Create an Azure Key Vault resource](../key-vault/general/quick-create-cli.md) in the same subscription and resource group where you intend to deploy the Data Product resource. -->
127+
128+
#### Create a key vault
129+
130+
Use the Azure CLI `az keyvault create` command to create a Key Vault in the resource group from the previous step. You must provide:
131+
132+
- A name for the key vault: A string of 3 to 24 characters that can contain only numbers (0-9), letters (a-z, A-Z), and hyphens (-). Each key vault must have a unique name.
133+
- The resource group that you created in [Create a resource group](#create-a-resource-group).
134+
- The region in which you created the resource group.
135+
136+
```azurecli-interactive
137+
az keyvault create --name "<KeyVaultName>" --resource-group "<ResourceGroup>" --location "<Region>"
138+
```
139+
140+
The output of this command shows properties of the newly created key vault. Take note of:
141+
142+
- Vault Name: The name you provided to the `--name` parameter you ran.
143+
- Vault URI: In the example, the URI is `https://<KeyVaultName>.vault.azure.net/`. Applications that use your vault through its REST API must use this URI.
144+
145+
At this point, your Azure account is the only one authorized to perform any operations on this new vault.
146+
147+
#### Assign roles for the key vault
148+
149+
Provide your user account with the Key Vault Administrator role on the Azure Key Vault resource.
150+
151+
```azurecli-interactive
152+
az role assignment create --role "Key Vault Administrator" --assignee <YourEmailAddress> --scope /subscriptions/<SubscriptionID>/resourcegroups/<ResourceGroup>/providers/Microsoft.KeyVault/vaults/<KeyVaultName>
153+
```
154+
155+
#### Create a key
156+
157+
```azurecli-interactive
158+
az keyvault key create --vault-name "<KeyVaultName>" -n <keyName> --protection software
159+
```
160+
161+
From the output screen, copy the `KeyID` and store it in your clipboard for later use.
162+
163+
---
164+
165+
<!-- PowerShell link is [Create an Azure Key Vault resource](../key-vault/general/quick-create-powershell.md) in the same subscription and resource group where you intend to deploy the Data Product resource. -->
166+
167+
### Set up a user-assigned managed identity
168+
169+
# [Portal](#tab/azure-portal)
42170

43171
1. [Create a user-assigned managed identity](../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md?pivots=identity-mi-methods-azp#create-a-user-assigned-managed-identity) using Microsoft Entra ID for CMK-based encryption. The Data Product also uses the user-assigned managed identity (UAMI) to interact with the Microsoft Purview account.
44172
1. Navigate to the Azure Key Vault resource that you created earlier and assign the UAMI with **Key Vault Administrator** role.
45173

174+
# [Azure CLI](#tab/azure-cli)
175+
176+
<!-- Managed identity link for the CLI: /entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azcli -->
177+
178+
#### Create a user-assigned managed identity
179+
180+
To create a user-assigned managed identity, your account needs the Managed Identity Contributor role assignment.
181+
182+
Use the `az identity create` command to create a user-assigned managed identity. The -g parameter specifies the resource group where to create the user-assigned managed identity. The -n parameter specifies its name. Replace the \<ResourceGroup\> and \<UserAssignedIdentityName\> parameter values with your own values.
183+
184+
> [!IMPORTANT]
185+
> When you create user-assigned managed identities, only alphanumeric characters (0-9, a-z, and A-Z) and the hyphen (-) are supported.
186+
187+
```azurecli-interactive
188+
az identity create -g <ResourceGroup> -n <UserAssignedIdentityName>
189+
```
190+
191+
Copy the `principalId` from the output screen and store it in your clipboard for later use.
46192

47-
## Create an Azure Operator Insights Data Product resource in the Azure portal
193+
#### Assign the user-assigned managed identity to the key vault
194+
195+
```azurecli-interactive
196+
az role assignment create --role "Key Vault Administrator" --assignee <principalId> --scope /subscriptions/<SubscriptionID>/resourcegroups/<ResourceGroup>/providers/Microsoft.KeyVault/vaults/<KeyVaultName>
197+
```
198+
199+
---
200+
201+
<!-- Managed identity link for PowerShell: /entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-powershell -->
202+
203+
## Create an Azure Operator Insights Data Product resource
48204

49205
You create the Azure Operator Insights Data Product resource.
50206

207+
# [Portal](#tab/azure-portal)
208+
51209
1. Sign in to the [Azure portal](https://portal.azure.com/).
52210
1. In the search bar, search for Operator Insights and select **Azure Operator Insights - Data Products**.
53211
1. On the Azure Operator Insights - Data Products page, select **Create**.
@@ -74,7 +232,33 @@ You create the Azure Operator Insights Data Product resource.
74232
1. Select **Review + create**.
75233
1. Select **Create**. Your Data Product instance is created in about 20-25 minutes. During this time, all the underlying components are provisioned. After this process completes, you can work with your data ingestion, explore sample dashboards and queries, and so on.
76234

77-
## Deploy Sample Insights
235+
# [Azure CLI](#tab/azure-cli)
236+
237+
To create an Azure Operator Insights Data Product with the minimum required parameters, use the following command:
238+
239+
```azurecli-interactive
240+
az network-analytics data-product create --name <DataProductName> --resource-group <ResourceGroup> --location <Region> --publisher Microsoft --product <ProductName> --major-version <ProductMajorVersion>
241+
```
242+
243+
Use the following values for \<ProductName\> and \<ProductMajorVersion>.
244+
245+
246+
|Date Product |\<ProductName\> |\<ProductMajorVersion>|
247+
|---------|---------|---------|
248+
|Quality of Experience - Affirmed MCC GIGW |`Quality of Experience - Affirmed MCC GIGW`|`1.0`|
249+
|Quality of Experience - Affirmed MCC PGW or GGSN |`Quality of Experience - Affirmed MCC PGW or GGSN`|`1.0`|
250+
|Monitoring - Affirmed MCC|`Monitoring - Affirmed MCC`|`0` or `1`|
251+
252+
253+
To create an Azure Operator Insights DataProduct with all parameters, use the following command:
254+
255+
```azurecli-interactive
256+
az network-analytics data-product create --name <DataProductName> --resource-group <ResourceGroup> --location <Region> --publisher Microsoft --product <ProductName> --major-version <ProductMajorVersion --owners <<xyz@email>> --customer-managed-key-encryption-enabled Enabled --key-encryption-enable Enabled --encryption-key '{"keyVaultUri":"<VaultURI>","keyName":"<KeyName>","keyVersion":"<KeyVersion>"}' --purview-account <PurviewAccount> --purview-collection <PurviewCollection> --identity '{"type":"userAssigned","userAssignedIdentities":{"/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<UserAssignedIdentityName>"}}' --tags '{"key1":"value1","key2":"value2"}'
257+
```
258+
259+
---
260+
261+
## Deploy sample insights
78262

79263
Once your Data Product instance is created, you can deploy a sample insights dashboard. This dashboard works with the sample data that came along with the Data Product instance.
80264

@@ -139,7 +323,16 @@ The consumption URL also allows you to write your own Kusto query to get insight
139323
140324
When you have finished exploring Azure Operator Insights Data Product, you should delete the resources you've created to avoid unnecessary Azure costs.
141325
326+
# [Portal](#tab/azure-portal)
327+
142328
1. On the **Home** page of the Azure portal, select **Resource groups**.
143329
1. Select the resource group for your Azure Operator Insights Data Product and verify that it contains the Azure Operator Insights Data Product instance.
144330
1. At the top of the Overview page for your resource group, select **Delete resource group**.
145331
1. Enter the resource group name to confirm the deletion, and select **Delete**.
332+
333+
# [Azure CLI](#tab/azure-cli)
334+
335+
```azurecli-interactive
336+
az group delete --name "ResourceGroup"
337+
```
338+
---
3.27 KB
Loading
86 KB
Loading

articles/operator-insights/purview-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can access your Purview account through the Azure portal by going to `https:
3131

3232
To begin to catalog a data product in this account, [create a collection](../purview/how-to-create-and-manage-collections.md) to hold the Data Product.
3333

34-
Provide the user-assigned managed identity (UAMI) for your Azure Operator Insights Data Product with necessary roles in the Microsoft Purview compliance portal. This UAMI was set up when the Data Product was created. For information on how to set up this UAMI, see [Set up user-assigned managed identity](data-product-create.md#set-up-user-assigned-managed-identity). At the desired collection, assign this UAMI to the **Collection admin**, **Data source admin**, and **Data curator** roles. Alternately, you can apply the UAMI at the root collection/account level. All collections would inherit these role assignments by default.
34+
Provide the user-assigned managed identity (UAMI) for your Azure Operator Insights Data Product with necessary roles in the Microsoft Purview compliance portal. This UAMI was set up when the Data Product was created. For information on how to set up this UAMI, see [Set up a user-assigned managed identity](data-product-create.md#set-up-a-user-assigned-managed-identity). At the desired collection, assign this UAMI to the **Collection admin**, **Data source admin**, and **Data curator** roles. Alternately, you can apply the UAMI at the root collection/account level. All collections would inherit these role assignments by default.
3535

3636
:::image type="content" source="media/purview-setup/data-product-role-assignments.png" alt-text="Screenshot of collections with Role assignment tab open and icon to add the UAMI to the collection admins role highlighted.":::
3737

0 commit comments

Comments
 (0)