Skip to content

Commit 30917b4

Browse files
authored
Merge pull request #176345 from yossi-y/master
Updating asynchronous operations
2 parents a7cc044 + cc94bc8 commit 30917b4

File tree

2 files changed

+35
-80
lines changed

2 files changed

+35
-80
lines changed

articles/azure-monitor/logs/customer-managed-keys.md

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -69,37 +69,6 @@ The following rules apply:
6969

7070
Customer-managed key configuration isn't supported in Azure portal currently and provisioning can be performed via [PowerShell](/powershell/module/az.operationalinsights/), [CLI](/cli/azure/monitor/log-analytics) or [REST](/rest/api/loganalytics/) requests.
7171

72-
### Asynchronous operations and status check
73-
74-
Some of the configuration steps run asynchronously because they can't be completed quickly. The `status` in response can be one of the followings: 'InProgress', 'Updating', 'Deleting', 'Succeeded or 'Failed' with error code.
75-
76-
# [Azure portal](#tab/portal)
77-
78-
N/A
79-
80-
# [Azure CLI](#tab/azure-cli)
81-
82-
N/A
83-
84-
# [PowerShell](#tab/powershell)
85-
86-
N/A
87-
88-
# [REST](#tab/rest)
89-
90-
When using REST, the response initially returns an HTTP status code 202 (Accepted) and header with *Azure-AsyncOperation* property:
91-
```json
92-
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/subscription-id/providers/Microsoft.OperationalInsights/locations/region-name/operationStatuses/operation-id?api-version=2021-06-01"
93-
```
94-
95-
You can check the status of the asynchronous operation by sending a GET request to the endpoint in *Azure-AsyncOperation* header:
96-
```rst
97-
GET https://management.azure.com/subscriptions/subscription-id/providers/microsoft.operationalInsights/locations/region-name/operationstatuses/operation-id?api-version=2021-06-01
98-
Authorization: Bearer <token>
99-
```
100-
101-
---
102-
10372
## Storing encryption key (KEK)
10473

10574
Create or use existing Azure Key Vault in the region that the cluster is planed, then generate or import a key to be used for logs encryption. The Azure Key Vault must be configured as recoverable to protect your key and the access to your data in Azure Monitor. You can verify this configuration under properties in your Key Vault, both *Soft delete* and *Purge protection* should be enabled.
@@ -113,7 +82,7 @@ These settings can be updated in Key Vault via CLI and PowerShell:
11382

11483
## Create cluster
11584

116-
Clusters support System-assigned managed identity and identity `type` property should be set to `SystemAssigned`. The identity is being generated automatically with the cluster creation and can be used later to grant storage access to your Key Vault for wrap and unwrap operations.
85+
Clusters uses managed identity for data encryption with your Key Vault. Configure identity `type` property to `SystemAssigned` when creating your cluster to allow access to your Key Vault for wrap and unwrap operations.
11786

