From 13f80fdddbf4c0eb5634c42f54123207ff27fcaf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 21:23:22 +0000 Subject: [PATCH 01/15] Initial plan From f0c07ce164127cdfefd21380c33ffe6fdcc99778 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 21:31:45 +0000 Subject: [PATCH 02/15] Rename configuration settings in dotnet/samples per specified mappings Co-authored-by: crickman <66376200+crickman@users.noreply.github.com> --- .../06_host_your_agent/Program.cs | 6 +++--- .../Agent_With_Anthropic/Program.cs | 2 +- .../Agent_With_Anthropic/README.md | 6 +++--- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Agent_With_AzureAIProject/Program.cs | 4 ++-- .../Agent_With_AzureAIProject/README.md | 4 ++-- .../Agent_With_AzureFoundryModel/Program.cs | 6 +++--- .../Agent_With_AzureFoundryModel/README.md | 8 ++++---- .../Agent_With_OpenAIAssistants/Program.cs | 2 +- .../Agent_With_OpenAIAssistants/README.md | 2 +- .../Agent_With_OpenAIChatCompletion/Program.cs | 2 +- .../Agent_With_OpenAIChatCompletion/README.md | 2 +- .../Agent_With_OpenAIResponses/Program.cs | 2 +- .../Agent_With_OpenAIResponses/README.md | 2 +- .../Agent_Anthropic_Step01_Running/Program.cs | 2 +- .../Agent_Anthropic_Step01_Running/README.md | 2 +- .../Program.cs | 2 +- .../Agent_Anthropic_Step02_Reasoning/README.md | 2 +- .../Program.cs | 2 +- .../README.md | 2 +- .../Program.cs | 2 +- .../README.md | 2 +- .../Program.cs | 2 +- .../Program.cs | 2 +- .../README.md | 2 +- .../Agent_OpenAI_Step01_Running/Program.cs | 2 +- .../Agent_OpenAI_Step02_Reasoning/Program.cs | 2 +- .../Program.cs | 2 +- .../README.md | 2 +- .../Program.cs | 2 +- .../README.md | 2 +- .../Program.cs | 2 +- .../Agent_OpenAI_Step05_Conversation/README.md | 2 +- .../Program.cs | 4 ++-- .../Agents/Agent_Step07_AsMcpTool/Program.cs | 4 ++-- .../Agents/Agent_Step07_AsMcpTool/README.md | 4 ++-- .../Agent_Step15_DeepResearch/Program.cs | 8 ++++---- .../Agents/Agent_Step15_DeepResearch/README.md | 8 ++++---- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../FoundryAgents_Step01.1_Basics/Program.cs | 4 ++-- .../FoundryAgents_Step01.1_Basics/README.md | 4 ++-- .../FoundryAgents_Step01.2_Running/Program.cs | 4 ++-- .../FoundryAgents_Step01.2_Running/README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../FoundryAgents_Step10_UsingImages/README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../FoundryAgents_Step12_Middleware/Program.cs | 4 ++-- .../FoundryAgents_Step12_Middleware/README.md | 4 ++-- .../FoundryAgents_Step13_Plugins/Program.cs | 4 ++-- .../FoundryAgents_Step13_Plugins/README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../Program.cs | 4 ++-- .../FoundryAgents_Step15_ComputerUse/README.md | 4 ++-- .../FoundryAgents_Step18_FileSearch/Program.cs | 4 ++-- .../FoundryAgents_Step18_FileSearch/README.md | 4 ++-- .../Program.cs | 4 ++-- .../README.md | 4 ++-- .../FoundryAgents_Step27_LocalMCP/Program.cs | 4 ++-- .../FoundryAgents_Step27_LocalMCP/README.md | 4 ++-- .../samples/02-agents/FoundryAgents/README.md | 4 ++-- .../FoundryAgent_Hosted_MCP/Program.cs | 4 ++-- .../FoundryAgent_Hosted_MCP/README.md | 4 ++-- .../Agents/FoundryAgent/Program.cs | 6 +++--- .../Declarative/ExecuteCode/Program.cs | 2 +- .../Declarative/ExecuteWorkflow/Program.cs | 2 +- .../Declarative/HostedWorkflow/Program.cs | 2 +- .../samples/03-workflows/Declarative/README.md | 18 +++++++++--------- .../Observability/AspireDashboard/Program.cs | 2 +- .../Observability/WorkflowAsAnAgent/Program.cs | 2 +- .../_StartHere/04_MultiModelService/Program.cs | 6 +++--- .../01_AgentOrchestration_Chaining/Program.cs | 6 +++--- .../Program.cs | 6 +++--- .../Program.cs | 6 +++--- .../04_AgentOrchestration_HITL/Program.cs | 6 +++--- .../05_LongRunningTools/Program.cs | 6 +++--- .../06_AgentAsMcpTool/Program.cs | 6 +++--- .../AzureFunctions/06_AgentAsMcpTool/README.md | 4 ++-- .../07_ReliableStreaming/Program.cs | 6 +++--- .../07_ReliableStreaming/README.md | 4 ++-- .../DurableAgents/AzureFunctions/README.md | 12 ++++++------ .../ConsoleApps/01_SingleAgent/Program.cs | 6 +++--- .../02_AgentOrchestration_Chaining/Program.cs | 6 +++--- .../Program.cs | 6 +++--- .../Program.cs | 6 +++--- .../05_AgentOrchestration_HITL/Program.cs | 6 +++--- .../ConsoleApps/06_LongRunningTools/Program.cs | 6 +++--- .../07_ReliableStreaming/Program.cs | 6 +++--- .../ConsoleApps/07_ReliableStreaming/README.md | 4 ++-- .../DurableAgents/ConsoleApps/README.md | 8 ++++---- .../A2AClientServer/A2AClient/README.md | 2 +- .../A2AClientServer/A2AServer/Program.cs | 4 ++-- .../05-end-to-end/A2AClientServer/README.md | 2 +- .../AGUIWebChat/Client/Program.cs | 2 +- .../Client/Properties/launchSettings.json | 2 +- .../05-end-to-end/AGUIWebChat/README.md | 8 ++++---- 117 files changed, 239 insertions(+), 239 deletions(-) diff --git a/dotnet/samples/01-get-started/06_host_your_agent/Program.cs b/dotnet/samples/01-get-started/06_host_your_agent/Program.cs index cc000bd8157..d1fd3ced05b 100644 --- a/dotnet/samples/01-get-started/06_host_your_agent/Program.cs +++ b/dotnet/samples/01-get-started/06_host_your_agent/Program.cs @@ -14,11 +14,11 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/Program.cs b/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/Program.cs index a099d5aad32..da26d65cfe9 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/Program.cs @@ -7,7 +7,7 @@ using Azure.Identity; using Microsoft.Agents.AI; -string deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_DEPLOYMENT_NAME") ?? "claude-haiku-4-5"; +string deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_CHAT_MODEL_NAME") ?? "claude-haiku-4-5"; // The resource is the subdomain name / first name coming before '.services.ai.azure.com' in the endpoint Uri // ie: https://(resource name).services.ai.azure.com/anthropic/v1/chat/completions diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/README.md b/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/README.md index afcf3915721..c1a569874bf 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/README.md +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_Anthropic/README.md @@ -22,7 +22,7 @@ Set the following environment variables: ```powershell $env:ANTHROPIC_API_KEY="your-anthropic-api-key" # Replace with your Anthropic API key -$env:ANTHROPIC_DEPLOYMENT_NAME="claude-haiku-4-5" # Optional, defaults to claude-haiku-4-5 +$env:ANTHROPIC_CHAT_MODEL_NAME="claude-haiku-4-5" # Optional, defaults to claude-haiku-4-5 ``` ### For Azure Foundry with API Key @@ -35,7 +35,7 @@ Set the following environment variables: ```powershell $env:ANTHROPIC_RESOURCE="your-foundry-resource-name" # Replace with your Azure Foundry resource name (subdomain before .services.ai.azure.com) $env:ANTHROPIC_API_KEY="your-anthropic-api-key" # Replace with your Anthropic API key -$env:ANTHROPIC_DEPLOYMENT_NAME="claude-haiku-4-5" # Optional, defaults to claude-haiku-4-5 +$env:ANTHROPIC_CHAT_MODEL_NAME="claude-haiku-4-5" # Optional, defaults to claude-haiku-4-5 ``` ### For Azure Foundry with Azure CLI @@ -47,7 +47,7 @@ Set the following environment variables: ```powershell $env:ANTHROPIC_RESOURCE="your-foundry-resource-name" # Replace with your Azure Foundry resource name (subdomain before .services.ai.azure.com) -$env:ANTHROPIC_DEPLOYMENT_NAME="claude-haiku-4-5" # Optional, defaults to claude-haiku-4-5 +$env:ANTHROPIC_CHAT_MODEL_NAME="claude-haiku-4-5" # Optional, defaults to claude-haiku-4-5 ``` **Note**: When using Azure Foundry with Azure CLI, make sure you're logged in with `az login` and have access to the Azure Foundry resource. For more information, see the [Azure CLI documentation](https://learn.microsoft.com/cli/azure/authenticate-azure-cli-interactively). diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/Program.cs b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/Program.cs index 20da6b3720d..691fb20328f 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/Program.cs @@ -6,8 +6,8 @@ using Azure.Identity; using Microsoft.Agents.AI; -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string JokerName = "Joker"; const string JokerInstructions = "You are good at telling jokes."; diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/README.md b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/README.md index d6b54976016..969795d87fe 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/README.md +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIAgentsPersistent/README.md @@ -21,6 +21,6 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/Program.cs b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/Program.cs index ced1665951a..acdd0829ab6 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/Program.cs @@ -7,8 +7,8 @@ using Azure.Identity; using Microsoft.Agents.AI; -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string JokerName = "JokerAgent"; diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/README.md b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/README.md index 7e4a28f6a10..66fcbf8297e 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/README.md +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureAIProject/README.md @@ -21,6 +21,6 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/Program.cs b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/Program.cs index 752b6d0ec11..fe682d388aa 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/Program.cs @@ -11,9 +11,9 @@ using OpenAI; using OpenAI.Chat; -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_OPENAI_ENDPOINT is not set."); -var apiKey = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_OPENAI_API_KEY"); -var model = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_MODEL_DEPLOYMENT") ?? "Phi-4-mini-instruct"; +var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); +var apiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); +var model = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "Phi-4-mini-instruct"; // Since we are using the OpenAI Client SDK, we need to override the default endpoint to point to Azure Foundry. var clientOptions = new OpenAIClientOptions() { Endpoint = new Uri(endpoint) }; diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/README.md b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/README.md index b5e65ea2092..6d5b6badd7e 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/README.md +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_AzureFoundryModel/README.md @@ -13,7 +13,7 @@ Before you begin, ensure you have the following prerequisites: - .NET 10 SDK or later - Azure AI Foundry resource - A model deployment in your Azure AI Foundry resource. This example defaults to using the `Phi-4-mini-instruct` model, -so if you want to use a different model, ensure that you set your `AZURE_FOUNDRY_MODEL_DEPLOYMENT` environment +so if you want to use a different model, ensure that you set your `AZURE_AI_MODEL_DEPLOYMENT_NAME` environment variable to the name of your deployed model. - An API key or role based authentication to access the Azure AI Foundry resource @@ -24,11 +24,11 @@ Set the following environment variables: ```powershell # Replace with your Azure AI Foundry resource endpoint # Ensure that you have the "/openai/v1/" path in the URL, since this is required when using the OpenAI SDK to access Azure Foundry models. -$env:AZURE_FOUNDRY_OPENAI_ENDPOINT="https://ai-foundry-.services.ai.azure.com/openai/v1/" +$env:AZURE_OPENAI_ENDPOINT="https://ai-foundry-.services.ai.azure.com/openai/v1/" # Optional, defaults to using Azure CLI for authentication if not provided -$env:AZURE_FOUNDRY_OPENAI_API_KEY="************" +$env:AZURE_OPENAI_API_KEY="************" # Optional, defaults to Phi-4-mini-instruct -$env:AZURE_FOUNDRY_MODEL_DEPLOYMENT="Phi-4-mini-instruct" +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="Phi-4-mini-instruct" ``` diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/Program.cs b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/Program.cs index fa7edfb52c0..02d19ab52c2 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/Program.cs @@ -12,7 +12,7 @@ using OpenAI.Assistants; var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini"; +var model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-4o-mini"; const string JokerName = "Joker"; const string JokerInstructions = "You are good at telling jokes."; diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/README.md b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/README.md index 05d2380b784..b0a7638ab5b 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/README.md +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIAssistants/README.md @@ -12,5 +12,5 @@ Set the following environment variables: ```powershell $env:OPENAI_API_KEY="*****" # Replace with your OpenAI API key -$env:OPENAI_MODEL="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:OPENAI_CHAT_MODEL_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs index 3b22c21b3ba..f5af4d2369f 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs @@ -8,7 +8,7 @@ using OpenAI.Chat; var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini"; +var model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-4o-mini"; AIAgent agent = new OpenAIClient( apiKey) diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/README.md b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/README.md index 70fc4722147..ef7ce3ae021 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/README.md +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIChatCompletion/README.md @@ -9,5 +9,5 @@ Set the following environment variables: ```powershell $env:OPENAI_API_KEY="*****" # Replace with your OpenAI api key -$env:OPENAI_MODEL="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:OPENAI_CHAT_MODEL_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/Program.cs b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/Program.cs index 1e5883c67da..611f3f9a9a7 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/Program.cs +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/Program.cs @@ -7,7 +7,7 @@ using OpenAI.Responses; var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini"; +var model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-4o-mini"; AIAgent agent = new OpenAIClient( apiKey) diff --git a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/README.md b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/README.md index 70fc4722147..ef7ce3ae021 100644 --- a/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/README.md +++ b/dotnet/samples/02-agents/AgentProviders/Agent_With_OpenAIResponses/README.md @@ -9,5 +9,5 @@ Set the following environment variables: ```powershell $env:OPENAI_API_KEY="*****" # Replace with your OpenAI api key -$env:OPENAI_MODEL="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:OPENAI_CHAT_MODEL_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/Program.cs b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/Program.cs index 7aee814c0cd..3d9c7155882 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/Program.cs +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/Program.cs @@ -8,7 +8,7 @@ using Microsoft.Extensions.AI; var apiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY") ?? throw new InvalidOperationException("ANTHROPIC_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("ANTHROPIC_MODEL") ?? "claude-haiku-4-5"; +var model = Environment.GetEnvironmentVariable("ANTHROPIC_CHAT_MODEL_NAME") ?? "claude-haiku-4-5"; AIAgent agent = new AnthropicClient(new ClientOptions { ApiKey = apiKey }) .AsAIAgent(model: model, instructions: "You are good at telling jokes.", name: "Joker"); diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/README.md b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/README.md index 9e7a59a6633..1ebd7c5c05e 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/README.md +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step01_Running/README.md @@ -21,7 +21,7 @@ Set the following environment variables: ```powershell $env:ANTHROPIC_API_KEY="your-anthropic-api-key" # Replace with your Anthropic API key -$env:ANTHROPIC_MODEL="your-anthropic-model" # Replace with your Anthropic model +$env:ANTHROPIC_CHAT_MODEL_NAME="your-anthropic-model" # Replace with your Anthropic model ``` ## Run the sample diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/Program.cs b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/Program.cs index 78633cb7a8b..e88bbd9ac73 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/Program.cs +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/Program.cs @@ -9,7 +9,7 @@ using Microsoft.Extensions.AI; var apiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY") ?? throw new InvalidOperationException("ANTHROPIC_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("ANTHROPIC_MODEL") ?? "claude-haiku-4-5"; +var model = Environment.GetEnvironmentVariable("ANTHROPIC_CHAT_MODEL_NAME") ?? "claude-haiku-4-5"; var maxTokens = 4096; var thinkingTokens = 2048; diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/README.md b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/README.md index ee753baccbe..a48b61308be 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/README.md +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/README.md @@ -23,7 +23,7 @@ Set the following environment variables: ```powershell $env:ANTHROPIC_API_KEY="your-anthropic-api-key" # Replace with your Anthropic API key -$env:ANTHROPIC_MODEL="your-anthropic-model" # Replace with your Anthropic model +$env:ANTHROPIC_CHAT_MODEL_NAME="your-anthropic-model" # Replace with your Anthropic model ``` ## Run the sample diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/Program.cs b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/Program.cs index c58c7ebcc81..1727c43825c 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/Program.cs +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/Program.cs @@ -9,7 +9,7 @@ using Microsoft.Extensions.AI; var apiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY") ?? throw new InvalidOperationException("ANTHROPIC_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("ANTHROPIC_MODEL") ?? "claude-haiku-4-5"; +var model = Environment.GetEnvironmentVariable("ANTHROPIC_CHAT_MODEL_NAME") ?? "claude-haiku-4-5"; [Description("Get the weather for a given location.")] static string GetWeather([Description("The location to get the weather for.")] string location) diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/README.md b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/README.md index 1e6921a2f84..793adbe7988 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/README.md +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/README.md @@ -23,7 +23,7 @@ Set the following environment variables: ```powershell $env:ANTHROPIC_API_KEY="your-anthropic-api-key" # Replace with your Anthropic API key -$env:ANTHROPIC_MODEL="your-anthropic-model" # Replace with your Anthropic model +$env:ANTHROPIC_CHAT_MODEL_NAME="your-anthropic-model" # Replace with your Anthropic model ``` ## Run the sample diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/Program.cs b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/Program.cs index f67c25214f1..9d356a8598b 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/Program.cs +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/Program.cs @@ -19,7 +19,7 @@ string apiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY") ?? throw new InvalidOperationException("ANTHROPIC_API_KEY is not set."); // Skills require Claude 4.5 models (Sonnet 4.5, Haiku 4.5, or Opus 4.5) -string model = Environment.GetEnvironmentVariable("ANTHROPIC_MODEL") ?? "claude-sonnet-4-5-20250929"; +string model = Environment.GetEnvironmentVariable("ANTHROPIC_CHAT_MODEL_NAME") ?? "claude-sonnet-4-5-20250929"; // Create the Anthropic client AnthropicClient anthropicClient = new() { ApiKey = apiKey }; diff --git a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/README.md b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/README.md index db9620a0cb3..20125a32135 100644 --- a/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/README.md +++ b/dotnet/samples/02-agents/AgentWithAnthropic/Agent_Anthropic_Step04_UsingSkills/README.md @@ -24,7 +24,7 @@ Set the following environment variables: ```powershell $env:ANTHROPIC_API_KEY="your-anthropic-api-key" # Replace with your Anthropic API key -$env:ANTHROPIC_MODEL="your-anthropic-model" # Replace with your Anthropic model (e.g., claude-sonnet-4-5-20250929) +$env:ANTHROPIC_CHAT_MODEL_NAME="your-anthropic-model" # Replace with your Anthropic model (e.g., claude-sonnet-4-5-20250929) ``` ## Run the sample diff --git a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step02_MemoryUsingMem0/Program.cs b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step02_MemoryUsingMem0/Program.cs index d1d6a60f9db..f1842eb634b 100644 --- a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step02_MemoryUsingMem0/Program.cs +++ b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step02_MemoryUsingMem0/Program.cs @@ -17,7 +17,7 @@ var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; var mem0ServiceUri = Environment.GetEnvironmentVariable("MEM0_ENDPOINT") ?? throw new InvalidOperationException("MEM0_ENDPOINT is not set."); -var mem0ApiKey = Environment.GetEnvironmentVariable("MEM0_APIKEY") ?? throw new InvalidOperationException("MEM0_APIKEY is not set."); +var mem0ApiKey = Environment.GetEnvironmentVariable("MEM0_API_KEY") ?? throw new InvalidOperationException("MEM0_API_KEY is not set."); // Create an HttpClient for Mem0 with the required base address and authentication. using HttpClient mem0HttpClient = new(); diff --git a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs index 3c805f23998..ed6161d074d 100644 --- a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs +++ b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs @@ -13,7 +13,7 @@ using Microsoft.Agents.AI; using Microsoft.Agents.AI.FoundryMemory; -string foundryEndpoint = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("FOUNDRY_PROJECT_ENDPOINT is not set."); +string foundryEndpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); string memoryStoreName = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_MEMORY_STORE_NAME") ?? "memory-store-sample"; string deploymentName = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_MODEL") ?? "gpt-4o-mini"; string embeddingModelName = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_EMBEDDING_MODEL") ?? "text-embedding-ada-002"; diff --git a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md index dfea386d823..2e525f5297f 100644 --- a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md +++ b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md @@ -22,7 +22,7 @@ This sample demonstrates how to create and run an agent that uses Azure AI Found ```bash # Azure AI Foundry project endpoint and memory store name -export FOUNDRY_PROJECT_ENDPOINT="https://your-account.services.ai.azure.com/api/projects/your-project" +export AZURE_AI_PROJECT_ENDPOINT="https://your-account.services.ai.azure.com/api/projects/your-project" export FOUNDRY_PROJECT_MEMORY_STORE_NAME="my_memory_store" # Model deployment names (models deployed in your Foundry project) diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs index 78ea76e03fe..e2bd31055a9 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step01_Running/Program.cs @@ -8,7 +8,7 @@ using OpenAI.Chat; var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini"; +var model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-4o-mini"; AIAgent agent = new OpenAIClient(apiKey) .GetChatClient(model) diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs index 426b40f1f5d..d13d0d5346d 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step02_Reasoning/Program.cs @@ -7,7 +7,7 @@ using OpenAI; var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-5"; +var model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-5"; var client = new OpenAIClient(apiKey) .GetResponsesClient(model) diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/Program.cs b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/Program.cs index b046afbf0db..5efc6c0ad64 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/Program.cs +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/Program.cs @@ -7,7 +7,7 @@ using OpenAIChatClientSample; string apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -string model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini"; +string model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-4o-mini"; // Create a ChatClient directly from OpenAIClient ChatClient chatClient = new OpenAIClient(apiKey).GetChatClient(model); diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/README.md b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/README.md index a4d9dd76a5c..9c91e964ebe 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/README.md +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step03_CreateFromChatClient/README.md @@ -13,7 +13,7 @@ This sample demonstrates how to create an AI agent directly from an `OpenAI.Chat 1. Set the required environment variables: ```bash set OPENAI_API_KEY=your_api_key_here - set OPENAI_MODEL=gpt-4o-mini + set OPENAI_CHAT_MODEL_NAME=gpt-4o-mini ``` 2. Run the sample: diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/Program.cs b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/Program.cs index 5c229cc57d8..8004770c212 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/Program.cs +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/Program.cs @@ -7,7 +7,7 @@ using OpenAIResponseClientSample; var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini"; +var model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-4o-mini"; // Create a ResponsesClient directly from OpenAIClient ResponsesClient responseClient = new OpenAIClient(apiKey).GetResponsesClient(model); diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/README.md b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/README.md index 32e19caa620..1acbe3137d4 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/README.md +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/README.md @@ -13,7 +13,7 @@ This sample demonstrates how to create an AI agent directly from an `OpenAI.Resp 1. Set the required environment variables: ```bash set OPENAI_API_KEY=your_api_key_here - set OPENAI_MODEL=gpt-4o-mini + set OPENAI_CHAT_MODEL_NAME=gpt-4o-mini ``` 2. Run the sample: diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/Program.cs b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/Program.cs index 9659d3dc40f..921acbad0d7 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/Program.cs +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/Program.cs @@ -15,7 +15,7 @@ using OpenAI.Conversations; string apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set."); -string model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini"; +string model = Environment.GetEnvironmentVariable("OPENAI_CHAT_MODEL_NAME") ?? "gpt-4o-mini"; // Create a ConversationClient directly from OpenAIClient OpenAIClient openAIClient = new(apiKey); diff --git a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/README.md b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/README.md index 9706ca05f1a..1b4d3934187 100644 --- a/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/README.md +++ b/dotnet/samples/02-agents/AgentWithOpenAI/Agent_OpenAI_Step05_Conversation/README.md @@ -69,7 +69,7 @@ foreach (ClientResult result in getConversationItemsResults.GetRawPages()) 1. Set the required environment variables: ```powershell $env:OPENAI_API_KEY = "your_api_key_here" - $env:OPENAI_MODEL = "gpt-4o-mini" + $env:OPENAI_CHAT_MODEL_NAME = "gpt-4o-mini" ``` 2. Run the sample: diff --git a/dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step04_FoundryServiceRAG/Program.cs b/dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step04_FoundryServiceRAG/Program.cs index 4234be6c5a5..c356bccbd99 100644 --- a/dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step04_FoundryServiceRAG/Program.cs +++ b/dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step04_FoundryServiceRAG/Program.cs @@ -11,8 +11,8 @@ using OpenAI.Files; using OpenAI.VectorStores; -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; // Create an AI Project client and get an OpenAI client that works with the foundry service. // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. diff --git a/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/Program.cs b/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/Program.cs index 3ecad341b02..d621227ea0d 100644 --- a/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/Program.cs +++ b/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/Program.cs @@ -9,8 +9,8 @@ using Microsoft.Extensions.Hosting; using ModelContextProtocol.Server; -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid diff --git a/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/README.md b/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/README.md index 518673f04b8..e35cf01e90c 100644 --- a/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/README.md +++ b/dotnet/samples/02-agents/Agents/Agent_Step07_AsMcpTool/README.md @@ -21,8 +21,8 @@ To use the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) ``` 1. Open a web browser and navigate to the URL displayed in the terminal. If not opened automatically, this will open the MCP Inspector interface. 1. In the MCP Inspector interface, add the following environment variables to allow your MCP server to access Azure AI Foundry Project to create and run the agent: - - AZURE_FOUNDRY_PROJECT_ENDPOINT = https://your-resource.openai.azure.com/ # Replace with your Azure AI Foundry Project endpoint - - AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME = gpt-4o-mini # Replace with your model deployment name + - AZURE_AI_PROJECT_ENDPOINT = https://your-resource.openai.azure.com/ # Replace with your Azure AI Foundry Project endpoint + - AZURE_AI_MODEL_DEPLOYMENT_NAME = gpt-4o-mini # Replace with your model deployment name 1. Find and click the `Connect` button in the MCP Inspector interface to connect to the MCP server. 1. As soon as the connection is established, open the `Tools` tab in the MCP Inspector interface and select the `Joker` tool from the list. 1. Specify your prompt as a value for the `query` argument, for example: `Tell me a joke about a pirate` and click the `Run Tool` button to run the tool. diff --git a/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/Program.cs b/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/Program.cs index c14b9e5b55c..cbbc327948e 100644 --- a/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/Program.cs +++ b/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/Program.cs @@ -6,10 +6,10 @@ using Azure.Identity; using Microsoft.Agents.AI; -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -var deepResearchDeploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEEP_RESEARCH_DEPLOYMENT_NAME") ?? "o3-deep-research"; -var modelDeploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o"; -var bingConnectionId = Environment.GetEnvironmentVariable("BING_CONNECTION_ID") ?? throw new InvalidOperationException("BING_CONNECTION_ID is not set."); +var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +var deepResearchDeploymentName = Environment.GetEnvironmentVariable("AZURE_AI_REASONING_DEPLOYMENT_NAME") ?? "o3-deep-research"; +var modelDeploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o"; +var bingConnectionId = Environment.GetEnvironmentVariable("AZURE_AI_BING_CONNECTION_ID") ?? throw new InvalidOperationException("AZURE_AI_BING_CONNECTION_ID is not set."); // Configure extended network timeout for long-running Deep Research tasks. PersistentAgentsAdministrationClientOptions persistentAgentsClientOptions = new(); diff --git a/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/README.md b/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/README.md index 0404054306a..dc24ba45547 100644 --- a/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/README.md +++ b/dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/README.md @@ -35,13 +35,13 @@ Set the following environment variables: ```powershell # Replace with your Azure AI Foundry project endpoint -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-project.services.ai.azure.com/" +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-project.services.ai.azure.com/" # Replace with your Bing connection ID from the project -$env:BING_CONNECTION_ID="/subscriptions/.../connections/your-bing-connection" +$env:AZURE_AI_BING_CONNECTION_ID="/subscriptions/.../connections/your-bing-connection" # Optional, defaults to o3-deep-research -$env:AZURE_FOUNDRY_PROJECT_DEEP_RESEARCH_DEPLOYMENT_NAME="o3-deep-research" +$env:AZURE_AI_REASONING_DEPLOYMENT_NAME="o3-deep-research" # Optional, defaults to gpt-4o -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o" +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o" diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/Program.cs index 93a34428c85..60a859c28f7 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/Program.cs @@ -13,8 +13,8 @@ using Azure.AI.Projects; using Azure.Identity; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; Console.WriteLine("=" + new string('=', 79)); Console.WriteLine("RED TEAMING EVALUATION SAMPLE"); diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/README.md index 5c91f33992d..24e4a62b353 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step01_RedTeaming/README.md @@ -32,8 +32,8 @@ Red teaming is only available in regions that support risk and safety evaluators Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-project.services.ai.azure.com/api/projects/your-project" # Replace with your Azure Foundry project endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-project.services.ai.azure.com/api/projects/your-project" # Replace with your Azure Foundry project endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/Program.cs index 3faf740c0a5..8f8c9fa4eea 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/Program.cs @@ -24,8 +24,8 @@ using ChatMessage = Microsoft.Extensions.AI.ChatMessage; using ChatRole = Microsoft.Extensions.AI.ChatRole; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; string openAiEndpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); string evaluatorDeploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? deploymentName; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/README.md index a5caade60b0..d71eeca6af9 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Evaluations_Step02_SelfReflection/README.md @@ -37,9 +37,9 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-project.api.azureml.ms" # Azure Foundry project endpoint +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-project.api.azureml.ms" # Azure Foundry project endpoint $env:AZURE_OPENAI_ENDPOINT="https://your-openai.openai.azure.com/" # Azure OpenAI endpoint (for quality evaluators) -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Model deployment name +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Model deployment name ``` **Note**: For best evaluation results, use GPT-4o or GPT-4o-mini as the evaluator model. The groundedness evaluator has been tested and tuned for these models. diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/Program.cs index 72450b1ae46..72676bed454 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/Program.cs @@ -7,8 +7,8 @@ using Azure.Identity; using Microsoft.Agents.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string JokerName = "JokerAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/README.md index 1423227772b..ce5eca82775 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.1_Basics/README.md @@ -19,8 +19,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/Program.cs index 79ded7c557a..dd5db03b152 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/Program.cs @@ -7,8 +7,8 @@ using Azure.Identity; using Microsoft.Agents.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string JokerInstructions = "You are good at telling jokes."; const string JokerName = "JokerAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/README.md index 0e55500acee..40cb5e107de 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step01.2_Running/README.md @@ -22,8 +22,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/Program.cs index d74180db148..1ac51c30ade 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/Program.cs @@ -7,8 +7,8 @@ using Azure.Identity; using Microsoft.Agents.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string JokerInstructions = "You are good at telling jokes."; const string JokerName = "JokerAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/README.md index deede817bca..86721bf960b 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/README.md @@ -24,8 +24,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/Program.cs index 43ff40aa04e..cfd74000a6c 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/Program.cs @@ -9,8 +9,8 @@ using Microsoft.Agents.AI; using Microsoft.Extensions.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; [Description("Get the weather for a given location.")] static string GetWeather([Description("The location to get the weather for.")] string location) diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/README.md index b428b05ca1a..fa9b5baf210 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step03_UsingFunctionTools/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/Program.cs index f7a847aeb4b..f33fae35f43 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/Program.cs @@ -11,8 +11,8 @@ using Microsoft.Agents.AI; using Microsoft.Extensions.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; // Create a sample function tool that the agent can use. [Description("Get the weather for a given location.")] diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/README.md index eedf3dd8540..42cbd6ba320 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step04_UsingFunctionToolsWithApprovals/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/Program.cs index 9d031bc64b7..3c02a4cec2b 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/Program.cs @@ -12,8 +12,8 @@ #pragma warning disable CA5399 -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string AssistantInstructions = "You are a helpful assistant that extracts structured information about people."; const string AssistantName = "StructuredOutputAssistant"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/README.md index ac29f466454..4c44230e18b 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step05_StructuredOutput/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/Program.cs index 2d163b0fb15..d8a5a7cd354 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/Program.cs @@ -7,8 +7,8 @@ using Azure.Identity; using Microsoft.Agents.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string JokerInstructions = "You are good at telling jokes."; const string JokerName = "JokerAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/README.md index f0dd76eb53a..57a032e9ecd 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step06_PersistedConversations/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/Program.cs index 35bac61639f..257e24859f6 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/Program.cs @@ -9,8 +9,8 @@ using OpenTelemetry; using OpenTelemetry.Trace; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; string? applicationInsightsConnectionString = Environment.GetEnvironmentVariable("APPLICATIONINSIGHTS_CONNECTION_STRING"); const string JokerInstructions = "You are good at telling jokes."; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/README.md index 1d09c14e9ef..459434bce21 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step07_Observability/README.md @@ -25,8 +25,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini $env:APPLICATIONINSIGHTS_CONNECTION_STRING="your-connection-string" # Optional, for Azure Monitor integration ``` diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/Program.cs index 16708c4e99d..b7a9874e7bb 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/Program.cs @@ -9,8 +9,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string JokerInstructions = "You are good at telling jokes."; const string JokerName = "JokerAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/README.md index 6cc05631911..12760e736f1 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step08_DependencyInjection/README.md @@ -24,8 +24,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/Program.cs index e33f754912d..e1968122a49 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/Program.cs @@ -8,8 +8,8 @@ using Microsoft.Extensions.AI; using ModelContextProtocol.Client; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; Console.WriteLine("Starting MCP Stdio for @modelcontextprotocol/server-github ... "); diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/README.md index 67c4a7f4d15..e4e3fe537ad 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step09_UsingMcpClientAsTools/README.md @@ -24,8 +24,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/Program.cs index 732ca25dde8..d44d62df51b 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/Program.cs @@ -7,8 +7,8 @@ using Microsoft.Agents.AI; using Microsoft.Extensions.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o"; const string VisionInstructions = "You are a helpful agent that can analyze images"; const string VisionName = "VisionAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/README.md index 3b1039b84a9..220104a291b 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step10_UsingImages/README.md @@ -29,8 +29,8 @@ Before running this sample, ensure you have: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-resource.openai.azure.com/" # Replace with your Azure Foundry Project endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o" # Replace with your model deployment name (optional, defaults to gpt-4o) +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-resource.openai.azure.com/" # Replace with your Azure Foundry Project endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o" # Replace with your model deployment name (optional, defaults to gpt-4o) ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/Program.cs index 7bbe478b4c4..585725322e5 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/Program.cs @@ -8,8 +8,8 @@ using Microsoft.Agents.AI; using Microsoft.Extensions.AI; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string WeatherInstructions = "You answer questions about the weather."; const string WeatherName = "WeatherAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/README.md index 4e5a213bc69..5da59b6edb5 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step11_AsFunctionTool/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/Program.cs index c91cc6a6f19..7ea6bc88a38 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/Program.cs @@ -13,8 +13,8 @@ using Microsoft.Extensions.AI; // Get Azure AI Foundry configuration from environment variables -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = System.Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = System.Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o"; const string AssistantInstructions = "You are an AI assistant that helps people find information."; const string AssistantName = "InformationAssistant"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/README.md index ff5e82b6bc5..96d12d98282 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step12_Middleware/README.md @@ -30,8 +30,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Running the Sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/Program.cs index 1f18dc21db0..244d83d632e 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/Program.cs @@ -15,8 +15,8 @@ using Microsoft.Extensions.AI; using Microsoft.Extensions.DependencyInjection; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string AssistantInstructions = "You are a helpful assistant that helps people find information."; const string AssistantName = "PluginAssistant"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/README.md index 56678b47a62..5c52ffcd1c3 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step13_Plugins/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/Program.cs index 77bfa6f8d73..854d3174959 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/Program.cs @@ -11,8 +11,8 @@ using OpenAI.Assistants; using OpenAI.Responses; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string AgentInstructions = "You are a personal math tutor. When asked a math question, write and run code using the python tool to answer the question."; const string AgentNameMEAI = "CoderAgent-MEAI"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/README.md index bc332cd647f..34fa18c94cf 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step14_CodeInterpreter/README.md @@ -24,8 +24,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/Program.cs index 6cfab6edbeb..1c5510218a4 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/Program.cs @@ -15,8 +15,8 @@ internal sealed class Program { private static async Task Main(string[] args) { - string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); - string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "computer-use-preview"; + string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); + string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "computer-use-preview"; // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/README.md index 5cb34a1ed62..092f2bd1cf3 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step15_ComputerUse/README.md @@ -35,8 +35,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="computer-use-preview" # Optional, defaults to computer-use-preview +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="computer-use-preview" # Optional, defaults to computer-use-preview ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/Program.cs index 7b133e06516..36f28c23875 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/Program.cs @@ -11,8 +11,8 @@ using OpenAI.Files; using OpenAI.Responses; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string AgentInstructions = "You are a helpful assistant that can search through uploaded files to answer questions."; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/README.md index 8ef41112397..d6e7dcdf615 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step18_FileSearch/README.md @@ -24,8 +24,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/Program.cs index 8d17bb0f91e..2ee5a944580 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/Program.cs @@ -9,8 +9,8 @@ using OpenAI.Responses; // Warning: DefaultAzureCredential is intended for simplicity in development. For production scenarios, consider using a more specific credential. -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string AgentInstructions = "You are a helpful assistant that can use the countries API to retrieve information about countries by their currency code."; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/README.md index f866eefbdb4..dc0de95876d 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step19_OpenAPITools/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/Program.cs index a9c4d4b7edd..d41771ef37d 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/Program.cs @@ -11,8 +11,8 @@ using Microsoft.Extensions.AI; using ModelContextProtocol.Client; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string AgentInstructions = "You are a helpful assistant that can help with Microsoft documentation questions. Use the Microsoft Learn MCP tool to search for documentation."; const string AgentName = "DocsAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/README.md b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/README.md index 6f426d89b67..00801bf15de 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step27_LocalMCP/README.md @@ -23,8 +23,8 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` ## Run the sample diff --git a/dotnet/samples/02-agents/FoundryAgents/README.md b/dotnet/samples/02-agents/FoundryAgents/README.md index 20e9e8683f9..e7bcec87c35 100644 --- a/dotnet/samples/02-agents/FoundryAgents/README.md +++ b/dotnet/samples/02-agents/FoundryAgents/README.md @@ -83,8 +83,8 @@ cd FoundryAgents_Step01.2_Running Set the following environment variables: ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" # Optional, defaults to gpt-4o-mini ``` If the variables are not set, you will be prompted for the values when running the samples. diff --git a/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs b/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs index f6397ce1823..99d26c103d0 100644 --- a/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs +++ b/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/Program.cs @@ -9,8 +9,8 @@ using Microsoft.Agents.AI; using Microsoft.Extensions.AI; -var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -var model = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4.1-mini"; +var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +var model = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4.1-mini"; // Get a client to create/retrieve server side agents with. // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. diff --git a/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/README.md b/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/README.md index f3be7da5765..a172ec63cf7 100644 --- a/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/README.md +++ b/dotnet/samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP/README.md @@ -11,6 +11,6 @@ Before you begin, ensure you have the following prerequisites: Set the following environment variables: ```powershell -$env:FOUNDRY_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint -$env:FOUNDRY_MODEL_DEPLOYMENT_NAME="gpt-4.1-mini" # Optional, defaults to gpt-4.1-mini +$env:AZURE_AI_PROJECT_ENDPOINT="https://your-foundry-service.services.ai.azure.com/api/projects/your-foundry-project" # Replace with your Azure Foundry resource endpoint +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4.1-mini" # Optional, defaults to gpt-4.1-mini ``` diff --git a/dotnet/samples/03-workflows/Agents/FoundryAgent/Program.cs b/dotnet/samples/03-workflows/Agents/FoundryAgent/Program.cs index 016138aeea8..f322bb882d5 100644 --- a/dotnet/samples/03-workflows/Agents/FoundryAgent/Program.cs +++ b/dotnet/samples/03-workflows/Agents/FoundryAgent/Program.cs @@ -21,9 +21,9 @@ public static class Program private static async Task Main() { // Set up the Azure OpenAI client - var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") - ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); - var deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; + var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") + ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); + var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; var persistentAgentsClient = new PersistentAgentsClient(endpoint, new AzureCliCredential()); // Create agents diff --git a/dotnet/samples/03-workflows/Declarative/ExecuteCode/Program.cs b/dotnet/samples/03-workflows/Declarative/ExecuteCode/Program.cs index 0566a5ff55a..67d467266be 100644 --- a/dotnet/samples/03-workflows/Declarative/ExecuteCode/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/ExecuteCode/Program.cs @@ -17,7 +17,7 @@ namespace Demo.DeclarativeCode; /// /// /// Configuration -/// Define FOUNDRY_PROJECT_ENDPOINT as a user-secret or environment variable that +/// Define AZURE_AI_PROJECT_ENDPOINT as a user-secret or environment variable that /// points to your Foundry project endpoint. /// internal sealed class Program diff --git a/dotnet/samples/03-workflows/Declarative/ExecuteWorkflow/Program.cs b/dotnet/samples/03-workflows/Declarative/ExecuteWorkflow/Program.cs index fdbf9d10264..0d80cb686d9 100644 --- a/dotnet/samples/03-workflows/Declarative/ExecuteWorkflow/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/ExecuteWorkflow/Program.cs @@ -19,7 +19,7 @@ namespace Demo.DeclarativeWorkflow; /// /// /// Configuration -/// Define FOUNDRY_PROJECT_ENDPOINT as a user-secret or environment variable that +/// Define AZURE_AI_PROJECT_ENDPOINT as a user-secret or environment variable that /// points to your Foundry project endpoint. /// Usage /// Provide the path to the workflow definition file as the first argument. diff --git a/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs b/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs index 2cf24a137bc..0815f360b05 100644 --- a/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs @@ -19,7 +19,7 @@ namespace Demo.DeclarativeWorkflow; /// /// /// Configuration -/// Define FOUNDRY_PROJECT_ENDPOINT as a user-secret or environment variable that +/// Define AZURE_AI_PROJECT_ENDPOINT as a user-secret or environment variable that /// points to your Foundry project endpoint. /// Usage /// Provide the path to the workflow definition file as the first argument. diff --git a/dotnet/samples/03-workflows/Declarative/README.md b/dotnet/samples/03-workflows/Declarative/README.md index e2afa586716..2ad3e59c0d2 100644 --- a/dotnet/samples/03-workflows/Declarative/README.md +++ b/dotnet/samples/03-workflows/Declarative/README.md @@ -18,9 +18,9 @@ The configuraton required by the samples is: |Setting Name| Description| |:--|:--| -|FOUNDRY_PROJECT_ENDPOINT| The endpoint URL of your Azure Foundry Project.| -|FOUNDRY_MODEL_DEPLOYMENT_NAME| The name of the model deployment to use -|FOUNDRY_CONNECTION_GROUNDING_TOOL| The name of the Bing Grounding connection configured in your Azure Foundry Project.| +|AZURE_AI_PROJECT_ENDPOINT| The endpoint URL of your Azure Foundry Project.| +|AZURE_AI_MODEL_DEPLOYMENT_NAME| The name of the model deployment to use +|AZURE_AI_BING_CONNECTION_ID| The name of the Bing Grounding connection configured in your Azure Foundry Project.| To set your secrets with .NET Secret Manager: @@ -45,27 +45,27 @@ To set your secrets with .NET Secret Manager: 4. Define setting that identifies your Azure Foundry Project (endpoint): ``` - dotnet user-secrets set "FOUNDRY_PROJECT_ENDPOINT" "https://..." + dotnet user-secrets set "AZURE_AI_PROJECT_ENDPOINT" "https://..." ``` 5. Define setting that identifies your Azure Foundry Model Deployment (endpoint): ``` - dotnet user-secrets set "FOUNDRY_MODEL_DEPLOYMENT_NAME" "gpt-5" + dotnet user-secrets set "AZURE_AI_MODEL_DEPLOYMENT_NAME" "gpt-5" ``` 6. Define setting that identifies your Bing Grounding connection: ``` - dotnet user-secrets set "FOUNDRY_CONNECTION_GROUNDING_TOOL" "mybinggrounding" + dotnet user-secrets set "AZURE_AI_BING_CONNECTION_ID" "mybinggrounding" ``` You may alternatively set your secrets as an environment variable (PowerShell): ```pwsh -$env:FOUNDRY_PROJECT_ENDPOINT="https://..." -$env:FOUNDRY_MODEL_DEPLOYMENT_NAME="gpt-5" -$env:FOUNDRY_CONNECTION_GROUNDING_TOOL="mybinggrounding" +$env:AZURE_AI_PROJECT_ENDPOINT="https://..." +$env:AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-5" +$env:AZURE_AI_BING_CONNECTION_ID="mybinggrounding" ``` ### Authorization diff --git a/dotnet/samples/03-workflows/Observability/AspireDashboard/Program.cs b/dotnet/samples/03-workflows/Observability/AspireDashboard/Program.cs index 06eebfba9db..23fcfe5f4e6 100644 --- a/dotnet/samples/03-workflows/Observability/AspireDashboard/Program.cs +++ b/dotnet/samples/03-workflows/Observability/AspireDashboard/Program.cs @@ -29,7 +29,7 @@ public static class Program private static async Task Main() { // Configure OpenTelemetry for Aspire dashboard - var otlpEndpoint = Environment.GetEnvironmentVariable("OTLP_ENDPOINT") ?? "http://localhost:4317"; + var otlpEndpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") ?? "http://localhost:4317"; var resourceBuilder = ResourceBuilder .CreateDefault() diff --git a/dotnet/samples/03-workflows/Observability/WorkflowAsAnAgent/Program.cs b/dotnet/samples/03-workflows/Observability/WorkflowAsAnAgent/Program.cs index 19a33397544..f1911dc43fa 100644 --- a/dotnet/samples/03-workflows/Observability/WorkflowAsAnAgent/Program.cs +++ b/dotnet/samples/03-workflows/Observability/WorkflowAsAnAgent/Program.cs @@ -50,7 +50,7 @@ private static async Task Main() { // Set up observability var applicationInsightsConnectionString = Environment.GetEnvironmentVariable("APPLICATIONINSIGHTS_CONNECTION_STRING"); - var otlpEndpoint = Environment.GetEnvironmentVariable("OTLP_ENDPOINT") ?? "http://localhost:4317"; + var otlpEndpoint = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") ?? "http://localhost:4317"; var resourceBuilder = ResourceBuilder .CreateDefault() diff --git a/dotnet/samples/03-workflows/_StartHere/04_MultiModelService/Program.cs b/dotnet/samples/03-workflows/_StartHere/04_MultiModelService/Program.cs index 92414ff3b2f..5edc956ccb0 100644 --- a/dotnet/samples/03-workflows/_StartHere/04_MultiModelService/Program.cs +++ b/dotnet/samples/03-workflows/_StartHere/04_MultiModelService/Program.cs @@ -10,13 +10,13 @@ // Create the IChatClients to talk to different services. IChatClient aws = new AmazonBedrockRuntimeClient( - Environment.GetEnvironmentVariable("BEDROCK_ACCESSKEY"!), - Environment.GetEnvironmentVariable("BEDROCK_SECRETACCESSKEY")!, + Environment.GetEnvironmentVariable("BEDROCK_ACCESS_KEY"!), + Environment.GetEnvironmentVariable("BEDROCK_SECRET_KEY")!, Amazon.RegionEndpoint.USEast1) .AsIChatClient("amazon.nova-pro-v1:0"); IChatClient anthropic = new Anthropic.AnthropicClient( - new() { ApiKey = Environment.GetEnvironmentVariable("ANTHROPIC_APIKEY") }) + new() { ApiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY") }) .AsIChatClient("claude-sonnet-4-20250514"); IChatClient openai = new OpenAI.OpenAIClient( diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/Program.cs b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/Program.cs index 13d0852915c..b682e638a72 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/Program.cs @@ -14,11 +14,11 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/Program.cs b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/Program.cs index 5cf8aec044b..11e2ec3f497 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/Program.cs @@ -14,11 +14,11 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/Program.cs b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/Program.cs index 803b15f4878..114ec7073f8 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/Program.cs @@ -14,11 +14,11 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/Program.cs b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/Program.cs index eecd6de5704..331f435f89b 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/Program.cs @@ -14,11 +14,11 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/Program.cs b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/Program.cs index a06d2d8e630..f1ee3965655 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/Program.cs @@ -18,11 +18,11 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/Program.cs b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/Program.cs index a0767f88602..b371fb3cdc1 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/Program.cs @@ -20,11 +20,11 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/README.md b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/README.md index d1656ba0ccc..ddce884497d 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/README.md +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/README.md @@ -38,8 +38,8 @@ Update your `local.settings.json` with your Azure OpenAI credentials: { "Values": { "AZURE_OPENAI_ENDPOINT": "https://your-resource.openai.azure.com/", - "AZURE_OPENAI_DEPLOYMENT": "your-deployment-name", - "AZURE_OPENAI_KEY": "your-api-key-if-not-using-rbac" + "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name", + "AZURE_OPENAI_API_KEY": "your-api-key-if-not-using-rbac" } } ``` diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/Program.cs b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/Program.cs index 3850f967dc5..feedf0eb054 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/Program.cs @@ -26,8 +26,8 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get Redis connection string from environment variable. string redisConnectionString = Environment.GetEnvironmentVariable("REDIS_CONNECTION_STRING") @@ -39,7 +39,7 @@ out int ttlMinutes) ? ttlMinutes : 10; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = System.Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/README.md b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/README.md index fd13f23ecd3..a8607ce11ec 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/README.md +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/README.md @@ -239,8 +239,8 @@ These patterns may be overkill for: | `REDIS_CONNECTION_STRING` | Redis connection string | `localhost:6379` | | `REDIS_STREAM_TTL_MINUTES` | How long streams are retained after last write | `10` | | `AZURE_OPENAI_ENDPOINT` | Azure OpenAI endpoint URL | (required) | -| `AZURE_OPENAI_DEPLOYMENT` | Azure OpenAI deployment name | (required) | -| `AZURE_OPENAI_KEY` | API key (optional, uses Azure CLI auth if not set) | (optional) | +| `AZURE_OPENAI_DEPLOYMENT_NAME` | Azure OpenAI deployment name | (required) | +| `AZURE_OPENAI_API_KEY` | API key (optional, uses Azure CLI auth if not set) | (optional) | ## Cleanup diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/README.md b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/README.md index 5ac0f6015b6..3f52d5efe61 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/README.md +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/README.md @@ -57,18 +57,18 @@ More information on how to configure RBAC permissions for Azure OpenAI can be fo ### Setting an API key for the Azure OpenAI service -As an alternative to configuring Azure RBAC permissions, you can set an API key for the Azure OpenAI service by setting the `AZURE_OPENAI_KEY` environment variable. +As an alternative to configuring Azure RBAC permissions, you can set an API key for the Azure OpenAI service by setting the `AZURE_OPENAI_API_KEY` environment variable. Bash (Linux/macOS/WSL): ```bash -export AZURE_OPENAI_KEY="your-api-key" +export AZURE_OPENAI_API_KEY="your-api-key" ``` PowerShell: ```powershell -$env:AZURE_OPENAI_KEY="your-api-key" +$env:AZURE_OPENAI_API_KEY="your-api-key" ``` ### Start Durable Task Scheduler @@ -110,7 +110,7 @@ Each sample has its own `local.settings.json` file that contains the environment { "Values": { "AZURE_OPENAI_ENDPOINT": "https://your-resource.openai.azure.com/", - "AZURE_OPENAI_DEPLOYMENT": "your-deployment-name" + "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name" } } ``` @@ -121,14 +121,14 @@ Alternatively, you can set the environment variables in the command line. ```bash export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/" -export AZURE_OPENAI_DEPLOYMENT="your-deployment-name" +export AZURE_OPENAI_DEPLOYMENT_NAME="your-deployment-name" ``` ### PowerShell ```powershell $env:AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/" -$env:AZURE_OPENAI_DEPLOYMENT="your-deployment-name" +$env:AZURE_OPENAI_DEPLOYMENT_NAME="your-deployment-name" ``` These environment variables, when set, will override the values in the `local.settings.json` file, making it convenient to test the sample without having to update the `local.settings.json` file. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/01_SingleAgent/Program.cs b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/01_SingleAgent/Program.cs index 7b54cf7c0a5..c331d28ccce 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/01_SingleAgent/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/01_SingleAgent/Program.cs @@ -16,15 +16,15 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get DTS connection string from environment variable string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING") ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/02_AgentOrchestration_Chaining/Program.cs b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/02_AgentOrchestration_Chaining/Program.cs index 77af66252c0..6af759a62bf 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/02_AgentOrchestration_Chaining/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/02_AgentOrchestration_Chaining/Program.cs @@ -20,15 +20,15 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get DTS connection string from environment variable string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING") ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/03_AgentOrchestration_Concurrency/Program.cs b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/03_AgentOrchestration_Concurrency/Program.cs index fd7e601f943..714558abc02 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/03_AgentOrchestration_Concurrency/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/03_AgentOrchestration_Concurrency/Program.cs @@ -20,15 +20,15 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get DTS connection string from environment variable string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING") ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/04_AgentOrchestration_Conditionals/Program.cs b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/04_AgentOrchestration_Conditionals/Program.cs index dfef999613f..7b1751f2987 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/04_AgentOrchestration_Conditionals/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/04_AgentOrchestration_Conditionals/Program.cs @@ -19,15 +19,15 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get DTS connection string from environment variable string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING") ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/05_AgentOrchestration_HITL/Program.cs b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/05_AgentOrchestration_HITL/Program.cs index ec98d55b5ae..80c09fee016 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/05_AgentOrchestration_HITL/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/05_AgentOrchestration_HITL/Program.cs @@ -20,15 +20,15 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get DTS connection string from environment variable string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING") ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/06_LongRunningTools/Program.cs b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/06_LongRunningTools/Program.cs index 6a8fe08b8d4..203edca3084 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/06_LongRunningTools/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/06_LongRunningTools/Program.cs @@ -21,15 +21,15 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get DTS connection string from environment variable string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING") ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/Program.cs b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/Program.cs index 9efe28a9372..3abc5c87012 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/Program.cs +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/Program.cs @@ -22,8 +22,8 @@ // Get the Azure OpenAI endpoint and deployment name from environment variables. string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT") - ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") + ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set."); // Get Redis connection string from environment variable. string redisConnectionString = Environment.GetEnvironmentVariable("REDIS_CONNECTION_STRING") @@ -37,7 +37,7 @@ ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"; // Use Azure Key Credential if provided, otherwise use Azure CLI Credential. -string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"); +string? azureOpenAiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"); // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. // In production, consider using a specific credential (e.g., ManagedIdentityCredential) to avoid // latency issues, unintended credential probing, and potential security risks from fallback mechanisms. diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/README.md b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/README.md index c1956157e8e..6842c35e87e 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/README.md +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/07_ReliableStreaming/README.md @@ -168,8 +168,8 @@ This sample provides **at-least-once delivery** with the following characteristi | `REDIS_CONNECTION_STRING` | Redis connection string | `localhost:6379` | | `REDIS_STREAM_TTL_MINUTES` | How long streams are retained after last write | `10` | | `AZURE_OPENAI_ENDPOINT` | Azure OpenAI endpoint URL | (required) | -| `AZURE_OPENAI_DEPLOYMENT` | Azure OpenAI deployment name | (required) | -| `AZURE_OPENAI_KEY` | API key (optional, uses Azure CLI auth if not set) | (optional) | +| `AZURE_OPENAI_DEPLOYMENT_NAME` | Azure OpenAI deployment name | (required) | +| `AZURE_OPENAI_API_KEY` | API key (optional, uses Azure CLI auth if not set) | (optional) | ## Cleanup diff --git a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/README.md b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/README.md index 1bd2b0d224b..6e6f4578f1c 100644 --- a/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/README.md +++ b/dotnet/samples/04-hosting/DurableAgents/ConsoleApps/README.md @@ -53,18 +53,18 @@ More information on how to configure RBAC permissions for Azure OpenAI can be fo ### Setting an API key for the Azure OpenAI service -As an alternative to configuring Azure RBAC permissions, you can set an API key for the Azure OpenAI service by setting the `AZURE_OPENAI_KEY` environment variable. +As an alternative to configuring Azure RBAC permissions, you can set an API key for the Azure OpenAI service by setting the `AZURE_OPENAI_API_KEY` environment variable. Bash (Linux/macOS/WSL): ```bash -export AZURE_OPENAI_KEY="your-api-key" +export AZURE_OPENAI_API_KEY="your-api-key" ``` PowerShell: ```powershell -$env:AZURE_OPENAI_KEY="your-api-key" +$env:AZURE_OPENAI_API_KEY="your-api-key" ``` ### Start Durable Task Scheduler @@ -85,7 +85,7 @@ Each sample reads configuration from environment variables. You'll need to set t ```bash export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/" -export AZURE_OPENAI_DEPLOYMENT="your-deployment-name" +export AZURE_OPENAI_DEPLOYMENT_NAME="your-deployment-name" ``` ### Running the Console Apps diff --git a/dotnet/samples/05-end-to-end/A2AClientServer/A2AClient/README.md b/dotnet/samples/05-end-to-end/A2AClientServer/A2AClient/README.md index 5a80e0220fd..eb233fb8d12 100644 --- a/dotnet/samples/05-end-to-end/A2AClientServer/A2AClient/README.md +++ b/dotnet/samples/05-end-to-end/A2AClientServer/A2AClient/README.md @@ -20,7 +20,7 @@ The agent urls are provided as a ` ` delimited list of strings ```powershell cd dotnet/samples/05-end-to-end/A2AClientServer/A2AClient -$env:OPENAI_MODEL="gpt-4o-mini" +$env:OPENAI_CHAT_MODEL_NAME="gpt-4o-mini" $env:OPENAI_API_KEY="" $env:AGENT_URLS="http://localhost:5000/policy;http://localhost:5000/invoice;http://localhost:5000/logistics" ``` diff --git a/dotnet/samples/05-end-to-end/A2AClientServer/A2AServer/Program.cs b/dotnet/samples/05-end-to-end/A2AClientServer/A2AServer/Program.cs index bd344c46c89..b8a10ac6477 100644 --- a/dotnet/samples/05-end-to-end/A2AClientServer/A2AServer/Program.cs +++ b/dotnet/samples/05-end-to-end/A2AClientServer/A2AServer/Program.cs @@ -36,8 +36,8 @@ .Build(); string? apiKey = configuration["OPENAI_API_KEY"]; -string model = configuration["OPENAI_MODEL"] ?? "gpt-4o-mini"; -string? endpoint = configuration["AZURE_FOUNDRY_PROJECT_ENDPOINT"]; +string model = configuration["OPENAI_CHAT_MODEL_NAME"] ?? "gpt-4o-mini"; +string? endpoint = configuration["AZURE_AI_PROJECT_ENDPOINT"]; var invoiceQueryPlugin = new InvoiceQuery(); IList tools = diff --git a/dotnet/samples/05-end-to-end/A2AClientServer/README.md b/dotnet/samples/05-end-to-end/A2AClientServer/README.md index 04b9968e760..eea37637917 100644 --- a/dotnet/samples/05-end-to-end/A2AClientServer/README.md +++ b/dotnet/samples/05-end-to-end/A2AClientServer/README.md @@ -84,7 +84,7 @@ You must create the agents in an Azure AI Foundry project and then provide the p ``` ```powershell -$env:AZURE_FOUNDRY_PROJECT_ENDPOINT="https://ai-foundry-your-project.services.ai.azure.com/api/projects/ai-proj-ga-your-project" # Replace with your Foundry Project endpoint +$env:AZURE_AI_PROJECT_ENDPOINT="https://ai-foundry-your-project.services.ai.azure.com/api/projects/ai-proj-ga-your-project" # Replace with your Foundry Project endpoint ``` Use the following commands to run each A2A server diff --git a/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Program.cs b/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Program.cs index c145227062e..ff5d1cacd76 100644 --- a/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Program.cs +++ b/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Program.cs @@ -9,7 +9,7 @@ builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); -string serverUrl = builder.Configuration["SERVER_URL"] ?? "http://localhost:5100"; +string serverUrl = builder.Configuration["AGUI_SERVER_URL"] ?? "http://localhost:5100"; builder.Services.AddHttpClient("aguiserver", httpClient => httpClient.BaseAddress = new Uri(serverUrl)); diff --git a/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Properties/launchSettings.json b/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Properties/launchSettings.json index 348e16bc3b0..068f935461e 100644 --- a/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Properties/launchSettings.json +++ b/dotnet/samples/05-end-to-end/AGUIWebChat/Client/Properties/launchSettings.json @@ -8,7 +8,7 @@ "applicationUrl": "http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", - "SERVER_URL": "http://localhost:5100" + "AGUI_SERVER_URL": "http://localhost:5100" } } } diff --git a/dotnet/samples/05-end-to-end/AGUIWebChat/README.md b/dotnet/samples/05-end-to-end/AGUIWebChat/README.md index bdb8ae25d2d..0e42757fa11 100644 --- a/dotnet/samples/05-end-to-end/AGUIWebChat/README.md +++ b/dotnet/samples/05-end-to-end/AGUIWebChat/README.md @@ -89,7 +89,7 @@ The server exposes the agent via the AG-UI protocol at `http://localhost:5100/ag The client (`Client/Program.cs`) configures an `AGUIChatClient` to connect to the server: ```csharp -string serverUrl = builder.Configuration["SERVER_URL"] ?? "http://localhost:5100"; +string serverUrl = builder.Configuration["AGUI_SERVER_URL"] ?? "http://localhost:5100"; builder.Services.AddHttpClient("aguiserver", httpClient => httpClient.BaseAddress = new Uri(serverUrl)); @@ -141,17 +141,17 @@ The client connects to the server URL specified in `Client/Properties/launchSett "http": { "applicationUrl": "http://localhost:5000", "environmentVariables": { - "SERVER_URL": "http://localhost:5100" + "AGUI_SERVER_URL": "http://localhost:5100" } } } } ``` -To change the server URL, modify the `SERVER_URL` environment variable in the client's launch settings or provide it at runtime: +To change the server URL, modify the `AGUI_SERVER_URL` environment variable in the client's launch settings or provide it at runtime: ```powershell -$env:SERVER_URL="http://your-server:5100" +$env:AGUI_SERVER_URL="http://your-server:5100" dotnet run ``` From bcc530c4bbb638cc3f40581b2b6650a6c983a9aa Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sat, 21 Feb 2026 16:02:20 -0800 Subject: [PATCH 03/15] Updated --- .../Program.cs | 6 +++--- .../README.md | 6 +++--- .../Declarative/CustomerSupport/Program.cs | 12 ++++++------ .../Declarative/DeepResearch/Program.cs | 14 +++++++------- .../Declarative/FunctionTools/Program.cs | 2 +- .../Declarative/HostedWorkflow/Program.cs | 4 ++-- .../Declarative/InputArguments/Program.cs | 6 +++--- .../Declarative/InvokeFunctionTool/Program.cs | 2 +- .../03-workflows/Declarative/Marketing/Program.cs | 6 +++--- .../Declarative/StudentTeacher/Program.cs | 4 ++-- .../Declarative/ToolApproval/Program.cs | 2 +- .../src/Shared/Workflows/Settings/Application.cs | 7 +++---- .../Agents/AgentProvider.cs | 7 +++---- .../Agents/FunctionToolAgentProvider.cs | 2 +- .../Agents/MarketingAgentProvider.cs | 6 +++--- .../Agents/MathChatAgentProvider.cs | 4 ++-- .../Agents/PoemAgentProvider.cs | 2 +- .../Agents/TestAgentProvider.cs | 2 +- .../Agents/VisionAgentProvider.cs | 2 +- 19 files changed, 47 insertions(+), 49 deletions(-) diff --git a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs index ed6161d074d..914eda330ab 100644 --- a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs +++ b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/Program.cs @@ -14,9 +14,9 @@ using Microsoft.Agents.AI.FoundryMemory; string foundryEndpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); -string memoryStoreName = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_MEMORY_STORE_NAME") ?? "memory-store-sample"; -string deploymentName = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_MODEL") ?? "gpt-4o-mini"; -string embeddingModelName = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_EMBEDDING_MODEL") ?? "text-embedding-ada-002"; +string memoryStoreName = Environment.GetEnvironmentVariable("AZURE_AI_MEMORY_STORE_ID") ?? "memory-store-sample"; +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string embeddingModelName = Environment.GetEnvironmentVariable("AZURE_AI_EMBEDDING_DEPLOYMENT_NAME") ?? "text-embedding-ada-002"; // Create an AIProjectClient for Foundry with Azure Identity authentication. DefaultAzureCredential credential = new(); diff --git a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md index 2e525f5297f..bcc70b01030 100644 --- a/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md +++ b/dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step04_MemoryUsingFoundry/README.md @@ -23,11 +23,11 @@ This sample demonstrates how to create and run an agent that uses Azure AI Found ```bash # Azure AI Foundry project endpoint and memory store name export AZURE_AI_PROJECT_ENDPOINT="https://your-account.services.ai.azure.com/api/projects/your-project" -export FOUNDRY_PROJECT_MEMORY_STORE_NAME="my_memory_store" +export AZURE_AI_MEMORY_STORE_ID="my_memory_store" # Model deployment names (models deployed in your Foundry project) -export FOUNDRY_PROJECT_MODEL="gpt-4o-mini" -export FOUNDRY_PROJECT_EMBEDDING_MODEL="text-embedding-ada-002" +export AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-4o-mini" +export AZURE_AI_EMBEDDING_DEPLOYMENT_NAME="text-embedding-ada-002" ``` ## Run the Sample diff --git a/dotnet/samples/03-workflows/Declarative/CustomerSupport/Program.cs b/dotnet/samples/03-workflows/Declarative/CustomerSupport/Program.cs index 0547c37b72e..b5df45a3996 100644 --- a/dotnet/samples/03-workflows/Declarative/CustomerSupport/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/CustomerSupport/Program.cs @@ -98,7 +98,7 @@ await aiProjectClient.CreateAgentAsync( } private static PromptAgentDefinition DefineSelfServiceAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -145,7 +145,7 @@ Use your knowledge to work with the user to provide the best possible troublesho }; private static PromptAgentDefinition DefineTicketingAgent(IConfiguration configuration, TicketingPlugin plugin) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -209,7 +209,7 @@ Include the following information in the TicketSummary. }; private static PromptAgentDefinition DefineTicketRoutingAgent(IConfiguration configuration, TicketingPlugin plugin) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -254,7 +254,7 @@ Determine how to route the given issue to the appropriate support team. }; private static PromptAgentDefinition DefineWindowsSupportAgent(IConfiguration configuration, TicketingPlugin plugin) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -324,7 +324,7 @@ Use your knowledge to work with the user to provide the best possible troublesho }; private static PromptAgentDefinition DefineResolutionAgent(IConfiguration configuration, TicketingPlugin plugin) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -358,7 +358,7 @@ Always include the resolution details. }; private static PromptAgentDefinition TicketEscalationAgent(IConfiguration configuration, TicketingPlugin plugin) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/samples/03-workflows/Declarative/DeepResearch/Program.cs b/dotnet/samples/03-workflows/Declarative/DeepResearch/Program.cs index ae410a03717..98d75d250b8 100644 --- a/dotnet/samples/03-workflows/Declarative/DeepResearch/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/DeepResearch/Program.cs @@ -89,7 +89,7 @@ await aiProjectClient.CreateAgentAsync( } private static PromptAgentDefinition DefineResearchAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelFull)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -121,7 +121,7 @@ 4. EDUCATED GUESSES }; private static PromptAgentDefinition DefinePlannerAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = // TODO: Use Structured Inputs / Prompt Template """ @@ -140,7 +140,7 @@ Your only job is to devise an efficient plan that identifies (by name) how a tea }; private static PromptAgentDefinition DefineManagerAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = // TODO: Use Structured Inputs / Prompt Template """ @@ -226,7 +226,7 @@ private static PromptAgentDefinition DefineManagerAgent(IConfiguration configura }; private static PromptAgentDefinition DefineSummaryAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -241,7 +241,7 @@ so please ensure it is complete and self-contained. }; private static PromptAgentDefinition DefineKnowledgeAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Tools = { @@ -252,7 +252,7 @@ private static PromptAgentDefinition DefineKnowledgeAgent(IConfiguration configu }; private static PromptAgentDefinition DefineCoderAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -266,7 +266,7 @@ You solve problem by writing and executing code. }; private static PromptAgentDefinition DefineWeatherAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/samples/03-workflows/Declarative/FunctionTools/Program.cs b/dotnet/samples/03-workflows/Declarative/FunctionTools/Program.cs index a5000635e4c..8218e7c0577 100644 --- a/dotnet/samples/03-workflows/Declarative/FunctionTools/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/FunctionTools/Program.cs @@ -70,7 +70,7 @@ await aiProjectClient.CreateAgentAsync( private static PromptAgentDefinition DefineMenuAgent(IConfiguration configuration, AIFunction[] functions) { PromptAgentDefinition agentDefinition = - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs b/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs index 0815f360b05..272e83f9832 100644 --- a/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/HostedWorkflow/Program.cs @@ -111,7 +111,7 @@ await agentClient.CreateAgentAsync( } private static PromptAgentDefinition DefineStudentAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -124,7 +124,7 @@ You have the math-skills of a 6th grader. }; private static PromptAgentDefinition DefineTeacherAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/samples/03-workflows/Declarative/InputArguments/Program.cs b/dotnet/samples/03-workflows/Declarative/InputArguments/Program.cs index 523865cc629..65a365b1438 100644 --- a/dotnet/samples/03-workflows/Declarative/InputArguments/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/InputArguments/Program.cs @@ -69,7 +69,7 @@ await aiProjectClient.CreateAgentAsync( } private static PromptAgentDefinition DefineLocationTriageAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -80,7 +80,7 @@ Your only job is to solicit a location from the user. }; private static PromptAgentDefinition DefineLocationCaptureAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -129,7 +129,7 @@ City level precision is sufficient. }; private static PromptAgentDefinition DefineLocationAwareAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { // Parameterized instructions reference the "location" input argument. Instructions = diff --git a/dotnet/samples/03-workflows/Declarative/InvokeFunctionTool/Program.cs b/dotnet/samples/03-workflows/Declarative/InvokeFunctionTool/Program.cs index 456bba0f888..fb207649779 100644 --- a/dotnet/samples/03-workflows/Declarative/InvokeFunctionTool/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/InvokeFunctionTool/Program.cs @@ -66,7 +66,7 @@ await aiProjectClient.CreateAgentAsync( private static PromptAgentDefinition DefineMenuAgent(IConfiguration configuration, AIFunction[] functions) { PromptAgentDefinition agentDefinition = - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/samples/03-workflows/Declarative/Marketing/Program.cs b/dotnet/samples/03-workflows/Declarative/Marketing/Program.cs index 43ff497930b..308303c1627 100644 --- a/dotnet/samples/03-workflows/Declarative/Marketing/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/Marketing/Program.cs @@ -68,7 +68,7 @@ await aiProjectClient.CreateAgentAsync( } private static PromptAgentDefinition DefineAnalystAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelFull)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -86,7 +86,7 @@ private static PromptAgentDefinition DefineAnalystAgent(IConfiguration configura }; private static PromptAgentDefinition DefineWriterAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelFull)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -97,7 +97,7 @@ Output should be short (around 150 words), output just the copy as a single text }; private static PromptAgentDefinition DefineEditorAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelFull)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/samples/03-workflows/Declarative/StudentTeacher/Program.cs b/dotnet/samples/03-workflows/Declarative/StudentTeacher/Program.cs index 80afd619113..28523c031e3 100644 --- a/dotnet/samples/03-workflows/Declarative/StudentTeacher/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/StudentTeacher/Program.cs @@ -63,7 +63,7 @@ await aiProjectClient.CreateAgentAsync( } private static PromptAgentDefinition DefineStudentAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ @@ -76,7 +76,7 @@ You have the math-skills of a 6th grader. }; private static PromptAgentDefinition DefineTeacherAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/samples/03-workflows/Declarative/ToolApproval/Program.cs b/dotnet/samples/03-workflows/Declarative/ToolApproval/Program.cs index 691c3d22439..544974e0964 100644 --- a/dotnet/samples/03-workflows/Declarative/ToolApproval/Program.cs +++ b/dotnet/samples/03-workflows/Declarative/ToolApproval/Program.cs @@ -59,7 +59,7 @@ await aiProjectClient.CreateAgentAsync( } private static PromptAgentDefinition DefineSearchAgent(IConfiguration configuration) => - new(configuration.GetValue(Application.Settings.FoundryModelMini)) + new(configuration.GetValue(Application.Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/src/Shared/Workflows/Settings/Application.cs b/dotnet/src/Shared/Workflows/Settings/Application.cs index de8eb515342..e219b0e92d8 100644 --- a/dotnet/src/Shared/Workflows/Settings/Application.cs +++ b/dotnet/src/Shared/Workflows/Settings/Application.cs @@ -12,10 +12,9 @@ internal static class Application /// public static class Settings { - public const string FoundryEndpoint = "FOUNDRY_PROJECT_ENDPOINT"; - public const string FoundryModelMini = "FOUNDRY_MODEL_DEPLOYMENT_NAME"; - public const string FoundryModelFull = "FOUNDRY_MEDIA_DEPLOYMENT_NAME"; - public const string FoundryGroundingTool = "FOUNDRY_CONNECTION_GROUNDING_TOOL"; + public const string FoundryEndpoint = "AZURE_AI_PROJECT_ENDPOINT"; + public const string FoundryModel = "AZURE_AI_MODEL_DEPLOYMENT_NAME"; + public const string FoundryGroundingTool = "AZURE_AI_BING_CONNECTION_ID"; } public static string GetInput(string[] args) diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs index 96795cc6a46..f7c654a5c10 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs @@ -21,10 +21,9 @@ public static class Names public static class Settings { - public const string FoundryEndpoint = "FOUNDRY_PROJECT_ENDPOINT"; - public const string FoundryModelMini = "FOUNDRY_MODEL_DEPLOYMENT_NAME"; - public const string FoundryModelFull = "FOUNDRY_MEDIA_DEPLOYMENT_NAME"; - public const string FoundryGroundingTool = "FOUNDRY_CONNECTION_GROUNDING_TOOL"; + public const string FoundryEndpoint = "AZURE_AI_PROJECT_ENDPOINT"; + public const string FoundryModel = "AZURE_AI_MODEL_DEPLOYMENT_NAME"; + public const string FoundryGroundingTool = "AZURE_AI_BING_CONNECTION_ID"; } public static AgentProvider Create(IConfiguration configuration, string providerType) => diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs index 4ac24c440a8..9dea4f314bb 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs @@ -36,7 +36,7 @@ await aiProjectClient.CreateAgentAsync( private PromptAgentDefinition DefineMenuAgent(AIFunction[] functions) { PromptAgentDefinition agentDefinition = - new(this.GetSetting(Settings.FoundryModelMini)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs index a9837947598..062436daf15 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs @@ -36,7 +36,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineAnalystAgent() => - new(this.GetSetting(Settings.FoundryModelFull)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ @@ -54,7 +54,7 @@ private PromptAgentDefinition DefineAnalystAgent() => }; private PromptAgentDefinition DefineWriterAgent() => - new(this.GetSetting(Settings.FoundryModelFull)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ @@ -65,7 +65,7 @@ Output should be short (around 150 words), output just the copy as a single text }; private PromptAgentDefinition DefineEditorAgent() => - new(this.GetSetting(Settings.FoundryModelFull)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs index 27cdca35154..13f9b0d3d69 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs @@ -30,7 +30,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineStudentAgent() => - new(this.GetSetting(Settings.FoundryModelMini)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ @@ -42,7 +42,7 @@ You have the math-skills of a 6th grader. }; private PromptAgentDefinition DefineTeacherAgent() => - new(this.GetSetting(Settings.FoundryModelMini)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs index 9706c6227c5..1a5e6b35a14 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs @@ -24,7 +24,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefinePoemAgent() => - new(this.GetSetting(Settings.FoundryModelMini)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs index 6cff2c15a01..022bec8db5a 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs @@ -24,5 +24,5 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineMenuAgent() => - new(this.GetSetting(Settings.FoundryModelFull)); + new(this.GetSetting(Settings.FoundryModel)); } diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs index d9557bd8f93..8211ddb9f72 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs @@ -24,7 +24,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineVisionAgent() => - new(this.GetSetting(Settings.FoundryModelFull)) + new(this.GetSetting(Settings.FoundryModel)) { Instructions = """ From 9a8b281c473d318a7c786d555334fe43a4ac8a76 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sat, 21 Feb 2026 19:04:52 -0800 Subject: [PATCH 04/15] Integration tests --- .../AnthropicConfiguration.cs | 17 --------- .../IntegrationTests/AzureAIConfiguration.cs | 15 -------- .../FoundryMemoryConfiguration.cs | 13 ------- .../IntegrationTests/Mem0Configuration.cs | 12 ------ .../IntegrationTests/OpenAIConfiguration.cs | 17 --------- dotnet/src/Shared/IntegrationTests/README.md | 27 ++++++++++++++ .../Shared/IntegrationTests/TestSettings.cs | 37 +++++++++++++++++++ .../Support/TestConfiguration.cs | 30 ++++++--------- .../AnthropicChatCompletionFixture.cs | 11 +++--- .../AnthropicSkillsIntegrationTests.cs | 10 ++--- .../AIProjectClientCreateTests.cs | 17 ++++----- .../AIProjectClientFixture.cs | 10 ++--- .../AzureAIAgentsPersistentCreateTests.cs | 17 ++++----- .../AzureAIAgentsPersistentFixture.cs | 6 +-- .../CopilotStudioFixture.cs | 10 +++-- .../CopilotStudioAgentConfiguration.cs | 15 -------- .../FoundryMemoryProviderTests.cs | 16 ++++---- ...s.AI.FoundryMemory.IntegrationTests.csproj | 1 - .../Mem0ProviderTests.cs | 11 +++--- ...oft.Agents.AI.Mem0.IntegrationTests.csproj | 1 - .../Agents/AgentProvider.cs | 10 +---- .../Agents/FunctionToolAgentProvider.cs | 3 +- .../Agents/MarketingAgentProvider.cs | 7 ++-- .../Agents/MathChatAgentProvider.cs | 5 ++- .../Agents/PoemAgentProvider.cs | 3 +- .../Agents/TestAgentProvider.cs | 3 +- .../Agents/VisionAgentProvider.cs | 3 +- .../Framework/IntegrationTest.cs | 5 ++- .../OpenAIAssistantClientExtensionsTests.cs | 25 ++++++------- .../OpenAIAssistantFixture.cs | 6 +-- .../OpenAIChatCompletionFixture.cs | 5 +-- .../OpenAIResponseFixture.cs | 6 +-- 32 files changed, 166 insertions(+), 208 deletions(-) delete mode 100644 dotnet/src/Shared/IntegrationTests/AnthropicConfiguration.cs delete mode 100644 dotnet/src/Shared/IntegrationTests/AzureAIConfiguration.cs delete mode 100644 dotnet/src/Shared/IntegrationTests/FoundryMemoryConfiguration.cs delete mode 100644 dotnet/src/Shared/IntegrationTests/Mem0Configuration.cs delete mode 100644 dotnet/src/Shared/IntegrationTests/OpenAIConfiguration.cs create mode 100644 dotnet/src/Shared/IntegrationTests/TestSettings.cs delete mode 100644 dotnet/tests/CopilotStudio.IntegrationTests/Support/CopilotStudioAgentConfiguration.cs diff --git a/dotnet/src/Shared/IntegrationTests/AnthropicConfiguration.cs b/dotnet/src/Shared/IntegrationTests/AnthropicConfiguration.cs deleted file mode 100644 index 2230be95ed4..00000000000 --- a/dotnet/src/Shared/IntegrationTests/AnthropicConfiguration.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace Shared.IntegrationTests; - -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. -#pragma warning disable CA1812 // Internal class that is apparently never instantiated. - -internal sealed class AnthropicConfiguration -{ - public string? ServiceId { get; set; } - - public string ChatModelId { get; set; } - - public string ChatReasoningModelId { get; set; } - - public string ApiKey { get; set; } -} diff --git a/dotnet/src/Shared/IntegrationTests/AzureAIConfiguration.cs b/dotnet/src/Shared/IntegrationTests/AzureAIConfiguration.cs deleted file mode 100644 index cfdc7aff7bc..00000000000 --- a/dotnet/src/Shared/IntegrationTests/AzureAIConfiguration.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace Shared.IntegrationTests; - -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. -#pragma warning disable CA1812 // Internal class that is apparently never instantiated. - -internal sealed class AzureAIConfiguration -{ - public string Endpoint { get; set; } - - public string DeploymentName { get; set; } - - public string BingConnectionId { get; set; } -} diff --git a/dotnet/src/Shared/IntegrationTests/FoundryMemoryConfiguration.cs b/dotnet/src/Shared/IntegrationTests/FoundryMemoryConfiguration.cs deleted file mode 100644 index 957f1bfa4cb..00000000000 --- a/dotnet/src/Shared/IntegrationTests/FoundryMemoryConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace Shared.IntegrationTests; - -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. -#pragma warning disable CA1812 // Internal class that is apparently never instantiated. - -internal sealed class FoundryMemoryConfiguration -{ - public string Endpoint { get; set; } - public string MemoryStoreName { get; set; } - public string? DeploymentName { get; set; } -} diff --git a/dotnet/src/Shared/IntegrationTests/Mem0Configuration.cs b/dotnet/src/Shared/IntegrationTests/Mem0Configuration.cs deleted file mode 100644 index 052a38f1131..00000000000 --- a/dotnet/src/Shared/IntegrationTests/Mem0Configuration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace Shared.IntegrationTests; - -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. -#pragma warning disable CA1812 // Internal class that is apparently never instantiated. - -internal sealed class Mem0Configuration -{ - public string ServiceUri { get; set; } - public string ApiKey { get; set; } -} diff --git a/dotnet/src/Shared/IntegrationTests/OpenAIConfiguration.cs b/dotnet/src/Shared/IntegrationTests/OpenAIConfiguration.cs deleted file mode 100644 index 34bc08330e1..00000000000 --- a/dotnet/src/Shared/IntegrationTests/OpenAIConfiguration.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace Shared.IntegrationTests; - -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. -#pragma warning disable CA1812 // Internal class that is apparently never instantiated. - -internal sealed class OpenAIConfiguration -{ - public string? ServiceId { get; set; } - - public string ChatModelId { get; set; } - - public string ChatReasoningModelId { get; set; } - - public string ApiKey { get; set; } -} diff --git a/dotnet/src/Shared/IntegrationTests/README.md b/dotnet/src/Shared/IntegrationTests/README.md index ea3ed5f3a38..b77a1a2de44 100644 --- a/dotnet/src/Shared/IntegrationTests/README.md +++ b/dotnet/src/Shared/IntegrationTests/README.md @@ -9,3 +9,30 @@ To use this in your project, add the following to your `.csproj` file: true ``` + +## Configuration + +Integration tests use flat environment variable names for configuration. +Use `TestConfiguration.GetValue(key)` or `TestConfiguration.GetRequiredValue(key)` to access values. + +Available keys are defined as constants in `TestSettings.cs`: + +| Key | Description | +|---|---| +| `ANTHROPIC_API_KEY` | API key for Anthropic | +| `ANTHROPIC_CHAT_MODEL_NAME` | Anthropic chat model name | +| `ANTHROPIC_REASONING_MODEL_NAME` | Anthropic reasoning model name | +| `ANTHROPIC_SERVICE_ID` | Anthropic service ID | +| `AZURE_AI_BING_CONNECTION_ID` | Azure AI Bing connection ID | +| `AZURE_AI_MEMORY_STORE_ID` | Azure AI Memory store name | +| `AZURE_AI_MODEL_DEPLOYMENT_NAME` | Azure AI model deployment name | +| `AZURE_AI_PROJECT_ENDPOINT` | Azure AI project endpoint | +| `COPILOTSTUDIO_AGENT_APP_ID` | Copilot Studio agent app ID | +| `COPILOTSTUDIO_DIRECT_CONNECT_URL` | Copilot Studio direct connect URL | +| `COPILOTSTUDIO_TENANT_ID` | Copilot Studio tenant ID | +| `MEM0_API_KEY` | API key for Mem0 | +| `MEM0_ENDPOINT` | Mem0 service endpoint | +| `OPENAI_API_KEY` | API key for OpenAI | +| `OPENAI_CHAT_MODEL_NAME` | OpenAI chat model name | +| `OPENAI_REASONING_MODEL_NAME` | OpenAI reasoning model name | +| `OPENAI_SERVICE_ID` | OpenAI service ID | diff --git a/dotnet/src/Shared/IntegrationTests/TestSettings.cs b/dotnet/src/Shared/IntegrationTests/TestSettings.cs new file mode 100644 index 00000000000..880db9d1cd5 --- /dev/null +++ b/dotnet/src/Shared/IntegrationTests/TestSettings.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft. All rights reserved. + +namespace Shared.IntegrationTests; + +/// +/// Constants for integration test configuration keys. +/// Values are resolved from environment variables and user secrets. +/// +internal static class TestSettings +{ + // Anthropic + public const string AnthropicApiKey = "ANTHROPIC_API_KEY"; + public const string AnthropicChatModelName = "ANTHROPIC_CHAT_MODEL_NAME"; + public const string AnthropicReasoningModelName = "ANTHROPIC_REASONING_MODEL_NAME"; + public const string AnthropicServiceId = "ANTHROPIC_SERVICE_ID"; + + // Azure AI (Foundry) + public const string AzureAIBingConnectionId = "AZURE_AI_BING_CONNECTION_ID"; + public const string AzureAIMemoryStoreId = "AZURE_AI_MEMORY_STORE_ID"; + public const string AzureAIModelDeploymentName = "AZURE_AI_MODEL_DEPLOYMENT_NAME"; + public const string AzureAIProjectEndpoint = "AZURE_AI_PROJECT_ENDPOINT"; + + // Copilot Studio + public const string CopilotStudioAgentAppId = "COPILOTSTUDIO_AGENT_APP_ID"; + public const string CopilotStudioDirectConnectUrl = "COPILOTSTUDIO_DIRECT_CONNECT_URL"; + public const string CopilotStudioTenantId = "COPILOTSTUDIO_TENANT_ID"; + + // Mem0 + public const string Mem0ApiKey = "MEM0_API_KEY"; + public const string Mem0Endpoint = "MEM0_ENDPOINT"; + + // OpenAI + public const string OpenAIApiKey = "OPENAI_API_KEY"; + public const string OpenAIChatModelName = "OPENAI_CHAT_MODEL_NAME"; + public const string OpenAIReasoningModelName = "OPENAI_REASONING_MODEL_NAME"; + public const string OpenAIServiceId = "OPENAI_SERVICE_ID"; +} diff --git a/dotnet/tests/AgentConformance.IntegrationTests/Support/TestConfiguration.cs b/dotnet/tests/AgentConformance.IntegrationTests/Support/TestConfiguration.cs index e56eeff3cb9..dc887e3a1b7 100644 --- a/dotnet/tests/AgentConformance.IntegrationTests/Support/TestConfiguration.cs +++ b/dotnet/tests/AgentConformance.IntegrationTests/Support/TestConfiguration.cs @@ -11,30 +11,24 @@ namespace AgentConformance.IntegrationTests.Support; public sealed class TestConfiguration { private static readonly IConfiguration s_configuration = new ConfigurationBuilder() - .AddJsonFile(path: "testsettings.json", optional: true) .AddJsonFile(path: "testsettings.development.json", optional: true) .AddEnvironmentVariables() .AddUserSecrets() .Build(); /// - /// Loads the type of configuration using a section name based on the type name. + /// Gets a configuration value by its flat key name. /// - /// The type of config to load. - /// The loaded configuration section of the specified type. - /// Thrown if the configuration section cannot be loaded. - public static T LoadSection() - { - var configType = typeof(T); - var configTypeName = configType.Name; + /// The configuration key. + /// The configuration value, or if not found. + public static string? GetValue(string key) => s_configuration[key]; - const string TrimText = "Configuration"; - if (configTypeName.EndsWith(TrimText, StringComparison.OrdinalIgnoreCase)) - { - configTypeName = configTypeName.Substring(0, configTypeName.Length - TrimText.Length); - } - - return s_configuration.GetRequiredSection(configTypeName).Get() ?? - throw new InvalidOperationException($"Could not load config for {configTypeName}."); - } + /// + /// Gets a required configuration value by its flat key name. + /// + /// The configuration key. + /// The configuration value. + /// Thrown if the configuration value is not found. + public static string GetRequiredValue(string key) => + s_configuration[key] ?? throw new InvalidOperationException($"Configuration key '{key}' is required but was not found."); } diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs index f36cb119d95..16bb97d2180 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; using System.Linq; @@ -19,7 +19,6 @@ public class AnthropicChatCompletionFixture : IChatClientAgentFixture // All tests for Anthropic are intended to be ran locally as the CI pipeline for Anthropic is not setup. internal const string SkipReason = "Integrations tests for local execution only"; - private static readonly AnthropicConfiguration s_config = TestConfiguration.LoadSection(); private readonly bool _useReasoningModel; private readonly bool _useBeta; @@ -52,7 +51,9 @@ public Task CreateChatClientAgentAsync( string instructions = "You are a helpful assistant.", IList? aiTools = null) { - var anthropicClient = new AnthropicClient() { ApiKey = s_config.ApiKey }; + var anthropicClient = new AnthropicClient() { ApiKey = TestConfiguration.GetRequiredValue(TestSettings.AnthropicApiKey) }; + var chatModelName = TestConfiguration.GetRequiredValue(TestSettings.AnthropicChatModelName); + var reasoningModelName = TestConfiguration.GetRequiredValue(TestSettings.AnthropicReasoningModelName); IChatClient? chatClient = this._useBeta ? anthropicClient @@ -63,7 +64,7 @@ public Task CreateChatClientAgentAsync( => options.RawRepresentationFactory = _ => new Anthropic.Models.Beta.Messages.MessageCreateParams() { - Model = options.ModelId ?? (this._useReasoningModel ? s_config.ChatReasoningModelId : s_config.ChatModelId), + Model = options.ModelId ?? (this._useReasoningModel ? reasoningModelName : chatModelName), MaxTokens = options.MaxOutputTokens ?? 4096, Messages = [], Thinking = this._useReasoningModel @@ -78,7 +79,7 @@ public Task CreateChatClientAgentAsync( => options.RawRepresentationFactory = _ => new Anthropic.Models.Messages.MessageCreateParams() { - Model = options.ModelId ?? (this._useReasoningModel ? s_config.ChatReasoningModelId : s_config.ChatModelId), + Model = options.ModelId ?? (this._useReasoningModel ? reasoningModelName : chatModelName), MaxTokens = options.MaxOutputTokens ?? 4096, Messages = [], Thinking = this._useReasoningModel diff --git a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs index a6a96bd234a..50474a1eeb0 100644 --- a/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs +++ b/dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicSkillsIntegrationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System.Threading.Tasks; using AgentConformance.IntegrationTests.Support; @@ -22,14 +22,12 @@ public sealed class AnthropicSkillsIntegrationTests // All tests for Anthropic are intended to be ran locally as the CI pipeline for Anthropic is not setup. private const string SkipReason = "Integrations tests for local execution only"; - private static readonly AnthropicConfiguration s_config = TestConfiguration.LoadSection(); - [Fact(Skip = SkipReason)] public async Task CreateAgentWithPptxSkillAsync() { // Arrange - AnthropicClient anthropicClient = new() { ApiKey = s_config.ApiKey }; - string model = s_config.ChatModelId; + AnthropicClient anthropicClient = new() { ApiKey = TestConfiguration.GetRequiredValue(TestSettings.AnthropicApiKey) }; + string model = TestConfiguration.GetRequiredValue(TestSettings.AnthropicChatModelName); BetaSkillParams pptxSkill = new() { @@ -57,7 +55,7 @@ public async Task CreateAgentWithPptxSkillAsync() public async Task ListAnthropicManagedSkillsAsync() { // Arrange - AnthropicClient anthropicClient = new() { ApiKey = s_config.ApiKey }; + AnthropicClient anthropicClient = new() { ApiKey = TestConfiguration.GetRequiredValue(TestSettings.AnthropicApiKey) }; // Act SkillListPage skills = await anthropicClient.Beta.Skills.List( diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientCreateTests.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientCreateTests.cs index d70d3d949d7..ec4103f6a8e 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientCreateTests.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientCreateTests.cs @@ -17,8 +17,7 @@ namespace AzureAI.IntegrationTests; public class AIProjectClientCreateTests { - private static readonly AzureAIConfiguration s_config = TestConfiguration.LoadSection(); - private readonly AIProjectClient _client = new(new Uri(s_config.Endpoint), new AzureCliCredential()); + private readonly AIProjectClient _client = new(new Uri(TestConfiguration.GetRequiredValue(TestSettings.AzureAIProjectEndpoint)), new AzureCliCredential()); [Theory] [InlineData("CreateWithChatClientAgentOptionsAsync")] @@ -34,7 +33,7 @@ public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string create var agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._client.CreateAIAgentAsync( - model: s_config.DeploymentName, + model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), options: new ChatClientAgentOptions() { Name = AgentName, @@ -43,7 +42,7 @@ public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string create }), "CreateWithFoundryOptionsAsync" => await this._client.CreateAIAgentAsync( name: AgentName, - creationOptions: new AgentVersionCreationOptions(new PromptAgentDefinition(s_config.DeploymentName) { Instructions = AgentInstructions }) { Description = AgentDescription }), + creationOptions: new AgentVersionCreationOptions(new PromptAgentDefinition(TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName)) { Instructions = AgentInstructions }) { Description = AgentDescription }), _ => throw new InvalidOperationException($"Unknown create mechanism: {createMechanism}") }; @@ -101,12 +100,12 @@ You are a helpful agent that can help fetch data from files you know about. var agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._client.CreateAIAgentAsync( - model: s_config.DeploymentName, + model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), name: AgentName, instructions: AgentInstructions, tools: [new HostedFileSearchTool() { Inputs = [new HostedVectorStoreContent(vectorStoreMetadata.Value.Id)] }]), "CreateWithFoundryOptionsAsync" => await this._client.CreateAIAgentAsync( - model: s_config.DeploymentName, + model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), name: AgentName, instructions: AgentInstructions, tools: [ResponseTool.CreateFileSearchTool(vectorStoreIds: [vectorStoreMetadata.Value.Id]).AsAITool()]), @@ -161,13 +160,13 @@ and report the SECRET_NUMBER value it prints. Respond only with the number. { // Hosted tool path (tools supplied via ChatClientAgentOptions) "CreateWithChatClientAgentOptionsAsync" => await this._client.CreateAIAgentAsync( - model: s_config.DeploymentName, + model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), name: AgentName, instructions: AgentInstructions, tools: [new HostedCodeInterpreterTool() { Inputs = [new HostedFileContent(uploadedCodeFile.Id)] }]), // Foundry (definitions + resources provided directly) "CreateWithFoundryOptionsAsync" => await this._client.CreateAIAgentAsync( - model: s_config.DeploymentName, + model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), name: AgentName, instructions: AgentInstructions, tools: [ResponseTool.CreateCodeInterpreterTool(new CodeInterpreterToolContainer(CodeInterpreterToolContainerConfiguration.CreateAutomaticContainerConfiguration([uploadedCodeFile.Id]))).AsAITool()]), @@ -204,7 +203,7 @@ public async Task CreateAgent_CreatesAgentWithAIFunctionToolsAsync(string create ChatClientAgent agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._client.CreateAIAgentAsync( - model: s_config.DeploymentName, + model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), options: new ChatClientAgentOptions() { Name = AgentName, diff --git a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs index a13af9c9405..64a8e86c8a8 100644 --- a/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs +++ b/dotnet/tests/AzureAI.IntegrationTests/AIProjectClientFixture.cs @@ -18,8 +18,6 @@ namespace AzureAI.IntegrationTests; public class AIProjectClientFixture : IChatClientAgentFixture { - private static readonly AzureAIConfiguration s_config = TestConfiguration.LoadSection(); - private ChatClientAgent _agent = null!; private AIProjectClient _client = null!; @@ -118,14 +116,14 @@ public async Task CreateChatClientAgentAsync( string instructions = "You are a helpful assistant.", IList? aiTools = null) { - return await this._client.CreateAIAgentAsync(GenerateUniqueAgentName(name), model: s_config.DeploymentName, instructions: instructions, tools: aiTools); + return await this._client.CreateAIAgentAsync(GenerateUniqueAgentName(name), model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), instructions: instructions, tools: aiTools); } public async Task CreateChatClientAgentAsync(ChatClientAgentOptions options) { options.Name ??= GenerateUniqueAgentName("HelpfulAssistant"); - return await this._client.CreateAIAgentAsync(model: s_config.DeploymentName, options); + return await this._client.CreateAIAgentAsync(model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), options); } public static string GenerateUniqueAgentName(string baseName) => @@ -170,13 +168,13 @@ public Task DisposeAsync() public virtual async Task InitializeAsync() { - this._client = new(new Uri(s_config.Endpoint), new AzureCliCredential()); + this._client = new(new Uri(TestConfiguration.GetRequiredValue(TestSettings.AzureAIProjectEndpoint)), new AzureCliCredential()); this._agent = await this.CreateChatClientAgentAsync(); } public async Task InitializeAsync(ChatClientAgentOptions options) { - this._client = new(new Uri(s_config.Endpoint), new AzureCliCredential()); + this._client = new(new Uri(TestConfiguration.GetRequiredValue(TestSettings.AzureAIProjectEndpoint)), new AzureCliCredential()); this._agent = await this.CreateChatClientAgentAsync(options); } } diff --git a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentCreateTests.cs b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentCreateTests.cs index 05b87539dab..ab2e1848a55 100644 --- a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentCreateTests.cs +++ b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentCreateTests.cs @@ -15,8 +15,7 @@ namespace AzureAIAgentsPersistent.IntegrationTests; public class AzureAIAgentsPersistentCreateTests { - private static readonly AzureAIConfiguration s_config = TestConfiguration.LoadSection(); - private readonly PersistentAgentsClient _persistentAgentsClient = new(s_config.Endpoint, new AzureCliCredential()); + private readonly PersistentAgentsClient _persistentAgentsClient = new(TestConfiguration.GetRequiredValue(TestSettings.AzureAIProjectEndpoint), new AzureCliCredential()); [Theory] [InlineData("CreateWithChatClientAgentOptionsAsync")] @@ -32,7 +31,7 @@ public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string create var agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._persistentAgentsClient.CreateAIAgentAsync( - s_config.DeploymentName, + TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), options: new ChatClientAgentOptions() { ChatOptions = new() { Instructions = AgentInstructions }, @@ -40,7 +39,7 @@ public async Task CreateAgent_CreatesAgentWithCorrectMetadataAsync(string create Description = AgentDescription }), "CreateWithFoundryOptionsAsync" => await this._persistentAgentsClient.CreateAIAgentAsync( - s_config.DeploymentName, + TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), instructions: AgentInstructions, name: AgentName, description: AgentDescription), @@ -99,7 +98,7 @@ You are a helpful agent that can help fetch data from files you know about. var agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._persistentAgentsClient.CreateAIAgentAsync( - s_config.DeploymentName, + TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -109,7 +108,7 @@ You are a helpful agent that can help fetch data from files you know about. } }), "CreateWithFoundryOptionsAsync" => await this._persistentAgentsClient.CreateAIAgentAsync( - s_config.DeploymentName, + TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), instructions: AgentInstructions, tools: [new FileSearchToolDefinition()], toolResources: new ToolResources() { FileSearch = new([vectorStoreMetadata.Value.Id], null) }), @@ -162,7 +161,7 @@ and report the SECRET_NUMBER value it prints. Respond only with the number. { // Hosted tool path (tools supplied via ChatClientAgentOptions) "CreateWithChatClientAgentOptionsAsync" => await this._persistentAgentsClient.CreateAIAgentAsync( - s_config.DeploymentName, + TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -172,7 +171,7 @@ and report the SECRET_NUMBER value it prints. Respond only with the number. } }), "CreateWithFoundryOptionsAsync" => await this._persistentAgentsClient.CreateAIAgentAsync( - s_config.DeploymentName, + TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), instructions: AgentInstructions, tools: [new CodeInterpreterToolDefinition()], toolResources: new ToolResources() { CodeInterpreter = toolResource }), @@ -208,7 +207,7 @@ public async Task CreateAgent_CreatesAgentWithAIFunctionToolsAsync(string create ChatClientAgent agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._persistentAgentsClient.CreateAIAgentAsync( - s_config.DeploymentName, + TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), options: new ChatClientAgentOptions() { ChatOptions = new() diff --git a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs index 3e3272d9513..5de41925577 100644 --- a/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs +++ b/dotnet/tests/AzureAIAgentsPersistent.IntegrationTests/AzureAIAgentsPersistentFixture.cs @@ -15,8 +15,6 @@ namespace AzureAIAgentsPersistent.IntegrationTests; public class AzureAIAgentsPersistentFixture : IChatClientAgentFixture { - private static readonly AzureAIConfiguration s_config = TestConfiguration.LoadSection(); - private ChatClientAgent _agent = null!; private PersistentAgentsClient _persistentAgentsClient = null!; @@ -57,7 +55,7 @@ public async Task CreateChatClientAgentAsync( IList? aiTools = null) { var persistentAgentResponse = await this._persistentAgentsClient.Administration.CreateAgentAsync( - model: s_config.DeploymentName, + model: TestConfiguration.GetRequiredValue(TestSettings.AzureAIModelDeploymentName), name: name, instructions: instructions); @@ -98,7 +96,7 @@ public Task DisposeAsync() public async Task InitializeAsync() { - this._persistentAgentsClient = new(s_config.Endpoint, new AzureCliCredential()); + this._persistentAgentsClient = new(TestConfiguration.GetRequiredValue(TestSettings.AzureAIProjectEndpoint), new AzureCliCredential()); this._agent = await this.CreateChatClientAgentAsync(); } } diff --git a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs index dd5fe46ecc2..8dfeba19726 100644 --- a/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs +++ b/dotnet/tests/CopilotStudio.IntegrationTests/CopilotStudioFixture.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; @@ -13,6 +13,7 @@ using Microsoft.Extensions.AI; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; +using Shared.IntegrationTests; namespace CopilotStudio.IntegrationTests; @@ -31,10 +32,11 @@ public Task InitializeAsync() { const string CopilotStudioHttpClientName = nameof(CopilotStudioAgent); - var config = TestConfiguration.LoadSection(); - var settings = new CopilotStudioConnectionSettings(config.TenantId, config.AppClientId) + var settings = new CopilotStudioConnectionSettings( + TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioTenantId), + TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioAgentAppId)) { - DirectConnectUrl = config.DirectConnectUrl, + DirectConnectUrl = TestConfiguration.GetRequiredValue(TestSettings.CopilotStudioDirectConnectUrl), }; ServiceCollection services = new(); diff --git a/dotnet/tests/CopilotStudio.IntegrationTests/Support/CopilotStudioAgentConfiguration.cs b/dotnet/tests/CopilotStudio.IntegrationTests/Support/CopilotStudioAgentConfiguration.cs deleted file mode 100644 index 670ed5d7062..00000000000 --- a/dotnet/tests/CopilotStudio.IntegrationTests/Support/CopilotStudioAgentConfiguration.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace CopilotStudio.IntegrationTests.Support; - -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. -#pragma warning disable CA1812 // Internal class that is apparently never instantiated. - -internal sealed class CopilotStudioAgentConfiguration -{ - public string DirectConnectUrl { get; set; } - - public string TenantId { get; set; } - - public string AppClientId { get; set; } -} diff --git a/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/FoundryMemoryProviderTests.cs b/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/FoundryMemoryProviderTests.cs index d89001d3b9f..4b1838335c9 100644 --- a/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/FoundryMemoryProviderTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/FoundryMemoryProviderTests.cs @@ -29,21 +29,21 @@ public sealed class FoundryMemoryProviderTests : IDisposable public FoundryMemoryProviderTests() { IConfigurationRoot configuration = new ConfigurationBuilder() - .AddJsonFile(path: "testsettings.json", optional: true, reloadOnChange: true) .AddJsonFile(path: "testsettings.development.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .AddUserSecrets(optional: true) .Build(); - var foundrySettings = configuration.GetSection("FoundryMemory").Get(); + var endpoint = configuration[TestSettings.AzureAIProjectEndpoint]; + var memoryStoreName = configuration[TestSettings.AzureAIMemoryStoreId]; + var deploymentName = configuration[TestSettings.AzureAIModelDeploymentName]; - if (foundrySettings is not null && - !string.IsNullOrWhiteSpace(foundrySettings.Endpoint) && - !string.IsNullOrWhiteSpace(foundrySettings.MemoryStoreName)) + if (!string.IsNullOrWhiteSpace(endpoint) && + !string.IsNullOrWhiteSpace(memoryStoreName)) { - this._client = new AIProjectClient(new Uri(foundrySettings.Endpoint), new AzureCliCredential()); - this._memoryStoreName = foundrySettings.MemoryStoreName; - this._deploymentName = foundrySettings.DeploymentName ?? "gpt-4.1-mini"; + this._client = new AIProjectClient(new Uri(endpoint), new AzureCliCredential()); + this._memoryStoreName = memoryStoreName; + this._deploymentName = deploymentName ?? "gpt-4.1-mini"; } } diff --git a/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests.csproj b/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests.csproj index a28fea34906..4bf96a5b352 100644 --- a/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests/Microsoft.Agents.AI.FoundryMemory.IntegrationTests.csproj @@ -12,7 +12,6 @@ - diff --git a/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Mem0ProviderTests.cs b/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Mem0ProviderTests.cs index 72e9f6bdff3..f46ca4b651e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Mem0ProviderTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Mem0ProviderTests.cs @@ -27,19 +27,20 @@ public sealed class Mem0ProviderTests : IDisposable public Mem0ProviderTests() { IConfigurationRoot configuration = new ConfigurationBuilder() - .AddJsonFile(path: "testsettings.json", optional: true, reloadOnChange: true) .AddJsonFile(path: "testsettings.development.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .AddUserSecrets(optional: true) .Build(); - var mem0Settings = configuration.GetSection("Mem0").Get(); + var serviceUri = configuration[TestSettings.Mem0Endpoint]; + var apiKey = configuration[TestSettings.Mem0ApiKey]; + this._httpClient = new HttpClient(); - if (mem0Settings is not null && !string.IsNullOrWhiteSpace(mem0Settings.ServiceUri) && !string.IsNullOrWhiteSpace(mem0Settings.ApiKey)) + if (!string.IsNullOrWhiteSpace(serviceUri) && !string.IsNullOrWhiteSpace(apiKey)) { - this._httpClient.BaseAddress = new Uri(mem0Settings.ServiceUri); - this._httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token", mem0Settings.ApiKey); + this._httpClient.BaseAddress = new Uri(serviceUri); + this._httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token", apiKey); } } diff --git a/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Microsoft.Agents.AI.Mem0.IntegrationTests.csproj b/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Microsoft.Agents.AI.Mem0.IntegrationTests.csproj index 99b028963aa..330671825f2 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Microsoft.Agents.AI.Mem0.IntegrationTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.Mem0.IntegrationTests/Microsoft.Agents.AI.Mem0.IntegrationTests.csproj @@ -10,7 +10,6 @@ - diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs index f7c654a5c10..a4198d3a4c8 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/AgentProvider.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Azure.AI.Projects.OpenAI; using Microsoft.Extensions.Configuration; +using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; @@ -19,13 +20,6 @@ public static class Names public const string Vision = "VISION"; } - public static class Settings - { - public const string FoundryEndpoint = "AZURE_AI_PROJECT_ENDPOINT"; - public const string FoundryModel = "AZURE_AI_MODEL_DEPLOYMENT_NAME"; - public const string FoundryGroundingTool = "AZURE_AI_BING_CONNECTION_ID"; - } - public static AgentProvider Create(IConfiguration configuration, string providerType) => providerType.ToUpperInvariant() switch { @@ -39,7 +33,7 @@ public static AgentProvider Create(IConfiguration configuration, string provider public async ValueTask CreateAgentsAsync() { - Uri foundryEndpoint = new(this.GetSetting(Settings.FoundryEndpoint)); + Uri foundryEndpoint = new(this.GetSetting(TestSettings.AzureAIProjectEndpoint)); await foreach (AgentVersion agent in this.CreateAgentsAsync(foundryEndpoint)) { diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs index 9dea4f314bb..8198618b653 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/FunctionToolAgentProvider.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.Configuration; using OpenAI.Responses; using Shared.Foundry; +using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; @@ -36,7 +37,7 @@ await aiProjectClient.CreateAgentAsync( private PromptAgentDefinition DefineMenuAgent(AIFunction[] functions) { PromptAgentDefinition agentDefinition = - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs index 062436daf15..f84a40ae23c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MarketingAgentProvider.cs @@ -7,6 +7,7 @@ using Azure.Identity; using Microsoft.Extensions.Configuration; using Shared.Foundry; +using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; @@ -36,7 +37,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineAnalystAgent() => - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ @@ -54,7 +55,7 @@ private PromptAgentDefinition DefineAnalystAgent() => }; private PromptAgentDefinition DefineWriterAgent() => - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ @@ -65,7 +66,7 @@ Output should be short (around 150 words), output just the copy as a single text }; private PromptAgentDefinition DefineEditorAgent() => - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs index 13f9b0d3d69..92cea7d76a4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/MathChatAgentProvider.cs @@ -7,6 +7,7 @@ using Azure.Identity; using Microsoft.Extensions.Configuration; using Shared.Foundry; +using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; @@ -30,7 +31,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineStudentAgent() => - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ @@ -42,7 +43,7 @@ You have the math-skills of a 6th grader. }; private PromptAgentDefinition DefineTeacherAgent() => - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs index 1a5e6b35a14..8882709a03c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/PoemAgentProvider.cs @@ -7,6 +7,7 @@ using Azure.Identity; using Microsoft.Extensions.Configuration; using Shared.Foundry; +using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; @@ -24,7 +25,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefinePoemAgent() => - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs index 022bec8db5a..03b201d440c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/TestAgentProvider.cs @@ -7,6 +7,7 @@ using Azure.Identity; using Microsoft.Extensions.Configuration; using Shared.Foundry; +using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; @@ -24,5 +25,5 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineMenuAgent() => - new(this.GetSetting(Settings.FoundryModel)); + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)); } diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs index 8211ddb9f72..1c09ea92471 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Agents/VisionAgentProvider.cs @@ -7,6 +7,7 @@ using Azure.Identity; using Microsoft.Extensions.Configuration; using Shared.Foundry; +using Shared.IntegrationTests; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Agents; @@ -24,7 +25,7 @@ await aiProjectClient.CreateAgentAsync( } private PromptAgentDefinition DefineVisionAgent() => - new(this.GetSetting(Settings.FoundryModel)) + new(this.GetSetting(TestSettings.AzureAIModelDeploymentName)) { Instructions = """ diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs index 662575cdf46..6eaa4391d9a 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Framework/IntegrationTest.cs @@ -10,6 +10,7 @@ using Microsoft.Agents.ObjectModel; using Microsoft.Extensions.AI; using Microsoft.Extensions.Configuration; +using Shared.IntegrationTests; using Xunit.Abstractions; namespace Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.Framework; @@ -30,8 +31,8 @@ protected IntegrationTest(ITestOutputHelper output) this.Output = new TestOutputAdapter(output); this.TestEndpoint = new Uri( - this.Configuration?[AgentProvider.Settings.FoundryEndpoint] ?? - throw new InvalidOperationException($"Undefined configuration setting: {AgentProvider.Settings.FoundryEndpoint}")); + this.Configuration?[TestSettings.AzureAIProjectEndpoint] ?? + throw new InvalidOperationException($"Undefined configuration setting: {TestSettings.AzureAIProjectEndpoint}")); Console.SetOut(this.Output); SetProduct(); } diff --git a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs index 02f5f36a761..2e92cc6d424 100644 --- a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs +++ b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs @@ -19,9 +19,8 @@ namespace OpenAIAssistant.IntegrationTests; public class OpenAIAssistantClientExtensionsTests { - private static readonly OpenAIConfiguration s_config = TestConfiguration.LoadSection(); - private readonly AssistantClient _assistantClient = new OpenAIClient(s_config.ApiKey).GetAssistantClient(); - private readonly OpenAIFileClient _fileClient = new OpenAIClient(s_config.ApiKey).GetOpenAIFileClient(); + private readonly AssistantClient _assistantClient = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)).GetAssistantClient(); + private readonly OpenAIFileClient _fileClient = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)).GetOpenAIFileClient(); [Theory] [InlineData("CreateWithChatClientAgentOptionsAsync")] @@ -39,7 +38,7 @@ public async Task CreateAIAgentAsync_WithAIFunctionTool_InvokesFunctionAsync(str var agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -49,7 +48,7 @@ public async Task CreateAIAgentAsync_WithAIFunctionTool_InvokesFunctionAsync(str } }), "CreateWithChatClientAgentOptionsSync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -59,7 +58,7 @@ public async Task CreateAIAgentAsync_WithAIFunctionTool_InvokesFunctionAsync(str } }), "CreateWithParamsAsync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), instructions: AgentInstructions, tools: [weatherFunction]), _ => throw new InvalidOperationException($"Unknown create mechanism: {createMechanism}") @@ -106,7 +105,7 @@ public async Task CreateAIAgentAsync_WithHostedCodeInterpreter_RunsCodeAsync(str var agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -116,7 +115,7 @@ public async Task CreateAIAgentAsync_WithHostedCodeInterpreter_RunsCodeAsync(str } }), "CreateWithChatClientAgentOptionsSync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -126,7 +125,7 @@ public async Task CreateAIAgentAsync_WithHostedCodeInterpreter_RunsCodeAsync(str } }), "CreateWithParamsAsync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), instructions: Instructions, tools: [codeInterpreterTool]), _ => throw new InvalidOperationException($"Unknown create mechanism: {createMechanism}") @@ -168,7 +167,7 @@ You are a helpful agent that can help fetch data from files you know about. string uploadedFileId = uploadResult.Value.Id; // Create a vector store backing the file search (HostedFileSearchTool requires a vector store id). - var vectorStoreClient = new OpenAIClient(s_config.ApiKey).GetVectorStoreClient(); + var vectorStoreClient = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)).GetVectorStoreClient(); var vectorStoreCreate = await vectorStoreClient.CreateVectorStoreAsync(options: new VectorStoreCreationOptions() { Name = "WordCodeLookup_VectorStore", @@ -184,7 +183,7 @@ You are a helpful agent that can help fetch data from files you know about. var agent = createMechanism switch { "CreateWithChatClientAgentOptionsAsync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -194,7 +193,7 @@ You are a helpful agent that can help fetch data from files you know about. } }), "CreateWithChatClientAgentOptionsSync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), options: new ChatClientAgentOptions() { ChatOptions = new() @@ -204,7 +203,7 @@ You are a helpful agent that can help fetch data from files you know about. } }), "CreateWithParamsAsync" => await this._assistantClient.CreateAIAgentAsync( - model: s_config.ChatModelId!, + model: TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), instructions: Instructions, tools: [fileSearchTool]), _ => throw new InvalidOperationException($"Unknown create mechanism: {createMechanism}") diff --git a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs index bb58f09fb4e..b2ae9b81e83 100644 --- a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs +++ b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantFixture.cs @@ -14,8 +14,6 @@ namespace OpenAIAssistant.IntegrationTests; public class OpenAIAssistantFixture : IChatClientAgentFixture { - private static readonly OpenAIConfiguration s_config = TestConfiguration.LoadSection(); - private AssistantClient? _assistantClient; private ChatClientAgent _agent = null!; @@ -49,7 +47,7 @@ public async Task CreateChatClientAgentAsync( { var assistant = await this._assistantClient!.CreateAssistantAsync( - s_config.ChatModelId!, + TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName), new AssistantCreationOptions() { Name = name, @@ -81,7 +79,7 @@ public Task DeleteSessionAsync(AgentSession session) public async Task InitializeAsync() { - var client = new OpenAIClient(s_config.ApiKey); + var client = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)); this._assistantClient = client.GetAssistantClient(); this._agent = await this.CreateChatClientAgentAsync(); diff --git a/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs b/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs index 96a9a17ae8f..b8a9388b277 100644 --- a/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs +++ b/dotnet/tests/OpenAIChatCompletion.IntegrationTests/OpenAIChatCompletionFixture.cs @@ -14,7 +14,6 @@ namespace OpenAIChatCompletion.IntegrationTests; public class OpenAIChatCompletionFixture : IChatClientAgentFixture { - private static readonly OpenAIConfiguration s_config = TestConfiguration.LoadSection(); private readonly bool _useReasoningModel; private ChatClientAgent _agent = null!; @@ -45,8 +44,8 @@ public Task CreateChatClientAgentAsync( string instructions = "You are a helpful assistant.", IList? aiTools = null) { - var chatClient = new OpenAIClient(s_config.ApiKey) - .GetChatClient(this._useReasoningModel ? s_config.ChatReasoningModelId : s_config.ChatModelId) + var chatClient = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)) + .GetChatClient(this._useReasoningModel ? TestConfiguration.GetRequiredValue(TestSettings.OpenAIReasoningModelName) : TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName)) .AsIChatClient(); return Task.FromResult(new ChatClientAgent(chatClient, options: new() diff --git a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs index e36f8990f60..515703c21c3 100644 --- a/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs +++ b/dotnet/tests/OpenAIResponse.IntegrationTests/OpenAIResponseFixture.cs @@ -16,8 +16,6 @@ namespace ResponseResult.IntegrationTests; public class OpenAIResponseFixture(bool store) : IChatClientAgentFixture { - private static readonly OpenAIConfiguration s_config = TestConfiguration.LoadSection(); - private ResponsesClient _openAIResponseClient = null!; private ChatClientAgent _agent = null!; @@ -98,8 +96,8 @@ public Task DeleteSessionAsync(AgentSession session) => public async Task InitializeAsync() { - this._openAIResponseClient = new OpenAIClient(s_config.ApiKey) - .GetResponsesClient(s_config.ChatModelId); + this._openAIResponseClient = new OpenAIClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIApiKey)) + .GetResponsesClient(TestConfiguration.GetRequiredValue(TestSettings.OpenAIChatModelName)); this._agent = await this.CreateChatClientAgentAsync(); } From 61381aa2d9d50eea83b1abdd1c56ea397370a586 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sat, 21 Feb 2026 19:05:11 -0800 Subject: [PATCH 05/15] Integration Tests --- .../ConsoleAppSamplesValidation.cs | 6 +++--- .../TestHelper.cs | 8 ++++---- .../SamplesValidation.cs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs index 254006f94da..72dbdd15953 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs @@ -829,8 +829,8 @@ private Process StartConsoleApp(string samplePath, BlockingCollection string openAiEndpoint = s_configuration["AZURE_OPENAI_ENDPOINT"] ?? throw new InvalidOperationException("The required AZURE_OPENAI_ENDPOINT env variable is not set."); - string openAiDeployment = s_configuration["AZURE_OPENAI_CHAT_DEPLOYMENT_NAME"] ?? - throw new InvalidOperationException("The required AZURE_OPENAI_CHAT_DEPLOYMENT_NAME env variable is not set."); + string openAiDeployment = s_configuration["AZURE_OPENAI_DEPLOYMENT_NAME"] ?? + throw new InvalidOperationException("The required AZURE_OPENAI_DEPLOYMENT_NAME env variable is not set."); void SetAndLogEnvironmentVariable(string key, string value) { @@ -840,7 +840,7 @@ void SetAndLogEnvironmentVariable(string key, string value) // Set required environment variables for the app SetAndLogEnvironmentVariable("AZURE_OPENAI_ENDPOINT", openAiEndpoint); - SetAndLogEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT", openAiDeployment); + SetAndLogEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME", openAiDeployment); SetAndLogEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING", $"Endpoint=http://localhost:{DtsPort};TaskHub={taskHubName};Authentication=None"); SetAndLogEnvironmentVariable("REDIS_CONNECTION_STRING", $"localhost:{RedisPort}"); diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs index 8022e71119b..295277021b4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs @@ -157,12 +157,12 @@ internal static ChatClient GetAzureOpenAIChatClient(IConfiguration configuration { string azureOpenAiEndpoint = configuration["AZURE_OPENAI_ENDPOINT"] ?? throw new InvalidOperationException("The required AZURE_OPENAI_ENDPOINT env variable is not set."); - string azureOpenAiDeploymentName = configuration["AZURE_OPENAI_CHAT_DEPLOYMENT_NAME"] ?? - throw new InvalidOperationException("The required AZURE_OPENAI_CHAT_DEPLOYMENT_NAME env variable is not set."); + string azureOpenAiDeploymentName = configuration["AZURE_OPENAI_DEPLOYMENT_NAME"] ?? + throw new InvalidOperationException("The required AZURE_OPENAI_DEPLOYMENT_NAME env variable is not set."); - // Check if AZURE_OPENAI_KEY is provided for key-based authentication. + // Check if AZURE_OPENAI_API_KEY is provided for key-based authentication. // NOTE: This is not used for automated tests, but can be useful for local development. - string? azureOpenAiKey = configuration["AZURE_OPENAI_KEY"]; + string? azureOpenAiKey = configuration["AZURE_OPENAI_API_KEY"]; AzureOpenAIClient client = !string.IsNullOrEmpty(azureOpenAiKey) ? new AzureOpenAIClient(new Uri(azureOpenAiEndpoint), new AzureKeyCredential(azureOpenAiKey)) diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs index 80eda23613f..cefccf84b14 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs @@ -826,12 +826,12 @@ private Process StartFunctionApp(string samplePath, List logs) string openAiEndpoint = s_configuration["AZURE_OPENAI_ENDPOINT"] ?? throw new InvalidOperationException("The required AZURE_OPENAI_ENDPOINT env variable is not set."); - string openAiDeployment = s_configuration["AZURE_OPENAI_CHAT_DEPLOYMENT_NAME"] ?? - throw new InvalidOperationException("The required AZURE_OPENAI_CHAT_DEPLOYMENT_NAME env variable is not set."); + string openAiDeployment = s_configuration["AZURE_OPENAI_DEPLOYMENT_NAME"] ?? + throw new InvalidOperationException("The required AZURE_OPENAI_DEPLOYMENT_NAME env variable is not set."); // Set required environment variables for the function app (see local.settings.json for required settings) startInfo.EnvironmentVariables["AZURE_OPENAI_ENDPOINT"] = openAiEndpoint; - startInfo.EnvironmentVariables["AZURE_OPENAI_DEPLOYMENT"] = openAiDeployment; + startInfo.EnvironmentVariables["AZURE_OPENAI_DEPLOYMENT_NAME"] = openAiDeployment; startInfo.EnvironmentVariables["DURABLE_TASK_SCHEDULER_CONNECTION_STRING"] = $"Endpoint=http://localhost:{DtsPort};TaskHub=default;Authentication=None"; startInfo.EnvironmentVariables["AzureWebJobsStorage"] = "UseDevelopmentStorage=true"; From bac9bba7fef70617c18c7af5a75658c8b211783f Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sat, 21 Feb 2026 21:32:01 -0800 Subject: [PATCH 06/15] Cleanup --- ...nts.AI.DurableTask.IntegrationTests.csproj | 1 - ...oft.Agents.AI.DurableTask.UnitTests.csproj | 1 - ...ing.AzureFunctions.IntegrationTests.csproj | 1 - .../SamplesValidation.cs | 24 ++++++++++--------- ...kflows.Declarative.IntegrationTests.csproj | 1 - 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Microsoft.Agents.AI.DurableTask.IntegrationTests.csproj b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Microsoft.Agents.AI.DurableTask.IntegrationTests.csproj index db6aa6d62be..ac4f52e3eb4 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Microsoft.Agents.AI.DurableTask.IntegrationTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/Microsoft.Agents.AI.DurableTask.IntegrationTests.csproj @@ -3,7 +3,6 @@ $(TargetFrameworksCore) enable - b7762d10-e29b-4bb1-8b74-b6d69a667dd4 diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Microsoft.Agents.AI.DurableTask.UnitTests.csproj b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Microsoft.Agents.AI.DurableTask.UnitTests.csproj index b0cf00cae18..d6b34bd6b9b 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Microsoft.Agents.AI.DurableTask.UnitTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.UnitTests/Microsoft.Agents.AI.DurableTask.UnitTests.csproj @@ -3,7 +3,6 @@ $(TargetFrameworksCore) enable - b7762d10-e29b-4bb1-8b74-b6d69a667dd4 diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests.csproj b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests.csproj index fb955c3162f..010e9c9650e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests.csproj @@ -3,7 +3,6 @@ $(TargetFrameworksCore) enable - b7762d10-e29b-4bb1-8b74-b6d69a667dd4 diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs index cefccf84b14..611d14d8d18 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs @@ -25,14 +25,16 @@ public sealed class SamplesValidation(ITestOutputHelper outputHelper) : IAsyncLi private static readonly HttpClient s_sharedHttpClient = new(); private static readonly IConfiguration s_configuration = new ConfigurationBuilder() - .AddUserSecrets(Assembly.GetExecutingAssembly()) .AddEnvironmentVariables() + .AddUserSecrets(Assembly.GetExecutingAssembly()) .Build(); private static bool s_infrastructureStarted; private static readonly TimeSpan s_orchestrationTimeout = TimeSpan.FromMinutes(1); - private static readonly string s_samplesPath = Path.GetFullPath( - Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", "..", "samples", "Durable", "Agents", "AzureFunctions")); + private static readonly string s_samplesGetStartedPath = Path.GetFullPath( + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", "..", "samples", "01-get-started")); + private static readonly string s_samplesHostingPath = Path.GetFullPath( + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", "..", "samples", "04-hosting", "DurableAgents", "AzureFunctions")); private readonly ITestOutputHelper _outputHelper = outputHelper; @@ -54,7 +56,7 @@ async Task IAsyncLifetime.DisposeAsync() [Fact] public async Task SingleAgentSampleValidationAsync() { - string samplePath = Path.Combine(s_samplesPath, "01_SingleAgent"); + string samplePath = Path.Combine(s_samplesGetStartedPath, "06_host_your_agent"); await this.RunSampleTestAsync(samplePath, async (logs) => { Uri startUri = new($"http://localhost:{AzureFunctionsPort}/api/agents/Joker/run"); @@ -99,7 +101,7 @@ await this.WaitForConditionAsync( [Fact] public async Task SingleAgentOrchestrationChainingSampleValidationAsync() { - string samplePath = Path.Combine(s_samplesPath, "02_AgentOrchestration_Chaining"); + string samplePath = Path.Combine(s_samplesHostingPath, "01_AgentOrchestration_Chaining"); await this.RunSampleTestAsync(samplePath, async (logs) => { Uri startUri = new($"http://localhost:{AzureFunctionsPort}/api/singleagent/run"); @@ -142,7 +144,7 @@ await this.RunSampleTestAsync(samplePath, async (logs) => [Fact] public async Task MultiAgentOrchestrationConcurrentSampleValidationAsync() { - string samplePath = Path.Combine(s_samplesPath, "03_AgentOrchestration_Concurrency"); + string samplePath = Path.Combine(s_samplesHostingPath, "02_AgentOrchestration_Concurrency"); await this.RunSampleTestAsync(samplePath, async (logs) => { // Start the multi-agent orchestration @@ -192,7 +194,7 @@ await this.RunSampleTestAsync(samplePath, async (logs) => [Fact] public async Task MultiAgentOrchestrationConditionalsSampleValidationAsync() { - string samplePath = Path.Combine(s_samplesPath, "04_AgentOrchestration_Conditionals"); + string samplePath = Path.Combine(s_samplesHostingPath, "03_AgentOrchestration_Conditionals"); await this.RunSampleTestAsync(samplePath, async (logs) => { // Test with legitimate email @@ -210,7 +212,7 @@ await this.TestSpamDetectionAsync("email-002", [Fact] public async Task SingleAgentOrchestrationHITLSampleValidationAsync() { - string samplePath = Path.Combine(s_samplesPath, "05_AgentOrchestration_HITL"); + string samplePath = Path.Combine(s_samplesHostingPath, "04_AgentOrchestration_HITL"); await this.RunSampleTestAsync(samplePath, async (logs) => { @@ -266,7 +268,7 @@ await this.RunSampleTestAsync(samplePath, async (logs) => [Fact] public async Task LongRunningToolsSampleValidationAsync() { - string samplePath = Path.Combine(s_samplesPath, "06_LongRunningTools"); + string samplePath = Path.Combine(s_samplesHostingPath, "05_LongRunningTools"); await this.RunSampleTestAsync(samplePath, async (logs) => { @@ -356,7 +358,7 @@ await this.WaitForConditionAsync( [Fact] public async Task AgentAsMcpToolAsync() { - string samplePath = Path.Combine(s_samplesPath, "07_AgentAsMcpTool"); + string samplePath = Path.Combine(s_samplesHostingPath, "06_AgentAsMcpTool"); await this.RunSampleTestAsync(samplePath, async (logs) => { IClientTransport clientTransport = new HttpClientTransport(new() @@ -396,7 +398,7 @@ await this.WaitForConditionAsync( [Fact] public async Task ReliableStreamingSampleValidationAsync() { - string samplePath = Path.Combine(s_samplesPath, "08_ReliableStreaming"); + string samplePath = Path.Combine(s_samplesHostingPath, "07_ReliableStreaming"); await this.RunSampleTestAsync(samplePath, async (logs) => { Uri createUri = new($"http://localhost:{AzureFunctionsPort}/api/agent/create"); diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj index 309a590b833..163cca681bc 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests/Microsoft.Agents.AI.Workflows.Declarative.IntegrationTests.csproj @@ -16,7 +16,6 @@ - From fabfc94bdc9636b4a914b3330f4ec3e47de9f9cf Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 22 Feb 2026 11:04:17 -0800 Subject: [PATCH 07/15] Update build action --- .github/workflows/dotnet-build-and-test.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml index 2d079f488eb..901207e46be 100644 --- a/.github/workflows/dotnet-build-and-test.yml +++ b/.github/workflows/dotnet-build-and-test.yml @@ -215,20 +215,16 @@ jobs: COSMOSDB_ENDPOINT: https://localhost:8081 COSMOSDB_KEY: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== # OpenAI Models - OpenAI__ApiKey: ${{ secrets.OPENAI__APIKEY }} - OpenAI__ChatModelId: ${{ vars.OPENAI__CHATMODELID }} - OpenAI__ChatReasoningModelId: ${{ vars.OPENAI__CHATREASONINGMODELID }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_CHAT_MODEL_NAME: ${{ vars.OPENAI_CHAT_MODEL_NAME }} + OPENAI_REASONING_MODEL_NAME: ${{ vars.OPENAI_REASONING_MODEL_NAME }} # Azure OpenAI Models - AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZUREOPENAI__CHATDEPLOYMENTNAME }} - AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} + AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }} + AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }} # Azure AI Foundry - AzureAI__Endpoint: ${{ secrets.AZUREAI__ENDPOINT }} - AzureAI__DeploymentName: ${{ vars.AZUREAI__DEPLOYMENTNAME }} - AzureAI__BingConnectionId: ${{ vars.AZUREAI__BINGCONECTIONID }} - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} - FOUNDRY_MEDIA_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MEDIA_DEPLOYMENT_NAME }} - FOUNDRY_MODEL_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MODEL_DEPLOYMENT_NAME }} - FOUNDRY_CONNECTION_GROUNDING_TOOL: ${{ vars.FOUNDRY_CONNECTION_GROUNDING_TOOL }} + AZURE_AI_PROJECT_ENDPOINT: ${{ secrets.AZURE_AI_PROJECT_ENDPOINT }} + AZURE_AI_MODEL_DEPLOYMENT_NAME: ${{ vars.AZURE_AI_MODEL_DEPLOYMENT_NAME }} + AZURE_AI_BING_CONNECTION_ID: ${{ vars.AZURE_AI_BING_CONNECTION_ID }} # Generate test reports and check coverage - name: Generate test reports From e0716d2d38226411794ba94dd174378191990ee8 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 22 Feb 2026 11:18:18 -0800 Subject: [PATCH 08/15] Update COSMOSDB settings --- .../CosmosChatHistoryProviderTests.cs | 20 +++++++++---------- .../CosmosCheckpointStoreTests.cs | 12 +++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs index 4c142d3c1ed..c57ce0cdf0e 100644 --- a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosChatHistoryProviderTests.cs @@ -18,8 +18,8 @@ namespace Microsoft.Agents.AI.CosmosNoSql.UnitTests; /// - Default Mode: Cleans up all test data after each test run (deletes database) /// - Preserve Mode: Keeps containers and data for inspection in Cosmos DB Emulator Data Explorer /// -/// To enable Preserve Mode, set environment variable: COSMOS_PRESERVE_CONTAINERS=true -/// Example: $env:COSMOS_PRESERVE_CONTAINERS="true"; dotnet test +/// To enable Preserve Mode, set environment variable: COSMOSDB_PRESERVE_CONTAINERS=true +/// Example: $env:COSMOSDB_PRESERVE_CONTAINERS="true"; dotnet test /// /// In Preserve Mode, you can view the data in Cosmos DB Emulator Data Explorer at: /// https://localhost:8081/_explorer/index.html @@ -29,12 +29,12 @@ namespace Microsoft.Agents.AI.CosmosNoSql.UnitTests; /// Environment Variable Reference: /// | Variable | Values | Description | /// |----------|--------|-------------| -/// | COSMOS_PRESERVE_CONTAINERS | true / false | Controls whether to preserve test data after completion | +/// | COSMOSDB_PRESERVE_CONTAINERS | true / false | Controls whether to preserve test data after completion | /// /// Usage Examples: -/// - Run all tests in preserve mode: $env:COSMOS_PRESERVE_CONTAINERS="true"; dotnet test tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/ -/// - Run specific test category in preserve mode: $env:COSMOS_PRESERVE_CONTAINERS="true"; dotnet test tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/ --filter "Category=CosmosDB" -/// - Reset to cleanup mode: $env:COSMOS_PRESERVE_CONTAINERS=""; dotnet test tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/ +/// - Run all tests in preserve mode: $env:COSMOSDB_PRESERVE_CONTAINERS="true"; dotnet test tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/ +/// - Run specific test category in preserve mode: $env:COSMOSDB_PRESERVE_CONTAINERS="true"; dotnet test tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/ --filter "Category=CosmosDB" +/// - Reset to cleanup mode: $env:COSMOSDB_PRESERVE_CONTAINERS=""; dotnet test tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/ /// [Collection("CosmosDB")] public sealed class CosmosChatHistoryProviderTests : IAsyncLifetime, IDisposable @@ -64,8 +64,8 @@ public async Task InitializeAsync() this.SkipIfEmulatorNotAvailable(); // Check environment variable to determine if we should preserve containers - // Set COSMOS_PRESERVE_CONTAINERS=true to keep containers and data for inspection - this._preserveContainer = string.Equals(Environment.GetEnvironmentVariable("COSMOS_PRESERVE_CONTAINERS"), "true", StringComparison.OrdinalIgnoreCase); + // Set COSMOSDB_PRESERVE_CONTAINERS=true to keep containers and data for inspection + this._preserveContainer = string.Equals(Environment.GetEnvironmentVariable("COSMOSDB_PRESERVE_CONTAINERS"), bool.TrueString, StringComparison.OrdinalIgnoreCase); this._connectionString = $"AccountEndpoint={EmulatorEndpoint};AccountKey={EmulatorKey}"; @@ -139,9 +139,9 @@ public void Dispose() private void SkipIfEmulatorNotAvailable() { - // In CI: Skip if COSMOS_EMULATOR_AVAILABLE is not set to "true" + // In CI: Skip if COSMOSDB_EMULATOR_AVAILABLE is not set to "true" // Locally: Skip if emulator connection check failed - var ciEmulatorAvailable = string.Equals(Environment.GetEnvironmentVariable("COSMOS_EMULATOR_AVAILABLE"), "true", StringComparison.OrdinalIgnoreCase); + var ciEmulatorAvailable = string.Equals(Environment.GetEnvironmentVariable("COSMOSDB_EMULATOR_AVAILABLE"), bool.TrueString, StringComparison.OrdinalIgnoreCase); Xunit.Skip.If(!ciEmulatorAvailable && !this._emulatorAvailable, "Cosmos DB Emulator is not available"); } diff --git a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs index f1f840cebfa..c9b2a37b4e8 100644 --- a/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosCheckpointStoreTests.cs @@ -17,8 +17,8 @@ namespace Microsoft.Agents.AI.CosmosNoSql.UnitTests; /// - Default Mode: Cleans up all test data after each test run (deletes database) /// - Preserve Mode: Keeps containers and data for inspection in Cosmos DB Emulator Data Explorer /// -/// To enable Preserve Mode, set environment variable: COSMOS_PRESERVE_CONTAINERS=true -/// Example: $env:COSMOS_PRESERVE_CONTAINERS="true"; dotnet test +/// To enable Preserve Mode, set environment variable: COSMOSDB_PRESERVE_CONTAINERS=true +/// Example: $env:COSMOSDB_PRESERVE_CONTAINERS="true"; dotnet test /// /// In Preserve Mode, you can view the data in Cosmos DB Emulator Data Explorer at: /// https://localhost:8081/_explorer/index.html @@ -61,8 +61,8 @@ public async Task InitializeAsync() this.SkipIfEmulatorNotAvailable(); // Check environment variable to determine if we should preserve containers - // Set COSMOS_PRESERVE_CONTAINERS=true to keep containers and data for inspection - this._preserveContainer = string.Equals(Environment.GetEnvironmentVariable("COSMOS_PRESERVE_CONTAINERS"), "true", StringComparison.OrdinalIgnoreCase); + // Set COSMOSDB_PRESERVE_CONTAINERS=true to keep containers and data for inspection + this._preserveContainer = string.Equals(Environment.GetEnvironmentVariable("COSMOSDB_PRESERVE_CONTAINERS"), bool.TrueString, StringComparison.OrdinalIgnoreCase); this._connectionString = $"AccountEndpoint={EmulatorEndpoint};AccountKey={EmulatorKey}"; @@ -120,9 +120,9 @@ public async Task DisposeAsync() private void SkipIfEmulatorNotAvailable() { - // In CI: Skip if COSMOS_EMULATOR_AVAILABLE is not set to "true" + // In CI: Skip if COSMOSDB_EMULATOR_AVAILABLE is not set to "true" // Locally: Skip if emulator connection check failed - var ciEmulatorAvailable = string.Equals(Environment.GetEnvironmentVariable("COSMOS_EMULATOR_AVAILABLE"), "true", StringComparison.OrdinalIgnoreCase); + var ciEmulatorAvailable = string.Equals(Environment.GetEnvironmentVariable("COSMOSDB_EMULATOR_AVAILABLE"), bool.TrueString, StringComparison.OrdinalIgnoreCase); Xunit.Skip.If(!ciEmulatorAvailable && !this._emulatorAvailable, "Cosmos DB Emulator is not available"); } From f294fd68ca16d24d92ede7ebaa6f2554944011ec Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 22 Feb 2026 11:51:46 -0800 Subject: [PATCH 09/15] Fix workflow --- .github/workflows/dotnet-build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml index 901207e46be..17560deab2a 100644 --- a/.github/workflows/dotnet-build-and-test.yml +++ b/.github/workflows/dotnet-build-and-test.yml @@ -102,7 +102,7 @@ jobs: Write-Host "Launching Azure Cosmos DB Emulator" Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" Start-CosmosDbEmulator -NoUI -Key "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" - echo "COSMOS_EMULATOR_AVAILABLE=true" >> $env:GITHUB_ENV + echo "COSMOSDB_EMULATOR_AVAILABLE=true" >> $env:GITHUB_ENV - name: Setup dotnet uses: actions/setup-dotnet@v5.1.0 @@ -222,7 +222,7 @@ jobs: AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }} AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }} # Azure AI Foundry - AZURE_AI_PROJECT_ENDPOINT: ${{ secrets.AZURE_AI_PROJECT_ENDPOINT }} + AZURE_AI_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_PROJECT_ENDPOINT }} AZURE_AI_MODEL_DEPLOYMENT_NAME: ${{ vars.AZURE_AI_MODEL_DEPLOYMENT_NAME }} AZURE_AI_BING_CONNECTION_ID: ${{ vars.AZURE_AI_BING_CONNECTION_ID }} From 31179de7b803dcb238699e81c9ac2fbea18e9ef1 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 22 Feb 2026 12:09:01 -0800 Subject: [PATCH 10/15] Update AZURE_OPENAI_DEPLOYMENT_NAME --- .github/workflows/dotnet-build-and-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml index 17560deab2a..4f84efe9712 100644 --- a/.github/workflows/dotnet-build-and-test.yml +++ b/.github/workflows/dotnet-build-and-test.yml @@ -219,7 +219,8 @@ jobs: OPENAI_CHAT_MODEL_NAME: ${{ vars.OPENAI_CHAT_MODEL_NAME }} OPENAI_REASONING_MODEL_NAME: ${{ vars.OPENAI_REASONING_MODEL_NAME }} # Azure OpenAI Models - AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }} + AZURE_OPENAI_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }} + AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }} AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }} # Azure AI Foundry AZURE_AI_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_PROJECT_ENDPOINT }} From 78954b31a63f60cb59157502174f3c8285d9a113 Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 22 Feb 2026 12:32:10 -0800 Subject: [PATCH 11/15] Restore `local.settings.json` --- .../06_host_your_agent/local.settings.json | 10 ++++++++++ .../local.settings.json | 10 ++++++++++ .../local.settings.json | 10 ++++++++++ .../local.settings.json | 10 ++++++++++ .../04_AgentOrchestration_HITL/local.settings.json | 10 ++++++++++ .../05_LongRunningTools/local.settings.json | 10 ++++++++++ .../06_AgentAsMcpTool/local.settings.json | 10 ++++++++++ .../07_ReliableStreaming/local.settings.json | 12 ++++++++++++ 8 files changed, 82 insertions(+) create mode 100644 dotnet/samples/01-get-started/06_host_your_agent/local.settings.json create mode 100644 dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json create mode 100644 dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json create mode 100644 dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json create mode 100644 dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json create mode 100644 dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json create mode 100644 dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json create mode 100644 dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json diff --git a/dotnet/samples/01-get-started/06_host_your_agent/local.settings.json b/dotnet/samples/01-get-started/06_host_your_agent/local.settings.json new file mode 100644 index 00000000000..54dfbb5664e --- /dev/null +++ b/dotnet/samples/01-get-started/06_host_your_agent/local.settings.json @@ -0,0 +1,10 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "" + } +} diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json new file mode 100644 index 00000000000..54dfbb5664e --- /dev/null +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json @@ -0,0 +1,10 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "" + } +} diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json new file mode 100644 index 00000000000..54dfbb5664e --- /dev/null +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json @@ -0,0 +1,10 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "" + } +} diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json new file mode 100644 index 00000000000..54dfbb5664e --- /dev/null +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json @@ -0,0 +1,10 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "" + } +} diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json new file mode 100644 index 00000000000..54dfbb5664e --- /dev/null +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json @@ -0,0 +1,10 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "" + } +} diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json new file mode 100644 index 00000000000..54dfbb5664e --- /dev/null +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json @@ -0,0 +1,10 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "" + } +} diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json new file mode 100644 index 00000000000..54dfbb5664e --- /dev/null +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json @@ -0,0 +1,10 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "" + } +} diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json new file mode 100644 index 00000000000..5dfdb17999b --- /dev/null +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json @@ -0,0 +1,12 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", + "AzureWebJobsStorage": "UseDevelopmentStorage=true", + "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", + "AZURE_OPENAI_ENDPOINT": "", + "AZURE_OPENAI_DEPLOYMENT": "", + "REDIS_CONNECTION_STRING": "localhost:6379", + "REDIS_STREAM_TTL_MINUTES": "10" + } +} From af3f2c96daac0fb8f0f657f8ef158273be32fc2d Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 22 Feb 2026 20:47:32 -0800 Subject: [PATCH 12/15] Update configuration name in `local.settings.json` --- .../01_AgentOrchestration_Chaining/local.settings.json | 2 +- .../02_AgentOrchestration_Concurrency/local.settings.json | 2 +- .../03_AgentOrchestration_Conditionals/local.settings.json | 2 +- .../04_AgentOrchestration_HITL/local.settings.json | 2 +- .../AzureFunctions/05_LongRunningTools/local.settings.json | 2 +- .../AzureFunctions/06_AgentAsMcpTool/local.settings.json | 2 +- .../AzureFunctions/07_ReliableStreaming/local.settings.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json index 54dfbb5664e..5f6d7d33406 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/01_AgentOrchestration_Chaining/local.settings.json @@ -5,6 +5,6 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "" + "AZURE_OPENAI_DEPLOYMENT_NAME": "" } } diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json index 54dfbb5664e..5f6d7d33406 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/02_AgentOrchestration_Concurrency/local.settings.json @@ -5,6 +5,6 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "" + "AZURE_OPENAI_DEPLOYMENT_NAME": "" } } diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json index 54dfbb5664e..5f6d7d33406 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/03_AgentOrchestration_Conditionals/local.settings.json @@ -5,6 +5,6 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "" + "AZURE_OPENAI_DEPLOYMENT_NAME": "" } } diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json index 54dfbb5664e..5f6d7d33406 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/04_AgentOrchestration_HITL/local.settings.json @@ -5,6 +5,6 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "" + "AZURE_OPENAI_DEPLOYMENT_NAME": "" } } diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json index 54dfbb5664e..5f6d7d33406 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/05_LongRunningTools/local.settings.json @@ -5,6 +5,6 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "" + "AZURE_OPENAI_DEPLOYMENT_NAME": "" } } diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json index 54dfbb5664e..5f6d7d33406 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/06_AgentAsMcpTool/local.settings.json @@ -5,6 +5,6 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "" + "AZURE_OPENAI_DEPLOYMENT_NAME": "" } } diff --git a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json index 5dfdb17999b..71e7ff8dac1 100644 --- a/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json +++ b/dotnet/samples/04-hosting/DurableAgents/AzureFunctions/07_ReliableStreaming/local.settings.json @@ -5,7 +5,7 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "", + "AZURE_OPENAI_DEPLOYMENT_NAME": "", "REDIS_CONNECTION_STRING": "localhost:6379", "REDIS_STREAM_TTL_MINUTES": "10" } From 9b6da2d0b24360a90122d42e280fcad61588d2ff Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Sun, 22 Feb 2026 20:48:27 -0800 Subject: [PATCH 13/15] Last one --- .../01-get-started/06_host_your_agent/local.settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/samples/01-get-started/06_host_your_agent/local.settings.json b/dotnet/samples/01-get-started/06_host_your_agent/local.settings.json index 54dfbb5664e..5f6d7d33406 100644 --- a/dotnet/samples/01-get-started/06_host_your_agent/local.settings.json +++ b/dotnet/samples/01-get-started/06_host_your_agent/local.settings.json @@ -5,6 +5,6 @@ "AzureWebJobsStorage": "UseDevelopmentStorage=true", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None", "AZURE_OPENAI_ENDPOINT": "", - "AZURE_OPENAI_DEPLOYMENT": "" + "AZURE_OPENAI_DEPLOYMENT_NAME": "" } } From ddec23a0dad7bdc450146bc18c7281462ddf3d5b Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Mon, 23 Feb 2026 12:46:39 -0800 Subject: [PATCH 14/15] Fix integration test path --- .../ConsoleAppSamplesValidation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs index 72dbdd15953..d49614868f6 100644 --- a/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/ConsoleAppSamplesValidation.cs @@ -26,7 +26,7 @@ public sealed class ConsoleAppSamplesValidation(ITestOutputHelper outputHelper) private static bool s_infrastructureStarted; private static readonly string s_samplesPath = Path.GetFullPath( - Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", "..", "samples", "Durable", "Agents", "ConsoleApps")); + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", "..", "samples", "04-hosting", "DurableAgents", "ConsoleApps")); private readonly ITestOutputHelper _outputHelper = outputHelper; From 63766a7cfdafc2a64abc40ba9454a079fe6c219a Mon Sep 17 00:00:00 2001 From: Chris Rickman Date: Tue, 24 Feb 2026 10:44:28 -0800 Subject: [PATCH 15/15] Update for new amples --- .../FoundryAgents_Step21_BingCustomSearch/Program.cs | 8 ++++---- .../FoundryAgents_Step25_WebSearch/Program.cs | 4 ++-- .../FoundryAgents_Step26_MemorySearch/Program.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step21_BingCustomSearch/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step21_BingCustomSearch/Program.cs index 33ee4ec5110..365bf6ed081 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step21_BingCustomSearch/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step21_BingCustomSearch/Program.cs @@ -8,10 +8,10 @@ using Microsoft.Agents.AI; using OpenAI.Responses; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; -string connectionId = Environment.GetEnvironmentVariable("BING_CUSTOM_SEARCH_PROJECT_CONNECTION_ID") ?? throw new InvalidOperationException("BING_CUSTOM_SEARCH_PROJECT_CONNECTION_ID is not set."); -string instanceName = Environment.GetEnvironmentVariable("BING_CUSTOM_SEARCH_INSTANCE_NAME") ?? throw new InvalidOperationException("BING_CUSTOM_SEARCH_INSTANCE_NAME is not set."); +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string connectionId = Environment.GetEnvironmentVariable("AZURE_AI_CUSTOM_SEARCH_CONNECTION_ID") ?? throw new InvalidOperationException("AZURE_AI_CUSTOM_SEARCH_CONNECTION_ID is not set."); +string instanceName = Environment.GetEnvironmentVariable("AZURE_AI_CUSTOM_SEARCH_INSTANCE_NAME") ?? throw new InvalidOperationException("AZURE_AI_CUSTOM_SEARCH_INSTANCE_NAME is not set."); const string AgentInstructions = """ You are a helpful agent that can use Bing Custom Search tools to assist users. diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step25_WebSearch/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step25_WebSearch/Program.cs index 77e5d5aeb7d..1ac312ddae8 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step25_WebSearch/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step25_WebSearch/Program.cs @@ -9,8 +9,8 @@ using Microsoft.Extensions.AI; using OpenAI.Responses; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; const string AgentInstructions = "You are a helpful assistant that can search the web to find current information and answer questions accurately."; const string AgentName = "WebSearchAgent"; diff --git a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step26_MemorySearch/Program.cs b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step26_MemorySearch/Program.cs index 10bb2efe8dc..97eed4e8386 100644 --- a/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step26_MemorySearch/Program.cs +++ b/dotnet/samples/02-agents/FoundryAgents/FoundryAgents_Step26_MemorySearch/Program.cs @@ -10,13 +10,13 @@ using Microsoft.Agents.AI; using OpenAI.Responses; -string endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_PROJECT_ENDPOINT is not set."); -string deploymentName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_PROJECT_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; +string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set."); +string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-4o-mini"; // Memory store configuration // NOTE: Memory stores must be created beforehand via Azure Portal or Python SDK. // The .NET SDK currently only supports using existing memory stores with agents. -string memoryStoreName = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_MEMORY_STORE_NAME") ?? throw new InvalidOperationException("AZURE_FOUNDRY_MEMORY_STORE_NAME is not set."); +string memoryStoreName = Environment.GetEnvironmentVariable("AZURE_AI_MEMORY_STORE_ID") ?? throw new InvalidOperationException("AZURE_AI_MEMORY_STORE_ID is not set."); const string AgentInstructions = """ You are a helpful assistant that remembers past conversations.