You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/logs/tutorial-logs-ingestion-portal.md
+33-14Lines changed: 33 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'Tutorial: Send data to Azure Monitor Logs with Logs ingestion API (Azure portal)'
3
3
description: Tutorial on how sending data to a Log Analytics workspace in Azure Monitor using the Logs ingestion API. Supporting components configured using the Azure portal.
4
4
ms.topic: tutorial
5
-
ms.date: 03/12/2024
5
+
ms.date: 09/14/2023
6
6
author: bwren
7
7
ms.author: bwren
8
8
@@ -20,12 +20,11 @@ The [Logs Ingestion API](logs-ingestion-api-overview.md) in Azure Monitor allows
20
20
The steps required to configure the Logs ingestion API are as follows:
21
21
22
22
1.[Create a Microsoft Entra application](#create-azure-ad-application) to authenticate against the API.
23
+
3.[Create a data collection endpoint (DCE)](#create-data-collection-endpoint) to receive data.
23
24
2.[Create a custom table in a Log Analytics workspace](#create-new-table-in-log-analytics-workspace). This is the table you'll be sending data to. As part of this process, you will create a data collection rule (DCR) to direct the data to the target table.
24
25
5.[Give the AD application access to the DCR](#assign-permissions-to-the-dcr).
25
26
6.[Use sample code to send data to using the Logs ingestion API](#send-sample-data).
26
27
27
-
> [!NOTE]
28
-
> This article previously included a step to create a data collection endpoint (DCE). This is no longer required since [DCRs now include their own endpoint](../essentials/data-collection-endpoint-overview.md). A DCE is only required with Logs ingestion API if private link is used.
29
28
30
29
## Prerequisites
31
30
To complete this tutorial, you need:
@@ -64,6 +63,26 @@ Start by registering a Microsoft Entra application to authenticate against the A
64
63
65
64
:::image type="content" source="media/tutorial-logs-ingestion-portal/new-app-secret-value.png" lightbox="media/tutorial-logs-ingestion-portal/new-app-secret-value.png" alt-text="Screenshot that shows the secret value for the new app.":::
66
65
66
+
## Create data collection endpoint
67
+
68
+
> [!NOTE]
69
+
> A DCE is no longer required in most cases since you can use the endpoint of the DCR. The Azure portal though has not yet been updated to reflect this change and currently requires a DCE when you create the custom log. If you use [other methods to create the custom table and DCR](./tutorial-logs-ingestion-api.md), you can use the DCR endpoint instead of a DCE.
70
+
71
+
72
+
A [data collection endpoint](../essentials/data-collection-endpoint-overview.md) is required to accept the data from the script. After you configure the DCE and link it to a DCR, you can send data over HTTP from your application. The DCE needs to be in the same region as the Log Analytics workspace where the data will be sent or the data collection rule being used.
73
+
74
+
1. To create a new DCE, go to the **Monitor** menu in the Azure portal. Select **Data Collection Endpoints** and then select **Create**.
75
+
76
+
:::image type="content" source="media/tutorial-logs-ingestion-portal/new-data-collection-endpoint.png" lightbox="media/tutorial-logs-ingestion-portal/new-data-collection-endpoint.png" alt-text="Screenshot that shows new DCE.":::
77
+
78
+
1. Provide a name for the DCE and ensure that it's in the same region as your workspace. Select **Create** to create the DCE.
79
+
80
+
:::image type="content" source="media/tutorial-logs-ingestion-portal/data-collection-endpoint-details.png" lightbox="media/tutorial-logs-ingestion-portal/data-collection-endpoint-details.png" alt-text="Screenshot that shows DCE details.":::
81
+
82
+
1. After the DCE is created, select it so that you can view its properties. Note the **Logs ingestion** URI because you'll need it in a later step.
83
+
84
+
:::image type="content" source="media/tutorial-logs-ingestion-portal/data-collection-endpoint-uri.png" lightbox="media/tutorial-logs-ingestion-portal/data-collection-endpoint-uri.png" alt-text="Screenshot that shows DCE URI.":::
85
+
67
86
68
87
## Create new table in Log Analytics workspace
69
88
Before you can send data to the workspace, you need to create the custom table where the data will be sent.
@@ -162,18 +181,18 @@ Instead of directly configuring the schema of the table, you can upload a file w
162
181
:::image type="content" source="media/tutorial-logs-ingestion-portal/custom-log-create.png" lightbox="media/tutorial-logs-ingestion-portal/custom-log-create.png" alt-text="Screenshot that shows custom log create.":::
163
182
164
183
## Collect information from the DCR
165
-
With the DCR created, you need to collect its ID and endpoint, which are needed in the API call.
184
+
With the DCR created, you need to collect its ID, which is needed in the API call.
166
185
167
186
1. On the **Monitor** menu in the Azure portal, select **Data collection rules** and select the DCR you created. From **Overview** for the DCR, select **JSON View**.
168
187
169
188
:::image type="content" source="media/tutorial-logs-ingestion-portal/data-collection-rule-json-view.png" lightbox="media/tutorial-logs-ingestion-portal/data-collection-rule-json-view.png" alt-text="Screenshot that shows the DCR JSON view.":::
170
189
171
-
1. Copy the **immutableId** and **logsIngestion** values.
190
+
1. Copy the **immutableId** value.
172
191
173
192
:::image type="content" source="media/tutorial-logs-ingestion-portal/data-collection-rule-immutable-id.png" lightbox="media/tutorial-logs-ingestion-portal/data-collection-rule-immutable-id.png" alt-text="Screenshot that shows collecting the immutable ID from the JSON view.":::
174
193
175
194
## Assign permissions to the DCR
176
-
The final step is to give the application permission to use the DCR. Any application that uses the correct application ID and application key can now send data to Azure Monitor using the DCR.
195
+
The final step is to give the application permission to use the DCR. Any application that uses the correct application ID and application key can now send data to the new DCE and DCR.
177
196
178
197
1. Select **Access Control (IAM)** for the DCR and then select **Add role assignment**.
179
198
@@ -207,7 +226,7 @@ The following PowerShell script generates sample data to configure the custom ta
207
226
1. Update the values of `$tenantId`, `$appId`, and `$appSecret` with the values you noted for **Directory (tenant) ID**, **Application (client) ID**, and secret **Value**. Then save it with the file name *LogGenerator.ps1*.
@@ -314,10 +333,10 @@ The following PowerShell script generates sample data to configure the custom ta
314
333
## Send sample data
315
334
Allow at least 30 minutes for the configuration to take effect. You might also experience increased latency for the first few entries, but this activity should normalize.
316
335
317
-
1. Run the following command providing the values that you collected for your DCR. The script will start ingesting data by placing calls to the API at the pace of approximately one record per second.
336
+
1. Run the following command providing the values that you collected for your DCR and DCE. The script will start ingesting data by placing calls to the API at the pace of approximately one record per second.
0 commit comments