-
Notifications
You must be signed in to change notification settings - Fork 682
.NET: Add AzureStorageBlob integration as AgentThreadStore support #1893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| /// Provides extension methods for configuring <see cref="AIAgent"/>. | ||
| /// </summary> | ||
| public static partial class HostedAgentBuilderExtensions | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we need other API here, but felt like BlobContainerClient is the best option - it allows to set the most granular access to the container itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Azure Blob Storage integration for agent thread persistence to the Microsoft Agent Framework. It introduces a new project Microsoft.Agents.AI.Hosting.AzureStorage that provides an implementation of AgentThreadStore using Azure Blob Storage, along with corresponding unit tests.
Key Changes:
- New
AzureBlobAgentThreadStoreimplementation for persisting agent threads to Azure Blob Storage - Extension methods to configure agents with Azure Blob thread store
- Unit tests with Azurite emulator support for local testing
- CI/CD workflow updates to start Azurite for running tests
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Hosting.AzureStorage/Blob/AzureBlobAgentThreadStore.cs | Core implementation for Azure Blob Storage thread persistence |
| dotnet/src/Microsoft.Agents.AI.Hosting.AzureStorage/Blob/AzureBlobAgentThreadStoreOptions.cs | Configuration options for the blob store |
| dotnet/src/Microsoft.Agents.AI.Hosting.AzureStorage/HostedAgentBuilderExtensions.Blob.cs | Extension methods for configuring agents with blob storage |
| dotnet/tests/Microsoft.Agents.AI.Hosting.AzureStorage.UnitTests/AzureBlobAgentThreadStoreTests.cs | Unit tests for the blob store implementation |
| dotnet/tests/Microsoft.Agents.AI.Hosting.AzureStorage.UnitTests/TestRunner.cs | Test helper for running agent scenarios |
| dotnet/tests/Microsoft.Agents.AI.Hosting.AzureStorage.UnitTests/Mock/MockChatClient.cs | Mock chat client for testing |
| dotnet/tests/Microsoft.Agents.AI.Hosting.AzureStorage.UnitTests/AzureStorageEmulatorAvailabilityHelper.cs | Helper for checking Azurite availability |
| dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Program.cs | Sample code demonstrating blob storage usage |
| .github/workflows/dotnet-build-and-test.yml | CI workflow updated to start Azurite |
Comments suppressed due to low confidence (1)
dotnet/tests/Microsoft.Agents.AI.Hosting.AzureStorage.UnitTests/Mock/MockChatClient.cs:28
- This assignment to lastUserMessage is useless, since its value is never read.
ChatMessage lastUserMessage = messageList.LastOrDefault(m => m.Role == ChatRole.User)
?? new ChatMessage(ChatRole.User, "No user message");
Motivation and Context
Added a new package, which adds the API to configure
AgentThreadStoreforAIAgentto use AzureStorageBlob as the agent thread store. It adds persistence of the thread to the application, and makes Hosting packages production-suitable covering persistence.Contribution Checklist