Skip to content

Commit 1aca61d

Browse files
Python: [Python/.NET] Normalize Foundry sample configuration (#9070)
* Normalize Foundry sample configuration * Fix hosted sample workflow environment * Address Foundry configuration review feedback * Normalize hosted sample env templates * Remove stale model fallback comment
1 parent 1b93be1 commit 1aca61d

149 files changed

Lines changed: 349 additions & 288 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/dotnet-verify-samples.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,9 @@ jobs:
106106
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }}
107107
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
108108
# Microsoft Foundry
109-
AZURE_AI_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_PROJECT_ENDPOINT }}
110-
AZURE_AI_MODEL_DEPLOYMENT_NAME: ${{ vars.AZURE_AI_MODEL_DEPLOYMENT_NAME }}
111-
AZURE_AI_BING_CONNECTION_ID: ${{ vars.AZURE_AI_BING_CONNECTION_ID }}
112-
# Foundry
113109
FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }}
114110
FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }}
111+
AZURE_AI_BING_CONNECTION_ID: ${{ vars.AZURE_AI_BING_CONNECTION_ID }}
115112

116113
- name: Write Job Summary
117114
if: always()

‎.github/workflows/python-sample-validation.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,6 @@ jobs:
628628
FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }}
629629
FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }}
630630
# Foundry hosted agent configuration
631-
AZURE_AI_MODEL_DEPLOYMENT_NAME: ${{ vars.FOUNDRY_MODEL }}
632631
FOUNDRY_PROJECT_ID: ${{ vars.FOUNDRY_PROJECT_ID }}
633632
AZURE_CONTAINER_REGISTRY_ENDPOINT: ${{ vars.AZURE_CONTAINER_REGISTRY_ENDPOINT }}
634633
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ using Azure.AI.Projects;
150150
using Azure.Identity;
151151
using Microsoft.Agents.AI;
152152

153-
string endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set.");
154-
string deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-5.4-mini";
153+
string endpoint = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("FOUNDRY_PROJECT_ENDPOINT is not set.");
154+
string deploymentName = Environment.GetEnvironmentVariable("FOUNDRY_MODEL") ?? "gpt-5.4-mini";
155155

156156
AIAgent agent =
157157
new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())

‎dotnet/.github/skills/verify-samples-tool/SKILL.md‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The tool itself needs:
4545
- `AZURE_OPENAI_ENDPOINT` — for the AI verification agent
4646
- `AZURE_OPENAI_DEPLOYMENT_NAME` (optional, defaults to `gpt-5-mini`)
4747

48-
Individual samples require their own env vars (e.g., `AZURE_AI_PROJECT_ENDPOINT`). The tool automatically checks and skips samples with missing env vars.
48+
Individual samples require their own env vars (for example, `FOUNDRY_PROJECT_ENDPOINT`). The tool automatically checks and skips samples with missing env vars.
4949

5050
### Output Files
5151

