Skip to content

Commit 0e152a0

Browse files
authored
.NET: [Durable Agents] Reliable streaming sample (#2942)
* .NET: [Durable Agents] Reliable streaming sample * Add automated validation for new sample * Address Copilot PR feedback
1 parent 3b77192 commit 0e152a0

File tree

13 files changed

+1344
-0
lines changed

13 files changed

+1344
-0
lines changed

.github/actions/azure-functions-integration-setup/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ runs:
2828
echo "Waiting for Azurite (Azure Storage emulator) to be ready"
2929
timeout 30 bash -c 'until curl --silent http://localhost:10000/devstoreaccount1; do sleep 1; done'
3030
echo "Azurite (Azure Storage emulator) is ready"
31+
- name: Start Redis
32+
shell: bash
33+
run: |
34+
if [ "$(docker ps -aq -f name=redis)" ]; then
35+
echo "Stopping and removing existing Redis"
36+
docker rm -f redis
37+
fi
38+
echo "Starting Redis"
39+
docker run -d --name redis -p 6379:6379 redis:latest
40+
echo "Waiting for Redis to be ready"
41+
timeout 30 bash -c 'until docker exec redis redis-cli ping | grep -q PONG; do sleep 1; done'
42+
echo "Redis is ready"
3143
- name: Install Azure Functions Core Tools
3244
shell: bash
3345
run: |

dotnet/Directory.Packages.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@
125125
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.1.0" />
126126
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Mcp" Version="1.0.0" />
127127
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.7" />
128+
<!-- Redis -->
129+
<PackageVersion Include="StackExchange.Redis" Version="2.10.1" />
128130
<!-- Test -->
129131
<PackageVersion Include="FluentAssertions" Version="8.8.0" />
130132
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Condition="'$(TargetFramework)' == 'net8.0'" Version="8.0.22" />

dotnet/agent-framework-dotnet.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<Project Path="samples/AzureFunctions/05_AgentOrchestration_HITL/05_AgentOrchestration_HITL.csproj" />
3434
<Project Path="samples/AzureFunctions/06_LongRunningTools/06_LongRunningTools.csproj" />
3535
<Project Path="samples/AzureFunctions/07_AgentAsMcpTool/07_AgentAsMcpTool.csproj" />
36+
<Project Path="samples/AzureFunctions/08_ReliableStreaming/08_ReliableStreaming.csproj" />
3637
</Folder>
3738
<Folder Name="/Samples/GettingStarted/">
3839
<File Path="samples/GettingStarted/README.md" />
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net10.0</TargetFrameworks>
4+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
5+
<OutputType>Exe</OutputType>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<!-- The Functions build tools don't like namespaces that start with a number -->
9+
<AssemblyName>ReliableStreaming</AssemblyName>
10+
<RootNamespace>ReliableStreaming</RootNamespace>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
15+
</ItemGroup>
16+
17+
<!-- Azure Functions packages -->
18+
<ItemGroup>
19+
<PackageReference Include="Microsoft.Azure.Functions.Worker" />
20+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" />
21+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask.AzureManaged" />
22+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" />
23+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<PackageReference Include="Azure.AI.OpenAI" />
28+
<PackageReference Include="Azure.Identity" />
29+
</ItemGroup>
30+
31+
<!-- Redis for reliable streaming -->
32+
<ItemGroup>
33+
<PackageReference Include="StackExchange.Redis" />
34+
</ItemGroup>
35+
36+
<!-- Local projects that should be switched to package references when using the sample outside of this MAF repo -->
37+
<!--
38+
<ItemGroup>
39+
<PackageReference Include="Microsoft.Agents.AI.Hosting.AzureFunctions" />
40+
<PackageReference Include="Microsoft.Agents.AI.OpenAI" />
41+
</ItemGroup>
42+
-->
43+
<ItemGroup>
44+
<ProjectReference Include="..\..\..\src\Microsoft.Agents.AI.Hosting.AzureFunctions\Microsoft.Agents.AI.Hosting.AzureFunctions.csproj" />
45+
<ProjectReference Include="..\..\..\src\Microsoft.Agents.AI.OpenAI\Microsoft.Agents.AI.OpenAI.csproj" />
46+
</ItemGroup>
47+
</Project>

0 commit comments

Comments
 (0)