Skip to content

Conversation

@DeagleGross
Copy link
Contributor

Motivation and Context

Added a new package, which adds the API to configure AgentThreadStore for AIAgent to 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

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@DeagleGross DeagleGross self-assigned this Nov 4, 2025
@github-actions github-actions bot changed the title Add AzureStorageBlob integration as AgentThreadStore support .NET: Add AzureStorageBlob integration as AgentThreadStore support Nov 4, 2025
@DeagleGross DeagleGross marked this pull request as ready for review November 4, 2025 18:07
Copilot AI review requested due to automatic review settings November 4, 2025 18:07
/// Provides extension methods for configuring <see cref="AIAgent"/>.
/// </summary>
public static partial class HostedAgentBuilderExtensions
{
Copy link
Contributor Author

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.

Copy link
Contributor

Copilot AI left a 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 AzureBlobAgentThreadStore implementation 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");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants