@@ -638,15 +638,15 @@ Azure Monitor OpenTelemetry Distro for Python support the credential classes pro
638
638
639
639
If using `ManagedIdentityCredential `
640
640
```python
641
- import os
642
- # You will need to install azure-identity
641
+ # Import the `ManagedIdentityCredential` class from the `azure.identity` package.
643
642
from azure .identity import ManagedIdentityCredential
643
+ # Import the `configure_azure_monitor()` function from the `azure.monitor.opentelemetry` package.
644
644
from azure .monitor .opentelemetry import configure_azure_monitor
645
645
from opentelemetry import trace
646
646
647
647
credential = ManagedIdentityCredential (client_id = " <client_id>" )
648
648
configure_azure_monitor (
649
- connection_string = os . environ [ " APPLICATIONINSIGHTS_CONNECTION_STRING " ] ,
649
+ connection_string = " your-connection-string " ,
650
650
credential = credential ,
651
651
)
652
652
@@ -659,9 +659,9 @@ with tracer.start_as_current_span("hello with aad managed identity"):
659
659
660
660
If using `ClientSecretCredential `
661
661
```python
662
- import os
663
- # You will need to install azure-identity
662
+ # Import the `ClientSecretCredential` class from the `azure.identity` package.
664
663
from azure .identity import ClientSecretCredential
664
+ # Import the `configure_azure_monitor()` function from the `azure.monitor.opentelemetry` package.
665
665
from azure .monitor .opentelemetry import configure_azure_monitor
666
666
from opentelemetry import trace
667
667
@@ -671,7 +671,7 @@ credential = ClientSecretCredential(
671
671
client_secret = " <client_secret>" ,
672
672
)
673
673
configure_azure_monitor (
674
- connection_string = os . environ [ " APPLICATIONINSIGHTS_CONNECTION_STRING " ] ,
674
+ connection_string = " your-connection-string " ,
675
675
credential = credential ,
676
676
)
677
677
0 commit comments