Skip to content

Commit 11210ba

Browse files
Merge pull request #283551 from AaronMaxwell/aaronmax-archive-opencensus-entra
Archiving deprecated OpenCensus Python Entra info
2 parents 1003c53 + d525381 commit 11210ba

File tree

1 file changed

+7
-50
lines changed

1 file changed

+7
-50
lines changed

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

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The following Software Development Kits (SDKs) and features are unsupported for
6767
Application Insights .NET SDK supports the credential classes provided by [Azure Identity](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity#credential-classes).
6868

6969
- We recommend `DefaultAzureCredential` for local development.
70-
- Ensure you're authenticated on Visual Studio with the expected Azure user account. For more information, see [Authenticate via Visual Studio](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#authenticate-via-visual-studio).
70+
- Authenticate on Visual Studio with the expected Azure user account. For more information, see [Authenticate via Visual Studio](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#authenticate-via-visual-studio).
7171
- We recommend `ManagedIdentityCredential` for system-assigned and user-assigned managed identities.
7272
- For system-assigned, use the default constructor without parameters.
7373
- For user-assigned, provide the client ID to the constructor.
@@ -126,7 +126,7 @@ useAzureMonitor(options);
126126
> [!NOTE]
127127
> Support for Microsoft Entra ID in the Application Insights Node.JS is included starting with [version 2.1.0-beta.1](https://www.npmjs.com/package/applicationinsights/v/2.1.0-beta.1).
128128
129-
If using applicationinsights npm package.
129+
If using `applicationinsights` npm package.
130130
```typescript
131131
const appInsights = require("applicationinsights");
132132
const { DefaultAzureCredential } = require("@azure/identity");
@@ -139,7 +139,7 @@ appInsights.defaultClient.config.aadTokenCredential = credential;
139139

140140
#### Environment variable configuration
141141

142-
When using [Azure App Services autoinstrumentation](./azure-web-apps-nodejs.md) The `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable lets Application Insights authenticate to Microsoft Entra ID and send telemetry.
142+
Use the `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` environment variable to let Application Insights authenticate to Microsoft Entra ID and send telemetry when using [Azure App Services autoinstrumentation](./azure-web-apps-nodejs.md).
143143

144144
- For system-assigned identity:
145145

@@ -233,52 +233,9 @@ After setting it, restart your application. It now sends telemetry to Applicatio
233233

234234
### [Python](#tab/python)
235235

236-
> [!NOTE]
237-
> Microsoft Entra authentication is only available for Python v2.7, v3.6, and v3.7. Support for Microsoft Entra ID in the Application Insights OpenCensus Python SDK
238-
is included starting with beta version [opencensus-ext-azure 1.1b0](https://pypi.org/project/opencensus-ext-azure/1.1b0/).
239-
240-
> [!NOTE]
241-
> [OpenCensus Python SDK is deprecated](https://opentelemetry.io/blog/2023/sunsetting-opencensus/), but Microsoft supports it until retirement on September 30, 2024. We now recommend the [OpenTelemetry-based Python offering](./opentelemetry-enable.md?tabs=python) and provide [migration guidance](./opentelemetry-python-opencensus-migrate.md?tabs=aspnetcore).
242-
243-
Construct the appropriate [credentials](/python/api/overview/azure/identity-readme#credentials) and pass them into the constructor of the Azure Monitor exporter. Make sure your connection string is set up with the instrumentation key and ingestion endpoint of your resource.
244-
245-
The `OpenCensus` Azure Monitor exporters support these authentication types. We recommend using managed identities in production environments.
246-
247-
#### System-assigned managed identity
248-
249-
```python
250-
from azure.identity import ManagedIdentityCredential
251-
252-
from opencensus.ext.azure.trace_exporter import AzureExporter
253-
from opencensus.trace.samplers import ProbabilitySampler
254-
from opencensus.trace.tracer import Tracer
236+
To configure a secure connection to Azure using OpenTelemetry, see [Enable Microsoft Entra ID (formerly Azure AD) authentication](./opentelemetry-configuration.md?tabs=python#enable-microsoft-entra-id-formerly-azure-ad-authentication).
255237

256-
credential = ManagedIdentityCredential()
257-
tracer = Tracer(
258-
exporter=AzureExporter(credential=credential, connection_string="InstrumentationKey=<your-instrumentation-key>;IngestionEndpoint=<your-ingestion-endpoint>"),
259-
sampler=ProbabilitySampler(1.0)
260-
)
261-
...
262-
263-
```
264-
265-
#### User-assigned managed identity
266-
267-
```python
268-
from azure.identity import ManagedIdentityCredential
269-
270-
from opencensus.ext.azure.trace_exporter import AzureExporter
271-
from opencensus.trace.samplers import ProbabilitySampler
272-
from opencensus.trace.tracer import Tracer
273-
274-
credential = ManagedIdentityCredential(client_id="<client-id>")
275-
tracer = Tracer(
276-
exporter=AzureExporter(credential=credential, connection_string="InstrumentationKey=<your-instrumentation-key>;IngestionEndpoint=<your-ingestion-endpoint>"),
277-
sampler=ProbabilitySampler(1.0)
278-
)
279-
...
280-
281-
```
238+
To configure using OpenCensus (deprecated), see [Configure and enable Microsoft Entra ID-based authentication](/previous-versions/azure/azure-monitor/app/opencensus-python#configure-and-enable-microsoft-entra-id-based-authentication).
282239

283240
---
284241

@@ -629,7 +586,7 @@ The main OAuth2 flow supported is through [authorization codes](/azure/active-di
629586
&resource=https://api.applicationinsights.io
630587
```
631588

632-
When a request is made to the authorized URL, the client\_id is the application ID from your Microsoft Entra app, copied from the app's properties menu. The redirect\_uri is the homepage/login URL from the same Microsoft Entra app. When a request is successful, this endpoint redirects you to the sign-in page you provided at sign-up with the authorization code appended to the URL. See the following example:
589+
When a request is made to the authorized URL, the `client\_id` is the application ID from your Microsoft Entra app, copied from the app's properties menu. The `redirect\_uri` is the `homepage/login` URL from the same Microsoft Entra app. When a request is successful, this endpoint redirects you to the sign-in page you provided at sign-up with the authorization code appended to the URL. See the following example:
633590

634591
```http
635592
http://<app-client-id>/?code=AUTHORIZATION_CODE&session_state=STATE_GUID
@@ -907,7 +864,7 @@ If the SDK fails to get a token, the exception message is logged as
907864

908865
### [Node.js](#tab/nodejs)
909866

910-
Internal logs could be turned on by using the following setup. After they're enabled, error logs will be shown in the console, including any error related to Microsoft Entra integration. Examples include failure to generate the token when the wrong credentials are supplied or errors when the ingestion endpoint fails to authenticate by using the provided credentials.
867+
Turn on internal logs by using the following setup. After you enable them, the console shows error logs, including any error related to Microsoft Entra integration. Examples include failing to generate the token with the wrong credentials or errors when the ingestion endpoint fails to authenticate using the provided credentials.
911868

912869
```javascript
913870
let appInsights = require("applicationinsights");

0 commit comments

Comments
 (0)