11887
Identity settings in cluster for System-assigned managed identity
11988
```json
@@ -160,16 +129,24 @@ N/A
160129
# [Azure CLI](#tab/azure-cli)
161130

162131
```azurecli
163-
Set-AzContext -SubscriptionId "cluster-subscription-id"
132+
az account set --subscription "cluster-subscription-id"
133+
134+
az monitor log-analytics cluster update --no-wait --name "cluster-name" --resource-group "resource-group-name" --key-name "key-name" --key-vault-uri "key-uri" --key-version "key-version"
135+
136+
# Wait for job completion when `--no-wait` was used
137+
$clusterResourceId = az monitor log-analytics cluster list --resource-group "resource-group-name" --query "[?contains(name, "cluster-name")].[id]" --output tsv
138+
az resource wait --created --ids $clusterResourceId --include-response-body true
164139
165-
az monitor log-analytics cluster update --name "cluster-name" --resource-group "resource-group-name" --key-name "key-name" --key-vault-uri "key-uri" --key-version "key-version"
166140
```
167141
# [PowerShell](#tab/powershell)
168142

169143
```powershell
170144
Select-AzSubscription "cluster-subscription-id"
171145
172-
Update-AzOperationalInsightsCluster -ResourceGroupName "resource-group-name" -ClusterName "cluster-name" -KeyVaultUri "key-uri" -KeyName "key-name" -KeyVersion "key-version"
146+
Update-AzOperationalInsightsCluster -ResourceGroupName "resource-group-name" -ClusterName "cluster-name" -KeyVaultUri "key-uri" -KeyName "key-name" -KeyVersion "key-version" -AsJob
147+
148+
# Check when the job is done when `-AsJob` was used
149+
Get-Job -Command "New-AzOperationalInsightsCluster*" | Format-List -Property *
173150
```
174151

175152
# [REST](#tab/rest)
@@ -195,9 +172,7 @@ Content-type: application/json
195172

196173
**Response**
197174

198-
It takes the propagation of the key a while to complete. You can check the update state in two ways:
199-
1. Copy the Azure-AsyncOperation URL value from the response and follow the [asynchronous operations status check](#asynchronous-operations-and-status-check).
200-
2. Send a GET request on the cluster and look at the *KeyVaultProperties* properties. Your recently updated key should return in the response.
175+
It takes the propagation of the key a while to complete. You can check the update state by sending GET request on the cluster and look at the *KeyVaultProperties* properties. Your recently updated key should return in the response.
201176

202177
A response to GET request should look like this when the key update is complete:
203178
202 (Accepted) and header
@@ -298,7 +273,7 @@ N/A
298273
```azurecli
299274
$storageAccountId = '/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Storage/storageAccounts/<storage name>'
300275
301-
Set-AzContext -SubscriptionId "workspace-subscription-id"
276+
az account set --subscription "workspace-subscription-id"
302277
303278
az monitor log-analytics workspace linked-storage create --type Query --resource-group "resource-group-name" --workspace-name "workspace-name" --storage-accounts $storageAccountId
304279
```
@@ -348,7 +323,7 @@ N/A
348323
```azurecli
349324
$storageAccountId = '/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Storage/storageAccounts/<storage name>'
350325
351-
Set-AzContext -SubscriptionId "workspace-subscription-id"
326+
az account set --subscription "workspace-subscription-id"
352327
353328
az monitor log-analytics workspace linked-storage create --type ALerts --resource-group "resource-group-name" --workspace-name "workspace-name" --storage-accounts $storageAccountId
354329
```
@@ -458,9 +433,7 @@ Customer-Managed key is provided on dedicated cluster and these operations are r
458433

459434
- If you update your key version in Key Vault and don't update the new key identifier details in the cluster, the Log Analytics cluster will keep using your previous key and your data will become inaccessible. Update new key identifier details in the cluster to resume data ingestion and ability to query data.
460435

461-
- Some operations are long and can take a while to complete -- these are cluster create, cluster key update and cluster delete. You can check the operation status in two ways:
462-
1. when using REST, copy the Azure-AsyncOperation URL value from the response and follow the [asynchronous operations status check](#asynchronous-operations-and-status-check).
463-
2. Send GET request to cluster or workspace and observe the response. For example, unlinked workspace won't have the *clusterResourceId* under *features*.
436+
- Some operations are long and can take a while to complete -- these are cluster create, cluster key update and cluster delete. You can check the operation status by sending GET request to cluster or workspace and observe the response. For example, unlinked workspace won't have the *clusterResourceId* under *features*.
464437

465438
- Error messages
466439

articles/azure-monitor/logs/logs-dedicated-clusters.md

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,6 @@ If your workspace is using legacy Per Node pricing tier, when it is linked to a
4848

4949
Complete details are billing for Log Analytics dedicated clusters are available [here](./manage-cost-storage.md#log-analytics-dedicated-clusters).
5050

51-
## Asynchronous operations and status check
52-
53-
Some of the configuration steps run asynchronously because they can't be completed quickly. The status in response contains can be one of the following values: *InProgress*, *Updating*, *Deleting*, *Succeeded*, or *Failed* including the error code. When using REST, the response initially returns an HTTP status code 202 (Accepted) and header with Azure-AsyncOperation property:
54-
55-
```JSON
56-
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/subscription-id/providers/Microsoft.OperationalInsights/locations/region-name/operationStatuses/operation-id?api-version=2021-06-01"
57-
```
58-
59-
You can check the status of the asynchronous operation by sending a GET request to the Azure-AsyncOperation header value:
60-
61-
```rest
62-
GET https://management.azure.com/subscriptions/subscription-id/providers/microsoft.operationalInsights/locations/region-name/operationstatuses/operation-id?api-version=2021-06-01
63-
Authorization: Bearer <token>
64-
```
65-
6651
## Create a dedicated cluster
6752

6853
You must specify the following properties when you create a new dedicated cluster:
@@ -86,12 +71,13 @@ You can have up to 2 active clusters per subscription per region. If the cluster
8671
8772
**CLI**
8873
```azurecli
89-
Set-AzContext -SubscriptionId "cluster-subscription-id"
74+
az account set --subscription "cluster-subscription-id"
9075
9176
az monitor log-analytics cluster create --no-wait --resource-group "resource-group-name" --name "cluster-name" --location "region-name" --sku-capacity "daily-ingestion-gigabyte"
9277
93-
# Wait for job completion
94-
az resource wait --created --ids /subscriptions/subscription-id/resourceGroups/resource-group-name/providers/Microsoft.operationalinsights/clusters/cluster-name --include-response-body true
78+
# Wait for job completion when `--no-wait` was used
79+
$clusterResourceId = az monitor log-analytics cluster list --resource-group "resource-group-name" --query "[?contains(name, "cluster-name")].[id]" --output tsv
80+
az resource wait --created --ids $clusterResourceId --include-response-body true
9581
```
9682

9783
**PowerShell**
@@ -101,7 +87,7 @@ Select-AzSubscription "cluster-subscription-id"
10187
10288
New-AzOperationalInsightsCluster -ResourceGroupName "resource-group-name" -ClusterName "cluster-name" -Location "region-name" -SkuCapacity "daily-ingestion-gigabyte" -AsJob
10389
104-
# Check when the job is done
90+
# Check when the job is done when `-AsJob` was used
10591
Get-Job -Command "New-AzOperationalInsightsCluster*" | Format-List -Property *
10692
```
10793

