File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
articles/azure-monitor/app Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -224,12 +224,19 @@ You can use the `CreateReleaseAnnotation` PowerShell script to create annotation
224
224
$annotation = ConvertTo-Json $annotation -Compress
225
225
$annotation = Convert-UnicodeToEscapeHex -JsonString $annotation
226
226
227
- $body = $annotation -replace '(\\+)"', '$1$1"' -replace "`"", "`"`""
228
-
229
- az rest --method put --uri "$($aiResourceId)/Annotations?api-version=2015-05-01" --body "$($body) "
230
-
231
- # Use the following command for Linux Azure DevOps Hosts or other PowerShell scenarios
232
- # Invoke-AzRestMethod -Path "$aiResourceId/Annotations?api-version=2015-05-01" -Method PUT -Payload $body
227
+ $accessToken = (az account get-access-token | ConvertFrom-Json).accessToken
228
+ $headers = @{
229
+ "Authorization" = "Bearer $accessToken"
230
+ "Accept" = "application/json"
231
+ "Content-Type" = "application/json"
232
+ }
233
+ $params = @{
234
+ Headers = $headers
235
+ Method = "Put"
236
+ Uri = "https://management.azure.com$($aiResourceId)/Annotations?api-version=2015-05-01"
237
+ Body = $annotation
238
+ }
239
+ Invoke-RestMethod @params
233
240
```
234
241
235
242
> [!NOTE]
You can’t perform that action at this time.
0 commit comments