Hosting Samples update

This commit is contained in:
Roger Barreto
2026-04-11 12:05:44 +01:00
Unverified
parent 026f71ac32
commit eb7f8617c1
13 changed files with 13 additions and 21 deletions
+3 -3
View File
@@ -275,13 +275,13 @@
</Folder>
<Folder Name="/Samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/" />
<Folder Name="/Samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/">
<Project Path="samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/instance-hosting/HostedChatClientAgent.csproj" />
<Project Path="samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-ChatClientAgent/HostedChatClientAgent.csproj" />
</Folder>
<Folder Name="/Samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/">
<Project Path="samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/foundry-hosting/HostedFoundryAgent.csproj" />
<Project Path="samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/Hosted-FoundryAgent/HostedFoundryAgent.csproj" />
</Folder>
<Folder Name="/Samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/UsingHostedAgent/">
<Project Path="samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/consumption/SimpleAgent.csproj" />
<Project Path="samples/04-hosting/FoundryHostedAgents/HostedAgentsV2/UsingHostedAgent/SimpleAgent.csproj" />
</Folder>
<Folder Name="/Samples/04-hosting/FoundryResponsesHosting/">
<Project Path="samples/04-hosting/FoundryResponsesHosting/FoundryResponsesHosting.csproj" />
@@ -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"]
@@ -5,16 +5,12 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
<RootNamespace>SimpleAgent</RootNamespace>
<AssemblyName>simple-agent</AssemblyName>
<NoWarn>$(NoWarn);NU1903;NU1605</NoWarn>
<RootNamespace>HostedChatClientAgent</RootNamespace>
<AssemblyName>HostedChatClientAgent</AssemblyName>
<NoWarn>$(NoWarn);</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.AI.Projects" />
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Azure.Core" />
<PackageReference Include="DotNetEnv" />
</ItemGroup>
@@ -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"]
@@ -5,16 +5,12 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
<RootNamespace>SimpleAgent</RootNamespace>
<AssemblyName>simple-agent</AssemblyName>
<NoWarn>$(NoWarn);NU1903;NU1605</NoWarn>
<RootNamespace>HostedFoundryAgent</RootNamespace>
<AssemblyName>HostedFoundryAgent</AssemblyName>
<NoWarn>$(NoWarn);</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.AI.Projects" />
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" />
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Azure.Core" />
<PackageReference Include="DotNetEnv" />
</ItemGroup>
@@ -6,7 +6,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:8089"
"applicationUrl": "http://localhost:8088"
}
}
}
@@ -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.