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-code.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,19 +106,20 @@ The following PowerShell code sends data to the endpoint by using HTTP REST fund
106
106
The following sample code uses the [Azure Monitor Ingestion client library for Python](/python/api/overview/azure/monitor-ingestion-readme).
107
107
108
108
109
-
1. Use [pip](https://pypi.org/project/pip/) to install the Azure Monitor Ingestion client library for Python and the Azure Identity library, which is required for the authentication used in this sample.
109
+
1. Use [pip](https://pypi.org/project/pip/) to install the Azure Monitor Ingestion and Azure Identity client libraries for Python. The Azure Identity library is required for the authentication used in this sample.
110
+
110
111
```bash
111
112
pip install azure-monitor-ingestion
112
113
pip install azure-identity
113
114
```
114
115
115
-
3. Create the following environment variables with values for your Azure AD application. These values are used by `DefaultAzureCredential` in the Azure Identity library.
116
+
2. Create the following environment variables with values for your Azure AD application. These values are used by `DefaultAzureCredential` in the Azure Identity library.
116
117
117
118
- AZURE_TENANT_ID
118
119
- AZURE_CLIENT_ID
119
120
- AZURE_CLIENT_SECRET
120
121
121
-
2. Replace the variables in the following sample code with values from your DCE, and DCR. You might also want to replace the sample data in the **Step 2** section with your own.
122
+
3. Replace the variables in the following sample code with values from your DCE and DCR. You might also want to replace the sample data in the **Step 2** section with your own.
122
123
123
124
124
125
```python
@@ -174,20 +175,21 @@ The following sample code uses the [Azure Monitor Ingestion client library for P
174
175
The following sample code uses the [Azure Monitor Ingestion client library for JavaScript](/javascript/api/overview/azure/monitor-ingestion-readme).
175
176
176
177
177
-
1. Use [npm](https://www.npmjs.com/) to install the Azure Monitor Ingestion client library for JavaScript and the Azure Identity library which is required for the authentication used in this sample.
178
+
1. Use [npm](https://www.npmjs.com/) to install the Azure Monitor Ingestion and Azure Identity client libraries for JavaScript. The Azure Identity library is required for the authentication used in this sample.
179
+
178
180
179
181
```bash
180
182
npm install --save @azure/monitor-ingestion
181
183
npm install --save @azure/identity
182
184
```
183
185
184
-
3. Create the following environment variables with values for your Azure AD application. These values are used by `DefaultAzureCredential` in the Azure Identity library.
186
+
2. Create the following environment variables with values for your Azure AD application. These values are used by `DefaultAzureCredential` in the Azure Identity library.
185
187
186
188
- AZURE_TENANT_ID
187
189
- AZURE_CLIENT_ID
188
190
- AZURE_CLIENT_SECRET
189
191
190
-
3. Replace the variables in the following sample code with values from your DCE, and DCR. You might also want to replace the sample data with your own.
192
+
3. Replace the variables in the following sample code with values from your DCE and DCR. You might also want to replace the sample data with your own.
@@ -248,13 +250,13 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
248
250
});
249
251
```
250
252
251
-
3. Execute the code, and the data should arrive in your Log Analytics workspace within a few minutes.
253
+
4. Execute the code, and the data should arrive in your Log Analytics workspace within a few minutes.
252
254
253
255
## [Java](#tab/java)
254
256
The following sample code uses the [Azure Monitor Ingestion client library for Java](/java/api/overview/azure/monitor-ingestion-readme).
255
257
256
258
257
-
1. Include the Logs ingestion package and the `azure-identity` package from the [Azure Identity library](https://github.com/Azure/azure-sdk-for-java/tree/azure-monitor-ingestion_1.0.1/sdk/identity/azure-identity) which is used for the authentication used in this sample.
259
+
1. Include the Logs ingestion package and the `azure-identity` package from the [Azure Identity library](https://github.com/Azure/azure-sdk-for-java/tree/azure-monitor-ingestion_1.0.1/sdk/identity/azure-identity). The Azure Identity library is required for the authentication used in this sample.
258
260
259
261
> [!NOTE]
260
262
> See the Maven repositories for [Microsoft Azure Client Library For Identity](https://mvnrepository.com/artifact/com.azure/azure-identity) and [Microsoft Azure SDK For Azure Monitor Data Ingestion](https://mvnrepository.com/artifact/com.azure/azure-monitor-ingestion) for the latest versions.
@@ -263,12 +265,11 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
263
265
<dependency>
264
266
<groupId>com.azure</groupId>
265
267
<artifactId>azure-monitor-ingestion</artifactId>
266
-
<version>1.0.0</version>
267
-
</dependency>
268
+
<version>{get-latest-version}</version>
268
269
<dependency>
269
270
<groupId>com.azure</groupId>
270
271
<artifactId>azure-identity</artifactId>
271
-
<version>1.8.0</version>
272
+
<version>{get-latest-version}</version>
272
273
</dependency>
273
274
```
274
275
@@ -279,7 +280,7 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
279
280
- AZURE_CLIENT_ID
280
281
- AZURE_CLIENT_SECRET
281
282
282
-
4. Replace the variables in the following sample code with values from your DCE, and DCR. You may also want to replace the sample data with your own.
283
+
4. Replace the variables in the following sample code with values from your DCE and DCR. You may also want to replace the sample data with your own.
283
284
284
285
```java
285
286
public static void main(String[] args) {
@@ -333,7 +334,7 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
333
334
334
335
The following script uses the [Azure Monitor Ingestion client library for .NET](/dotnet/api/overview/azure/Monitor.Ingestion-readme).
335
336
336
-
1. Install the Azure Monitor Ingestion client library and the Azure Identity library which is required for the authentication used in this sample.
337
+
1. Install the Azure Monitor Ingestion client library and the Azure Identity library. The Azure Identity library is required for the authentication used in this sample.
337
338
338
339
```dotnetcli
339
340
dotnet add package Azure.Identity
@@ -346,7 +347,7 @@ The following script uses the [Azure Monitor Ingestion client library for .NET](
346
347
- AZURE_CLIENT_ID
347
348
- AZURE_CLIENT_SECRET
348
349
349
-
2. Replace the variables in the following sample code with values from your DCE, and DCR. You may also want to replace the sample data with your own.
350
+
2. Replace the variables in the following sample code with values from your DCE and DCR. You may also want to replace the sample data with your own.
0 commit comments