Skip to content

Commit 8178404

Browse files
committed
Learn Editor: Update data-collection-rule-create-edit.md
1 parent 2697c57 commit 8178404

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

articles/azure-monitor/essentials/data-collection-rule-create-edit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ Use the [DCR create API](/rest/api/monitor/data-collection-rules/create) to crea
6363
$ResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.Insights/dataCollectionRules/my-dcr"
6464
$FilePath = ".\my-dcr.json"
6565
$DCRContent = Get-Content $FilePath -Raw
66-
Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2021-09-01-preview") -Method PUT -Payload $DCRContent
66+
Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2022-06-01") -Method PUT -Payload $DCRContent
6767
```
6868

6969

7070
```azurecli
7171
ResourceId="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/Microsoft.Insights/dataCollectionRules/my-dcr"
7272
FilePath="my-dcr.json"
73-
az rest --method put --url $ResourceId"?api-version=2021-09-01-preview" --body @$FilePath
73+
az rest --method put --url $ResourceId"?api-version=2022-06-01" --body @$FilePath
7474
```
7575

7676

@@ -126,7 +126,7 @@ If you need to retrieve the JSON for an existing DCR, you can copy it from the *
126126
```powershell
127127
$ResourceId = "<ResourceId>" # Resource ID of the DCR to edit
128128
$FilePath = "<FilePath>" # Store DCR content in this file
129-
$DCR = Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2021-09-01-preview") -Method GET
129+
$DCR = Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2022-06-01") -Method GET
130130
$DCR.Content | ConvertFrom-Json | ConvertTo-Json -Depth 20 | Out-File -FilePath $FilePath
131131
```
132132

0 commit comments

Comments
 (0)