@@ -140,7 +126,7 @@ The provisioning of the Log Analytics cluster takes a while to complete. Use one
140126
**CLI**
141127

142128
```azurecli
143-
Set-AzContext -SubscriptionId "cluster-subscription-id"
129+
az account set --subscription "cluster-subscription-id"
144130
145131
az monitor log-analytics cluster show --resource-group "resource-group-name" --name "cluster-name"
146132
```
@@ -225,15 +211,16 @@ Use the following commands to link a workspace to a cluster:
225211
**CLI**
226212
```azurecli
227213
# Find cluster resource ID
228-
Set-AzContext -SubscriptionId "cluster-subscription-id"
214+
az account set --subscription "cluster-subscription-id"
229215
$clusterResourceId = az monitor log-analytics cluster list --resource-group "resource-group-name" --query "[?contains(name, "cluster-name")].[id]" --output tsv
230216
231217
# Link workspace
232-
Set-AzContext -SubscriptionId "workspace-subscription-id"
218+
az account set --subscription "workspace-subscription-id"
233219
az monitor log-analytics workspace linked-service create --no-wait --name cluster --resource-group "resource-group-name" --workspace-name "workspace-name" --write-access-resource-id $clusterResourceId
234220
235-
# Wait for job completion
236-
az resource wait --created --ids /subscriptions/subscription-id/resourceGroups/resource-group-name/providers/Microsoft.operationalinsights/clusters/cluster-name --include-response-body true
221+
# Wait for job completion when `--no-wait` was used
222+
$workspaceResourceId = az monitor log-analytics workspace list --resource-group "resource-group-name" --query "[?contains(name, "workspace-name")].[id]" --output tsv
223+
az resource wait --deleted --ids $workspaceResourceId --include-response-body true
237224
```
238225

