microsoft-agents-storage-blob (original) (raw)

PyPI version

Azure Blob Storage integration for Microsoft 365 Agents SDK. This library provides persistent storage for conversation state, user data, and custom agent information using Azure Blob Storage.

This library implements the storage interface for the Microsoft 365 Agents SDK using Azure Blob Storage as the backend. It enables your agents to persist conversation state, user preferences, and custom data across sessions. Perfect for production deployments where you need reliable, scalable cloud storage.

What is this?

This library is part of the Microsoft 365 Agents SDK for Python - a comprehensive framework for building enterprise-grade conversational AI agents. The SDK enables developers to create intelligent agents that work across multiple platforms including Microsoft Teams, M365 Copilot, Copilot Studio, and web chat, with support for third-party integrations like Slack, Facebook Messenger, and Twilio.

Release Notes

Version Date Release Notes
1.0.0 2026-05-22 1.0.0 Release Notes
0.9.0 2026-04-15 0.9.0 Release Notes
0.8.0 2026-02-23 0.8.0 Release Notes
0.7.0 2026-01-21 0.7.0 Release Notes
0.6.1 2025-12-01 0.6.1 Release Notes
0.6.0 2025-11-18 0.6.0 Release Notes
0.5.0 2025-10-22 0.5.0 Release Notes

Packages Overview

We offer the following PyPI packages to create conversational experiences based on Agents:

Package Name PyPI Version Description
microsoft-agents-activity PyPI Types and validators implementing the Activity protocol spec.
microsoft-agents-hosting-core PyPI Core library for Microsoft Agents hosting.
microsoft-agents-hosting-aiohttp PyPI Configures aiohttp to run the Agent.
microsoft-agents-hosting-teams PyPI Provides classes to host an Agent for Teams.
microsoft-agents-storage-blob PyPI Extension to use Azure Blob as storage.
microsoft-agents-storage-cosmos PyPI Extension to use CosmosDB as storage.
microsoft-agents-authentication-msal PyPI MSAL-based authentication for Microsoft Agents.

Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:

Package Name PyPI Version Description
microsoft-agents-copilotstudio-client PyPI Direct to Engine client to interact with Agents created in CopilotStudio

Installation

pip install microsoft-agents-storage-blob

Benefits:

Configuration Parameters

Parameter Type Required Description
container_name str Yes Name of the blob container to use
connection_string str No* Storage account connection string
url str No* Blob service URL (e.g., https://account.blob.core.windows.net)
credential TokenCredential No** Azure credential for authentication

*Either connection_string OR (url + credential) must be provided
**Required when using url

Azure Managed Identity

When running in Azure (App Service, Functions, Container Apps), use Managed Identity:

from azure.identity import ManagedIdentityCredential

config = BlobStorageConfig( container_name="agent-storage", url="https://myaccount.blob.core.windows.net", credential=ManagedIdentityCredential() )

Azure RBAC Roles Required:

Benefits of switching to BlobStorage:

Best Practices

  1. Use Token Authentication in Production - Avoid storing connection strings; use Managed Identity or DefaultAzureCredential
  2. Initialize Once - Call storage.initialize() during app startup, not on every request
  3. Implement Retry Logic - Handle transient failures with exponential backoff
  4. Monitor Performance - Use Azure Monitor to track storage operations
  5. Set Lifecycle Policies - Configure automatic cleanup of old data in Azure Portal
  6. Use Consistent Naming - Establish key naming conventions (e.g., user:{id}, conversation:{id})
  7. Batch Operations - Read/write multiple items together when possible

Key Classes Reference

Sample Applications

Name Description README
Quickstart Simplest agent Quickstart
Auto Sign In Simple OAuth agent using Graph and GitHub auto-signin
OBO Authorization OBO flow to access a Copilot Studio Agent obo-authorization
Semantic Kernel Integration A weather agent built with Semantic Kernel semantic-kernel-multiturn
Streaming Agent Streams OpenAI responses azure-ai-streaming
Copilot Studio Client Console app to consume a Copilot Studio Agent copilotstudio-client
Cards Agent Agent that uses rich cards to enhance conversation design cards