Skip to content

Commit fb950cf

Browse files
authored
Update langchain.md
1 parent a517f30 commit fb950cf

File tree

1 file changed

+29
-20
lines changed

1 file changed

+29
-20
lines changed

articles/ai-studio/how-to/develop/langchain.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -381,36 +381,45 @@ Use the client as usual in your code.
381381
382382
## Tracing
383383
384-
You can use the tracing capabilities in Azure AI Foundry by creating a tracer. Logs are stored in Azure Application Insights and can be queried at any time using Azure Monitor or Azure AI Foundry portal. Each AI Hub has an Azure Application Insights created for you.
384+
You can use the tracing capabilities in Azure AI Foundry by creating a tracer. Logs are stored in Azure Application Insights and can be queried at any time using Azure Monitor or Azure AI Foundry portal. Each AI Hub has an Azure Application Insights associated with it.
385385
386386
### Get your instrumentation connection string
387387
388388
You can configure your application to send telemetry to Azure Application Insights either by:
389389
390390
1. Using the connection string to Azure Application Insights directly:
391391
392-
```python
393-
import os
394-
395-
application_insights_connection_string = "instrumentation...."
396-
```
392+
1. Go to [Azure AI Foundry portal](https://ai.azure.com) and select **Tracing**.
397393
398-
2. Using the Azure AI Foundry SDK and the project connection string. You can find the project's connection string by navigating to the landing page of your project.
394+
2. Select **Manage data source**. In this screen you can see the instance that is associated with the project.
399395
400-
```python
401-
from azure.ai.projects import AIProjectClient
402-
from azure.identity import DefaultAzureCredential
403-
404-
project_client = AIProjectClient.from_connection_string(
405-
credential=DefaultAzureCredential(),
406-
conn_str="<your-project-connection-string>",
407-
)
408-
409-
application_insights_connection_string = project_client.telemetry.get_connection_string()
410-
```
396+
3. Copy the value at **Connection string** and set it to the following variable:
411397
412-
> [!TIP]
413-
> This snippet of code requires the package `azure-ai-projects` installed.
398+
```python
399+
import os
400+
401+
application_insights_connection_string = "instrumentation...."
402+
```
403+
404+
2. Using the Azure AI Foundry SDK and the project connection string.
405+
406+
1. Ensure you have the package `azure-ai-projects` installed in your environment.
407+
408+
2. Go to [Azure AI Foundry portal](https://ai.azure.com).
409+
410+
3. Copy your project's connection string and set it the following code:
411+
412+
```python
413+
from azure.ai.projects import AIProjectClient
414+
from azure.identity import DefaultAzureCredential
415+
416+
project_client = AIProjectClient.from_connection_string(
417+
credential=DefaultAzureCredential(),
418+
conn_str="<your-project-connection-string>",
419+
)
420+
421+
application_insights_connection_string = project_client.telemetry.get_connection_string()
422+
```
414423
415424
### Configure tracing for Azure AI Foundry
416425

0 commit comments

Comments
 (0)