239226
**PowerShell**
@@ -279,14 +266,11 @@ Content-type: application/json
279266

280267
### Check workspace link status
281268

282-
When a cluster is configured with customer-managed keys, data ingested to the workspaces after the link operation completion is stored encrypted with your managed key. The workspace link operation can take up to 90 minutes to complete and you can check the state in two ways:
283-
284-
- Copy the Azure-AsyncOperation URL value from the response and follow the asynchronous operations status check.
285-
- Perform Get operation on the workspace and observe if *clusterResourceId* property is present in the response under *features*.
269+
When a cluster is configured with customer-managed keys, data ingested to the workspaces after the link operation completion is stored encrypted with your managed key. The workspace link operation can take up to 90 minutes to complete and you can check the state by sending Get request to workspace and observe if *clusterResourceId* property is present in the response under *features*.
286270

287271
**CLI**
288272
```azurecli
289-
Set-AzContext -SubscriptionId "workspace-subscription-id"
273+
az account set --subscription "workspace-subscription-id"
290274
291275
az monitor log-analytics workspace show --resource-group "resource-group-name" --workspace-name "workspace-name"
292276
```
@@ -365,7 +349,7 @@ After you create your cluster resource and it is fully provisioned, you can edit
365349
**CLI**
366350

367351
```azurecli
368-
Set-AzContext -SubscriptionId "cluster-subscription-id"
352+
az account set --subscription "cluster-subscription-id"
369353
370354
az monitor log-analytics cluster list --resource-group "resource-group-name"
371355
```
@@ -433,7 +417,7 @@ Authorization: Bearer <token>
433417
**CLI**
434418

435419
```azurecli
436-
Set-AzContext -SubscriptionId "cluster-subscription-id"
420+
az account set --subscription "cluster-subscription-id"
437421
438422
az monitor log-analytics cluster list
439423
```
@@ -468,7 +452,7 @@ When the data volume to your linked workspaces change over time and you want to
468452
**CLI**
469453

470454
```azurecli
471-
Set-AzContext -SubscriptionId "cluster-subscription-id"
455+
az account set --subscription "cluster-subscription-id"
472456
473457
az monitor log-analytics cluster update --resource-group "resource-group-name" --name "cluster-name" --sku-capacity 500
474458
```
@@ -536,7 +520,7 @@ Use the following commands to unlink a workspace from cluster:
536520
**CLI**
537521

538522
```azurecli
539-
Set-AzContext -SubscriptionId "workspace-subscription-id"
523+
az account set --subscription "workspace-subscription-id"
540524
541525
az monitor log-analytics workspace linked-service delete --resource-group "resource-group-name" --workspace-name "workspace-name" --name cluster
542526
```
@@ -570,7 +554,7 @@ Use the following commands to delete a cluster:
570554

571555
**CLI**
572556
```azurecli
573-
Set-AzContext -SubscriptionId "cluster-subscription-id"
557+
az account set --subscription "cluster-subscription-id"
574558
575559
az monitor log-analytics cluster delete --resource-group "resource-group-name" --name $clusterName
576560
```
@@ -626,9 +610,7 @@ Authorization: Bearer <token>
626610

627611
- If you update your cluster while the cluster is at provisioning or updating state, the update will fail.
628612

629-
- Some operations are long and can take a while to complete. These are *cluster create*, *cluster key update* and *cluster delete*. You can check the operation status in two ways:
630-
- When using REST, copy the Azure-AsyncOperation URL value from the response and follow the [asynchronous operations status check](#asynchronous-operations-and-status-check).
631-
- Send GET request to cluster or workspace and observe the response. For example, unlinked workspace won't have the *clusterResourceId* under *features*.
613+
- Some operations are long and can take a while to complete. These are *cluster create*, *cluster key update* and *cluster delete*. You can check the operation status by sending GET request to cluster or workspace and observe the response. For example, unlinked workspace won't have the *clusterResourceId* under *features*.
632614

633615
- Workspace link to cluster will fail if it is linked to another cluster.
634616

0 commit comments

Comments
 (0)