@@ -188,8 +188,8 @@ new SampleDefinition
188188
{
189189
Name = "FoundryAgent_Hosted_MCP",
190190
ProjectPath = "samples/02-agents/ModelContextProtocol/FoundryAgent_Hosted_MCP",
191-
RequiredEnvironmentVariables = ["AZURE_AI_PROJECT_ENDPOINT"],
192-
OptionalEnvironmentVariables = ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
191+
RequiredEnvironmentVariables = ["FOUNDRY_PROJECT_ENDPOINT"],
192+
OptionalEnvironmentVariables = ["FOUNDRY_MODEL"],
193193
Inputs = ["Y", "Y", "Y", "Y", "Y"],
194194
InputDelayMs = 5000,
195195
ExpectedOutputDescription = ["The output should show an agent using the Microsoft Learn MCP tool with approval prompts."],
@@ -203,8 +203,8 @@ new SampleDefinition
203203
{
204204
Name = "Workflow_Declarative_FunctionTools",
205205
ProjectPath = "samples/03-workflows/Declarative/FunctionTools",
206-
RequiredEnvironmentVariables = ["AZURE_AI_PROJECT_ENDPOINT"],
207-
OptionalEnvironmentVariables = ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
206+
RequiredEnvironmentVariables = ["FOUNDRY_PROJECT_ENDPOINT"],
207+
OptionalEnvironmentVariables = ["FOUNDRY_MODEL"],
208208
Inputs = ["What are today's specials?", "EXIT"],
209209
InputDelayMs = 8000,
210210
ExpectedOutputDescription = ["The output should show a workflow calling function tools to answer a question about restaurant specials."],
@@ -224,4 +224,3 @@ new SampleDefinition
224224
},
225225
```
226226

227-

‎dotnet/eng/verify-samples/AgentsSamples.cs‎

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

‎dotnet/samples/02-agents/Agents/Agent_Step15_DeepResearch/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Set the following environment variables:
3737

3838
```powershell
3939
# Replace with your Microsoft Foundry project endpoint
40-
$env:FOUNDRY_PROJECT_ENDPOINT="https://your-project.services.ai.azure.com/"
40+
$env:FOUNDRY_PROJECT_ENDPOINT="https://your-account.services.ai.azure.com/api/projects/your-project"
4141
4242
# Replace with your Bing Grounding connection ID (full ARM resource URI)
4343
$env:AZURE_AI_BING_CONNECTION_ID="/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.CognitiveServices/accounts/<account>/projects/<project>/connections/<connection-name>"

‎dotnet/samples/02-agents/Harness/Harness_Step05_Loop/Program.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
using Microsoft.Agents.AI;
2727
using Microsoft.Extensions.AI;
2828

29-
var endpoint = Environment.GetEnvironmentVariable("AZURE_AI_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("AZURE_AI_PROJECT_ENDPOINT is not set.");
30-
var deploymentName = Environment.GetEnvironmentVariable("AZURE_AI_MODEL_DEPLOYMENT_NAME") ?? "gpt-5.4";
29+
var endpoint = Environment.GetEnvironmentVariable("FOUNDRY_PROJECT_ENDPOINT") ?? throw new InvalidOperationException("FOUNDRY_PROJECT_ENDPOINT is not set.");
30+
var deploymentName = Environment.GetEnvironmentVariable("FOUNDRY_MODEL") ?? "gpt-5.4";
3131

3232
// The HarnessAgent pre-configures function invocation, per-service-call chat history persistence, and
3333
// context-window compaction. These bounds size the in-loop compaction window.

‎dotnet/samples/02-agents/Harness/Harness_Step05_Loop/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ Set the following environment variables:
4141

4242
```bash
4343
# Required: Your Microsoft Foundry project endpoint
44-
export AZURE_AI_PROJECT_ENDPOINT="https://your-project.services.ai.azure.com/api/projects/your-project"
44+
export FOUNDRY_PROJECT_ENDPOINT="https://your-account.services.ai.azure.com/api/projects/your-project"
4545

4646
# Optional: Model deployment name (defaults to gpt-5.4)
47-
export AZURE_AI_MODEL_DEPLOYMENT_NAME="gpt-5.4"
47+
export FOUNDRY_MODEL="gpt-5.4"
4848
```
4949

5050
## Running the Sample

‎dotnet/samples/03-workflows/Declarative/AotCheckpointing/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ Prerequisites:
9191

9292
| Setting | Description |
9393
| --- | --- |
94-
| `AZURE_AI_PROJECT_ENDPOINT` | Foundry project endpoint URL. |
95-
| `AZURE_AI_MODEL_DEPLOYMENT_NAME` | Model deployment name. |
94+
| `FOUNDRY_PROJECT_ENDPOINT` | Foundry project endpoint URL. |
95+
| `FOUNDRY_MODEL` | Model deployment name. |
9696

9797
See the [parent README](../README.md) for the full walkthrough.
9898

‎dotnet/samples/04-hosting/FoundryHostedAgents/responses/Hosted-AgentSkills/.env.example‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FOUNDRY_PROJECT_ENDPOINT=<your-azure-ai-project-endpoint>
33

44
# Model deployment name in your Foundry project.
5-
AZURE_AI_MODEL_DEPLOYMENT_NAME=gpt-4o
5+
FOUNDRY_MODEL=gpt-4o
66

77
# Local development only. Bind the app to the port Foundry probes for readiness, which is the
88
# port the Using-Samples REPLs expect. Recent Microsoft.Agents.AI.Foundry.Hosting versions bind

0 commit comments

Comments
 (0)