Skip to content

Commit 6be239b

Browse files
committed
Removing client secret information
1 parent e4f65b1 commit 6be239b

File tree

3 files changed

+0
-75
lines changed

3 files changed

+0
-75
lines changed

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

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ The following SDKs and features are unsupported for use with Microsoft Entra aut
3737
Microsoft Entra authentication is only available for Application Insights Java Agent greater than or equal to 3.2.0.
3838
- [ApplicationInsights JavaScript web SDK](javascript.md).
3939
- [Application Insights OpenCensus Python SDK](/previous-versions/azure/azure-monitor/app/opencensus-python) with Python version 3.4 and 3.5.
40-
- [Certificate/secret-based Microsoft Entra ID](../../active-directory/authentication/active-directory-certificate-based-authentication-get-started.md) isn't recommended for production. Use managed identities instead.
4140
- On-by-default [autoinstrumentation/codeless monitoring](codeless-overview.md) (for languages) for Azure App Service, Azure Virtual Machines/Azure Virtual Machine Scale Sets, and Azure Functions.
4241
- [Profiler](profiler-overview.md).
4342

@@ -75,8 +74,6 @@ Application Insights .NET SDK supports the credential classes provided by [Azure
7574
- We recommend `ManagedIdentityCredential` for system-assigned and user-assigned managed identities.
7675
- For system-assigned, use the default constructor without parameters.
7776
- For user-assigned, provide the client ID to the constructor.
78-
- We recommend `ClientSecretCredential` for service principals.
79-
- Provide the tenant ID, client ID, and client secret to the constructor.
8077

8178
The following example shows how to manually create and configure `TelemetryConfiguration` by using .NET:
8279

@@ -119,22 +116,6 @@ appInsights.defaultClient.config.aadTokenCredential = credential;
119116

120117
```
121118

122-
#### ClientSecretCredential
123-
124-
```javascript
125-
import appInsights from "applicationinsights";
126-
import { ClientSecretCredential } from "@azure/identity";
127-
128-
const credential = new ClientSecretCredential(
129-
"<YOUR_TENANT_ID>",
130-
"<YOUR_CLIENT_ID>",
131-
"<YOUR_CLIENT_SECRET>"
132-
);
133-
appInsights.setup("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/").start();
134-
appInsights.defaultClient.config.aadTokenCredential = credential;
135-
136-
```
137-
138119
### [Java](#tab/java)
139120

140121
> [!NOTE]
@@ -181,27 +162,6 @@ The following example shows how to configure the Java agent to use user-assigned
181162

182163
:::image type="content" source="media/azure-ad-authentication/user-assigned-managed-identity.png" alt-text="Screenshot that shows user-assigned managed identity." lightbox="media/azure-ad-authentication/user-assigned-managed-identity.png":::
183164

184-
#### Client secret
185-
186-
The following example shows how to configure the Java agent to use a service principal for authentication with Microsoft Entra ID. We recommend using this type of authentication only during development. The ultimate goal of adding the authentication feature is to eliminate secrets.
187-
188-
```JSON
189-
{
190-
"connectionString": "App Insights Connection String with IngestionEndpoint",
191-
"authentication": {
192-
"enabled": true,
193-
"type": "CLIENTSECRET",
194-
"clientId":"<YOUR CLIENT ID>",
195-
"clientSecret":"<YOUR CLIENT SECRET>",
196-
"tenantId":"<YOUR TENANT ID>"
197-
}
198-
}
199-
```
200-
201-
:::image type="content" source="media/azure-ad-authentication/client-secret-tenant-id.png" alt-text="Screenshot that shows the client secret with the tenant ID and the client ID." lightbox="media/azure-ad-authentication/client-secret-tenant-id.png":::
202-
203-
:::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":::
204-
205165
#### Environment variable configuration
206166

207167
The `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable lets Application Insights authenticate to Microsoft Entra ID and send telemetry.
@@ -283,27 +243,6 @@ tracer = Tracer(
283243

284244
```
285245

286-
#### Client secret
287-
288-
```python
289-
from azure.identity import ClientSecretCredential
290-
291-
from opencensus.ext.azure.trace_exporter import AzureExporter
292-
from opencensus.trace.samplers import ProbabilitySampler
293-
from opencensus.trace.tracer import Tracer
294-
295-
tenant_id = "<tenant-id>"
296-
client_id = "<client-id"
297-
client_secret = "<client-secret>"
298-
299-
credential = ClientSecretCredential(tenant_id=tenant_id, client_id=client_id, client_secret=client_secret)
300-
tracer = Tracer(
301-
exporter=AzureExporter(credential=credential, connection_string="InstrumentationKey=<your-instrumentation-key>;IngestionEndpoint=<your-ingestion-endpoint>"),
302-
sampler=ProbabilitySampler(1.0)
303-
)
304-
...
305-
```
306-
307246
---
308247

309248
## Disable local authentication
@@ -539,20 +478,6 @@ The root cause might be one of the following reasons:
539478
- You've created the resource with a system-assigned managed identity or associated a user-assigned identity with it. However, you might have forgotten to add the Monitoring Metrics Publisher role to the resource (if using SAMI) or the user-assigned identity (if using UAMI).
540479
- You've provided the right credentials to get the access tokens, but the credentials don't belong to the right Application Insights resource. Make sure you see your resource (VM or app service) or user-assigned identity with Monitoring Metrics Publisher roles in your Application Insights resource.
541480

542-
#### Invalid Tenant ID
543-
544-
If the following exception is seen in the log file `com.microsoft.aad.msal4j.MsalServiceException: Specified tenant identifier <TENANT-ID> is neither a valid DNS name, nor a valid external domain.`, it indicates the agent wasn't successful in acquiring the access token. The probable reason is that you've provided an invalid or the wrong `tenantId` in your client secret configuration.
545-
546-
#### Invalid client secret
547-
548-
If the following exception is seen in the log file `com.microsoft.aad.msal4j.MsalServiceException: Invalid client secret is provided`, it indicates the agent wasn't successful in acquiring the access token. The probable reason is that you've provided an invalid client secret in your client secret configuration.
549-
550-
#### Invalid Client ID
551-
552-
If the following exception is seen in the log file `com.microsoft.aad.msal4j.MsalServiceException: Application with identifier <CLIENT_ID> was not found in the directory`, it indicates the agent wasn't successful in acquiring the access token. The probable reason is that you've provided an invalid or the wrong client ID in your client secret configuration
553-
554-
If the administrator hasn't installed the application or no user in the tenant has consented to it, this scenario occurs. You may have sent your authentication request to the wrong tenant.
555-
556481
### [Python](#tab/python)
557482

558483
#### Error starts with "credential error" (with no status code)
Binary file not shown.

0 commit comments

Comments
 (0)