Skip to content

Commit 26afd66

Browse files
authored
[Agents] correct sample_agents_openapi_connection_auth.py (#42570)
1 parent 51e03f8 commit 26afd66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_openapi_connection_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
Set this environment variables with your own values:
3131
PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview
3232
page of your Azure AI Foundry portal.
33-
OPENAPI_CONNECTION_ID - the connection ID for the OpenAPI connection, taken from Azure AI Foundry.
33+
PROJECT_OPENAPI_CONNECTION_NAME - the connection name for the OpenAPI connection, taken from Azure AI Foundry.
3434
MODEL_DEPLOYMENT_NAME - name of the model deployment in the project to use Agents against
3535
"""
3636

@@ -48,7 +48,7 @@
4848
)
4949

5050
model_name = os.environ["MODEL_DEPLOYMENT_NAME"]
51-
connection_id = os.environ["OPENAPI_CONNECTION_ID"]
51+
connection_id = project_client.connections.get(os.environ["PROJECT_OPENAPI_CONNECTION_NAME"]).id
5252

5353
print(connection_id)
5454

0 commit comments

Comments
 (0)