Skip to content

Commit 6038476

Browse files
Merge pull request #268455 from bwren/docs-editor/data-collection-rule-edit-1709849585
Update data-collection-rule-edit.md
2 parents cc3ab14 + 27e053a commit 6038476

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ In order to update DCR, we are going to retrieve its content and save it as a fi
4949
```PowerShell
5050
$ResourceId = "<ResourceId>" # Resource ID of the DCR to edit
5151
$FilePath = "<FilePath>" # Store DCR content in this file
52-
$DCR = Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2021-09-01-preview") -Method GET
52+
$DCR = Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2022-06-01") -Method GET
5353
$DCR.Content | ConvertFrom-Json | ConvertTo-Json -Depth 20 | Out-File -FilePath $FilePath
5454
```
5555
## Edit DCR
@@ -80,7 +80,7 @@ Our final step is to update DCR back in the system. This is accomplished by “P
8080
$ResourceId = "<ResourceId>" # Resource ID of the DCR to edit
8181
$FilePath = "<FilePath>" # Store DCR content in this file
8282
$DCRContent = Get-Content $FilePath -Raw
83-
Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2021-09-01-preview") -Method PUT -Payload $DCRContent
83+
Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2022-06-01") -Method PUT -Payload $DCRContent
8484
```
8585
3. Upon successful call, you should get the response with status code “200”, indicating that your DCR is now updated.
8686
4. You can now navigate to your DCR and examine its content on the portal via “JSON View” function, or you could repeat the first part of the tutorial to retrieve DCR content into a file.
@@ -93,7 +93,7 @@ param ([Parameter(Mandatory=$true)] $ResourceId)
9393
9494
# get DCR content and put into a file
9595
$FilePath = "temp.dcr"
96-
$DCR = Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2021-09-01-preview") -Method GET
96+
$DCR = Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2022-06-01") -Method GET
9797
$DCR.Content | ConvertFrom-Json | ConvertTo-Json -Depth 20 | Out-File $FilePath
9898
9999
# Open DCR in code editor
@@ -105,7 +105,7 @@ if ("Y" -eq $Output.toupper())
105105
{
106106
#write DCR content back from the file
107107
$DCRContent = Get-Content $FilePath -Raw
108-
Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2021-09-01-preview") -Method PUT -Payload $DCRContent
108+
Invoke-AzRestMethod -Path ("$ResourceId"+"?api-version=2022-06-01") -Method PUT -Payload $DCRContent
109109
}
110110
111111
#Delete temporary file

0 commit comments

Comments
 (0)