From eb7f8617c1f7bf6b36b004fa209abc11f70b64ab Mon Sep 17 00:00:00 2001
From: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
Date: Sat, 11 Apr 2026 12:05:44 +0100
Subject: [PATCH] Hosting Samples update
---
dotnet/agent-framework-dotnet.slnx | 6 +++---
.../Dockerfile | 2 +-
.../HostedChatClientAgent.csproj | 10 +++-------
.../Program.cs | 0
.../Properties/launchSettings.json | 0
.../agent.yaml | 0
.../Dockerfile | 2 +-
.../HostedFoundryAgent.csproj | 10 +++-------
.../Program.cs | 0
.../Properties/launchSettings.json | 2 +-
.../agent.yaml | 0
.../{consumption => UsingHostedAgent}/Program.cs | 2 +-
.../SimpleAgent.csproj | 0
13 files changed, 13 insertions(+), 21 deletions(-)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{instance-hosting => Hosted-ChatClientAgent}/Dockerfile (88%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{instance-hosting => Hosted-ChatClientAgent}/HostedChatClientAgent.csproj (59%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{instance-hosting => Hosted-ChatClientAgent}/Program.cs (100%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{instance-hosting => Hosted-ChatClientAgent}/Properties/launchSettings.json (100%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{instance-hosting => Hosted-ChatClientAgent}/agent.yaml (100%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{foundry-hosting => Hosted-FoundryAgent}/Dockerfile (88%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{foundry-hosting => Hosted-FoundryAgent}/HostedFoundryAgent.csproj (59%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{foundry-hosting => Hosted-FoundryAgent}/Program.cs (100%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{foundry-hosting => Hosted-FoundryAgent}/Properties/launchSettings.json (81%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{foundry-hosting => Hosted-FoundryAgent}/agent.yaml (100%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{consumption => UsingHostedAgent}/Program.cs (98%)
rename dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/{consumption => UsingHostedAgent}/SimpleAgent.csproj (100%)
diff --git a/dotnet/agent-framework-dotnet.slnx b/dotnet/agent-framework-dotnet.slnx
index 16778e2278..969a5c16d8 100644
--- a/dotnet/agent-framework-dotnet.slnx
+++ b/dotnet/agent-framework-dotnet.slnx
@@ -275,13 +275,13 @@
-
+
-
+
-
+
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/Dockerfile b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Dockerfile
similarity index 88%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/Dockerfile
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Dockerfile
index 2898f31ed0..6f1be8ee8e 100644
--- a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/Dockerfile
+++ b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Dockerfile
@@ -14,4 +14,4 @@ WORKDIR /app
COPY --from=build /app/publish .
EXPOSE 8088
ENV ASPNETCORE_URLS=http://+:8088
-ENTRYPOINT ["dotnet", "simple-agent.dll"]
+ENTRYPOINT ["dotnet", "HostedChatClientAgent.dll"]
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/HostedChatClientAgent.csproj b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/HostedChatClientAgent.csproj
similarity index 59%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/HostedChatClientAgent.csproj
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/HostedChatClientAgent.csproj
index a9adf5bb21..096681d505 100644
--- a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/HostedChatClientAgent.csproj
+++ b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/HostedChatClientAgent.csproj
@@ -5,16 +5,12 @@
enable
enable
false
- SimpleAgent
- simple-agent
- $(NoWarn);NU1903;NU1605
+ HostedChatClientAgent
+ HostedChatClientAgent
+ $(NoWarn);
-
-
-
-
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/Program.cs b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Program.cs
similarity index 100%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/Program.cs
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Program.cs
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/Properties/launchSettings.json b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Properties/launchSettings.json
similarity index 100%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/Properties/launchSettings.json
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/Properties/launchSettings.json
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/agent.yaml b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/agent.yaml
similarity index 100%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/agent.yaml
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/agent.yaml
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Dockerfile b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Dockerfile
similarity index 88%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Dockerfile
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Dockerfile
index 2898f31ed0..eda1f7e1e9 100644
--- a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Dockerfile
+++ b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Dockerfile
@@ -14,4 +14,4 @@ WORKDIR /app
COPY --from=build /app/publish .
EXPOSE 8088
ENV ASPNETCORE_URLS=http://+:8088
-ENTRYPOINT ["dotnet", "simple-agent.dll"]
+ENTRYPOINT ["dotnet", "HostedFoundryAgent.dll"]
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/HostedFoundryAgent.csproj b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/HostedFoundryAgent.csproj
similarity index 59%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/HostedFoundryAgent.csproj
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/HostedFoundryAgent.csproj
index a9adf5bb21..2fc0ec43e4 100644
--- a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/HostedFoundryAgent.csproj
+++ b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/HostedFoundryAgent.csproj
@@ -5,16 +5,12 @@
enable
enable
false
- SimpleAgent
- simple-agent
- $(NoWarn);NU1903;NU1605
+ HostedFoundryAgent
+ HostedFoundryAgent
+ $(NoWarn);
-
-
-
-
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Program.cs b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Program.cs
similarity index 100%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Program.cs
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Program.cs
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Properties/launchSettings.json b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Properties/launchSettings.json
similarity index 81%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Properties/launchSettings.json
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Properties/launchSettings.json
index 11588cf909..a7047d02a1 100644
--- a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/Properties/launchSettings.json
+++ b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/Properties/launchSettings.json
@@ -6,7 +6,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
- "applicationUrl": "http://localhost:8089"
+ "applicationUrl": "http://localhost:8088"
}
}
}
\ No newline at end of file
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/agent.yaml b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/agent.yaml
similarity index 100%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/agent.yaml
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/agent.yaml
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/consumption/Program.cs b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/UsingHostedAgent/Program.cs
similarity index 98%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/consumption/Program.cs
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/UsingHostedAgent/Program.cs
index f0a1e74069..774cd3781a 100644
--- a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/consumption/Program.cs
+++ b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/UsingHostedAgent/Program.cs
@@ -8,7 +8,7 @@ using Microsoft.Agents.AI;
// Load .env file if present (for local development)
Env.TraversePath().Load();
-string agentEndpoint = Environment.GetEnvironmentVariable("AGENT_ENDPOINT") ?? "http://localhost:59055";
+string agentEndpoint = Environment.GetEnvironmentVariable("AGENT_ENDPOINT") ?? "http://localhost:8088";
// ── Create an agent-framework agent backed by the remote agent endpoint ──────
// The Foundry Agent SDK's AIProjectClient can target any OpenAI-compatible endpoint.
diff --git a/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/consumption/SimpleAgent.csproj b/dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/UsingHostedAgent/SimpleAgent.csproj
similarity index 100%
rename from dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/consumption/SimpleAgent.csproj
rename to dotnet/samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/UsingHostedAgent/SimpleAgent.csproj