Skip to content

Commit 8a90d1a

Browse files
committed
Environtment variable info
1 parent d63499e commit 8a90d1a

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

articles/azure-monitor/app/azure-ad-authentication.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,38 @@ The following example shows how to configure the Java agent to use a service pri
200200

201201
:::image type="content" source="media/azure-ad-authentication/client-secret-cs.png" alt-text="Screenshot that shows the Client secrets section with the client secret." lightbox="media/azure-ad-authentication/client-secret-cs.png":::
202202

203+
#### Environment variable configuration
204+
205+
The `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable lets Application Insights authenticate to Azure AD and send telemetry.
206+
207+
- For system-assigned identity:
208+
209+
| App setting | Value |
210+
| -------------- |--------- |
211+
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD` |
212+
213+
- For user-assigned identity:
214+
215+
| App setting | Value |
216+
| ------------- | -------- |
217+
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD;ClientId={Client id of the User-Assigned Identity}` |
218+
219+
Set the `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable using this string.
220+
221+
**In Unix/Linux:**
222+
223+
```shell
224+
export APPLICATIONINSIGHTS_AUTHENTICATION_STRING="Authorization=AAD"
225+
```
226+
227+
**In Windows:**
228+
229+
```shell
230+
set APPLICATIONINSIGHTS_AUTHENTICATION_STRING="Authorization=AAD"
231+
```
232+
233+
After setting it, restart your application. It now sends telemetry to Application Insights using Azure AD authentication.
234+
203235
### [Python](#tab/python)
204236

205237
> [!NOTE]
@@ -414,30 +446,6 @@ _InstrumentationKey={profile.InstrumentationKey};IngestionEndpoint={ingestionEnd
414446

415447
The audience parameter, AADAudience, may vary depending on your specific environment.
416448

417-
### Environment variable configuration
418-
419-
The `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable specifies the Azure AD authentication string for Azure Application Insights. It lets Application Insights authenticate to Azure AD and send telemetry.
420-
421-
Example connection string with Azure AD authentication:
422-
423-
`InstrumentationKey=00000000-0000-0000-0000-000000000000;AuthenticationType=AzureAD;`
424-
425-
Set the `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable using this string.
426-
427-
**In Unix/Linux:**
428-
429-
```shell
430-
export APPLICATIONINSIGHTS_AUTHENTICATION_STRING="InstrumentationKey=00000000-0000-0000-0000-000000000000;AuthenticationType=AzureAD;"
431-
```
432-
433-
**In Windows:**
434-
435-
```shell
436-
set APPLICATIONINSIGHTS_AUTHENTICATION_STRING="InstrumentationKey=00000000-0000-0000-0000-000000000000;AuthenticationType=AzureAD;"
437-
```
438-
439-
After setting it, restart your application. It now sends telemetry to Application Insights using Azure AD authentication.
440-
441449
## Troubleshooting
442450

443451
This section provides distinct troubleshooting scenarios and steps that you can take to resolve an issue before you raise a support ticket.

0 commit comments

Comments
 (0)