From d568116d51667eef3ba712a07cbaeccf228f9977 Mon Sep 17 00:00:00 2001 From: Khushmeet Chandi Date: Fri, 17 Jul 2026 17:06:57 -0700 Subject: [PATCH 1/4] [azure-ai-projects] Fix README context-manager snippets and a comment typo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 77e272d0-4d0f-42cf-b18b-50a5ab5b60e5 --- sdk/ai/azure-ai-projects/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index 67fa1864a635..317eda80cb6a 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -104,6 +104,8 @@ with ( credential=credential ) as project_client, ): + # Use project_client here; the context manager closes it on exit. + ... ``` To construct an asynchronous client, install the additional package [aiohttp](https://pypi.org/project/aiohttp/): @@ -127,6 +129,8 @@ async with ( credential=credential ) as project_client, ): + # Use project_client here; the context manager closes it on exit. + ... ``` ### Performing Responses operations using OpenAI client @@ -242,7 +246,7 @@ import sys import logging # Acquire the logger for this client library. Use 'azure' to affect both -# `azure.core` and `azure.ai.projects' libraries. +# `azure.core` and `azure.ai.projects` libraries. logger = logging.getLogger("azure") # Set the desired logging level. logging.INFO or logging.DEBUG are good options. From ad8703c456925802940480378a01d3327ddfe72f Mon Sep 17 00:00:00 2001 From: Khushmeet Chandi Date: Fri, 17 Jul 2026 17:06:58 -0700 Subject: [PATCH 2/4] [azure-ai-projects] Use canonical FOUNDRY_ env var names Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 77e272d0-4d0f-42cf-b18b-50a5ab5b60e5 --- ...mple_evaluations_score_model_grader_with_audio.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio.py index 165bd0f43929..7af590214ca6 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio.py @@ -20,10 +20,10 @@ pip install "azure-ai-projects>=2.0.0" azure-identity python-dotenv Set these environment variables with your own values: - 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your + 1) FOUNDRY_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your Microsoft Foundry project. It has the form: https://.services.ai.azure.com/api/projects/. - 2) AZURE_AI_MODEL_DEPLOYMENT_NAME - Required. The name of the model deployment to use for evaluation. - 3) AZURE_AI_MODEL_DEPLOYMENT_NAME_FOR_AUDIO - Required. The name of the model deployment for audio to use for evaluation, recommend to use "gpt-4o-audio-preview" + 2) FOUNDRY_MODEL_NAME - Required. The name of the model deployment to use for evaluation. + 3) FOUNDRY_MODEL_NAME_FOR_AUDIO - Required. The name of the model deployment for audio to use for evaluation, recommend to use "gpt-4o-audio-preview" """ import base64 @@ -48,9 +48,9 @@ file_path = os.path.abspath(__file__) folder_path = os.path.dirname(file_path) -endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"] -model_deployment_name = os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"] -model_deployment_name_for_audio = os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME_FOR_AUDIO"] +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model_deployment_name = os.environ["FOUNDRY_MODEL_NAME"] +model_deployment_name_for_audio = os.environ["FOUNDRY_MODEL_NAME_FOR_AUDIO"] def audio_to_base64(audio_path: str) -> str: From 5613df1a00cbfa10cd76daa35f7dd1b814ec5c13 Mon Sep 17 00:00:00 2001 From: Khushmeet Chandi Date: Fri, 17 Jul 2026 17:07:03 -0700 Subject: [PATCH 3/4] [azure-ai-projects] Use canonical FOUNDRY_ env var names Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 77e272d0-4d0f-42cf-b18b-50a5ab5b60e5 --- ...ons_score_model_grader_with_audio_model_target.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio_model_target.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio_model_target.py index 75eb7b97f566..b080adbfa5d4 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio_model_target.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_audio_model_target.py @@ -20,10 +20,10 @@ pip install "azure-ai-projects>=2.0.0" azure-identity python-dotenv Set these environment variables with your own values: - 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your + 1) FOUNDRY_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your Microsoft Foundry project. It has the form: https://.services.ai.azure.com/api/projects/. - 2) AZURE_AI_MODEL_DEPLOYMENT_NAME - Required. The name of the model deployment to use for evaluation. - 3) AZURE_AI_MODEL_DEPLOYMENT_NAME_FOR_AUDIO - Required. The name of the model deployment for audio to use for evaluation, recommend to use "gpt-4o-audio-preview" + 2) FOUNDRY_MODEL_NAME - Required. The name of the model deployment to use for evaluation. + 3) FOUNDRY_MODEL_NAME_FOR_AUDIO - Required. The name of the model deployment for audio to use for evaluation, recommend to use "gpt-4o-audio-preview" """ import base64 @@ -47,9 +47,9 @@ file_path = os.path.abspath(__file__) folder_path = os.path.dirname(file_path) -endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"] -model_deployment_name = os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"] -model_deployment_name_for_audio = os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME_FOR_AUDIO"] +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model_deployment_name = os.environ["FOUNDRY_MODEL_NAME"] +model_deployment_name_for_audio = os.environ["FOUNDRY_MODEL_NAME_FOR_AUDIO"] def audio_to_base64(audio_path: str) -> str: From 33b5332e90cabc5ba7a500d01958c3a28175e775 Mon Sep 17 00:00:00 2001 From: Khushmeet Chandi Date: Fri, 17 Jul 2026 17:07:04 -0700 Subject: [PATCH 4/4] [azure-ai-projects] Use canonical FOUNDRY_ env var names Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 77e272d0-4d0f-42cf-b18b-50a5ab5b60e5 --- ...luations_score_model_grader_with_image_model_target.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_image_model_target.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_image_model_target.py index 01a22ccfe588..c54fcde7efc0 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_image_model_target.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_score_model_grader_with_image_model_target.py @@ -18,9 +18,9 @@ pip install "azure-ai-projects>=2.0.0" azure-identity python-dotenv Pillow Set these environment variables with your own values: - 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your + 1) FOUNDRY_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your Microsoft Foundry project. It has the form: https://.services.ai.azure.com/api/projects/. - 2) AZURE_AI_MODEL_DEPLOYMENT_NAME - Required. The name of the model deployment to use for evaluation. + 2) FOUNDRY_MODEL_NAME - Required. The name of the model deployment to use for evaluation. """ import base64 @@ -47,8 +47,8 @@ file_path = os.path.abspath(__file__) folder_path = os.path.dirname(file_path) -endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"] -model_deployment_name = os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"] +endpoint = os.environ["FOUNDRY_PROJECT_ENDPOINT"] +model_deployment_name = os.environ["FOUNDRY_MODEL_NAME"] def image_to_data_uri(image_file_path: str) -> str: