|
2 | 2 | title: 'Tutorial: Send data to Azure Monitor Logs using REST API (Resource Manager templates)'
|
3 | 3 | description: Tutorial on how to send data to a Log Analytics workspace in Azure Monitor by using the REST API Azure Resource Manager template version.
|
4 | 4 | ms.topic: tutorial
|
5 |
| -ms.date: 07/15/2022 |
| 5 | +ms.date: 02/01/2023 |
6 | 6 | ---
|
7 | 7 |
|
8 | 8 | # Tutorial: Send data to Azure Monitor Logs using REST API (Resource Manager templates)
|
@@ -305,7 +305,7 @@ The [DCR](../essentials/data-collection-rule-overview.md) defines the schema of
|
305 | 305 |
|
306 | 306 | :::image type="content" source="media/tutorial-workspace-transformations-api/data-collection-rule-details.png" lightbox="media/tutorial-workspace-transformations-api/data-collection-rule-details.png" alt-text="Screenshot that shows DCR details.":::
|
307 | 307 |
|
308 |
| -1. Copy the **Resource ID** for the DCR. You'll use it in the next step. |
| 308 | +1. Copy the **Immutable ID** for the DCR. You'll use it in a later step when you send sample data using the API. |
309 | 309 |
|
310 | 310 | :::image type="content" source="media/tutorial-workspace-transformations-api/data-collection-rule-json-view.png" lightbox="media/tutorial-workspace-transformations-api/data-collection-rule-json-view.png" alt-text="Screenshot that shows DCR JSON view.":::
|
311 | 311 |
|
@@ -357,6 +357,7 @@ The following PowerShell code sends data to the endpoint by using HTTP REST fund
|
357 | 357 | #information needed to send data to the DCR endpoint
|
358 | 358 | $dcrImmutableId = "dcr-000000000000000"; #the immutableId property of the DCR object
|
359 | 359 | $dceEndpoint = "https://my-dcr-name.westus2-1.ingest.monitor.azure.com"; #the endpoint property of the Data Collection Endpoint object
|
| 360 | + $streamName = "Custom-MyTableRawData"; #name of the stream in the DCR that represents the destination table |
360 | 361 |
|
361 | 362 | ##################
|
362 | 363 | ### Step 1: Obtain a bearer token used later to authenticate against the DCE.
|
@@ -404,7 +405,7 @@ The following PowerShell code sends data to the endpoint by using HTTP REST fund
|
404 | 405 | ##################
|
405 | 406 | $body = $staticData;
|
406 | 407 | $headers = @{"Authorization"="Bearer $bearerToken";"Content-Type"="application/json"};
|
407 |
| - $uri = "$dceEndpoint/dataCollectionRules/$dcrImmutableId/streams/Custom-MyTableRawData?api-version=2021-11-01-preview" |
| 408 | + $uri = "$dceEndpoint/dataCollectionRules/$dcrImmutableId/streams/$streamName?api-version=2021-11-01-preview" |
408 | 409 |
|
409 | 410 | $uploadResponse = Invoke-RestMethod -Uri $uri -Method "Post" -Body $body -Headers $headers
|
410 | 411 | ```
|
|
0 commit comments