Skip to content

.NET: Python: Azure Functions feature branch - #1916

Merged
Dmytro Struk (dmytrostruk) merged 32 commits into
mainfrom
feature-azure-functions
Nov 13, 2025
Merged

.NET: Python: Azure Functions feature branch#1916
Dmytro Struk (dmytrostruk) merged 32 commits into
mainfrom
feature-azure-functions

Conversation

@dmytrostruk

@dmytrostruk Dmytro Struk (dmytrostruk) commented Nov 5, 2025

Copy link
Copy Markdown
Member

This PR merges the feature-azure-functions branch into main. More info on this feature below:

Durable Task extension for Microsoft Agent Framework

This PR introduces two new .NET packages and one new Python package, enabling new scenarios for MAF on Azure Functions. In particular, this extension enables hosting MAF agents in distributed, serverless environments and integrates them natively into the Durable Functions orchestrations.

Documentation

Added NuGet Packages

  • Microsoft.Agents.AI.DurableTask: Core logic for the durable extension that contains the main abstractions and can be self-hosted.
  • Microsoft.Agents.AI.Hosting.AzureFunctions: Azure Functions integration, including built-in HTTP triggers, MCP tool triggers, etc.

Added Python Packages

  • agent-framework-azurefunctions: Azure Functions integration as well as the core durable extension abstractions. This may be split into two packages (similar to .NET) in the future.

Added Samples

Several new samples have been added for both .NET and Python demonstrating how to use this new extension, covering several use cases. The samples also include detailed READMEs, guiding users through the process of running the samples locally.

Added Tests

Both the .NET and Python changes include unit and integration tests. The integration tests also take care of validating the new samples we added above, ensuring that they continue to work as we make changes. The new integration tests depend primarily on Azure OpenAI as the external resource, use Azure CLI credentials (no secrets), and have been stable for several days.

Test Modifications

In order to run our integration tests, we've updated dotnet-build-and-test.yml and python-merge-tests to run a new action, azure-functions-integration-setup which starts up two emulators (Azurite for Azure Storage and the Durable Task Scheduler emulator) as well as installing the Azure Functions Core Tools, which is used for running samples validation. This action only runs for integration tests and is not expected to contribute much to the length of the CI process.

Feature Branch PRs

…ramework (#1823)

* Add scafolding

* update readme

* add code owners and label

* update owners
@dmytrostruk Dmytro Struk (dmytrostruk) added the python Usage: [Issues, PRs], Target: Python label Nov 5, 2025
Copilot AI review requested due to automatic review settings November 5, 2025 00:42
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added the documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs label Nov 5, 2025
@dmytrostruk
Dmytro Struk (dmytrostruk) marked this pull request as draft November 5, 2025 00:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a new Python package for Azure Functions integration with the Microsoft Agent Framework. The package enables hosting Agent Framework agents on Azure Durable Functions with features like state persistence, conversation history replay, and automatic failure recovery.

  • Adds a new agent-framework-azurefunctions package under python/packages/azurefunctions/
  • Updates the uv.lock file to include the new package and its dependencies (azure-functions, azure-functions-durable, furl, orderedmultidict, werkzeug)
  • Updates transitive dependency versions (fsspec, google-auth, polars, polars-runtime-32, sse-starlette)

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
python/uv.lock Adds new package dependencies for Azure Functions integration and updates several transitive dependencies to newer versions
python/packages/azurefunctions/pyproject.toml Defines project metadata, dependencies, and build configuration for the new Azure Functions package
python/packages/azurefunctions/agent_framework_azurefunctions/init.py Creates package entry point with copyright notice
python/packages/azurefunctions/README.md Provides installation instructions and basic usage documentation for the Azure Functions integration
python/packages/azurefunctions/LICENSE Adds MIT license file for the new package
.github/CODEOWNERS Assigns code ownership for the Azure Functions package

Comment thread python/packages/azurefunctions/pyproject.toml Outdated
Comment thread python/packages/azurefunctions/README.md
@markwallace-microsoft

Mark Wallace (markwallace-microsoft) commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azurefunctions/agent_framework_azurefunctions
   _app.py3158174%165–166, 171–172, 361, 369–370, 390–392, 398–400, 406–408, 440–441, 455, 466, 483, 486, 495–497, 499–501, 503, 505–507, 518, 520–523, 525, 527–528, 530, 537–538, 540–541, 543–544, 546, 550, 560–562, 564–565, 567–569, 576, 578–579, 581, 585, 597, 667, 679, 686–688, 733, 747, 758–760, 762–765, 790, 797, 799, 802
   _callbacks.py130100% 
   _entities.py1992288%96, 144–146, 216, 224, 229–230, 257–258, 267, 274, 285, 291–292, 311–312, 382, 415–417, 419
   _errors.py5260%12–13
   _models.py1641292%202, 205, 208, 217, 220, 223, 242, 245, 250, 255, 272, 319
   _orchestration.py67986%199, 204–211
   _state.py62296%152, 169
TOTAL14655212385% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2028 129 💤 0 ❌ 0 🔥 39.365s ⏱️

@markwallace-microsoft Mark Wallace (markwallace-microsoft) added the .NET Usage: [Issues, PRs], Target: .Net label Nov 5, 2025
@github-actions github-actions Bot changed the title Python: [WIP] Azure Functions feature branch .NET: Python: [WIP] Azure Functions feature branch Nov 5, 2025
* add initial changes

* Move code and add single sample

* Update logger

* Remove unused code

* address PR comments

* cleanup code and address comments

---------

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
* Add Unit tests for Azurefunctions

* remove duplicate import
* Move all samples

* fix comments

* remove dead lines

* Make samples simpler
* Add Integration tests

* Remove DTS extension

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add pyi file for type safety

* Add samples in readme

* Updated all readme instructions

* Address comments

* Update readmes

* Fix requirements

* Address comments

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Move import to Azure

* fix mypy

* Update python/packages/azurefunctions/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add missing types

* Address comments

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…__init__.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cgillum

Chris Gillum (cgillum) commented Nov 12, 2025

Copy link
Copy Markdown
Member

I've updated PR description to remove the placeholder and add more detailed information.

Comment thread dotnet/samples/AzureFunctions/README.md
Comment thread dotnet/src/Microsoft.Agents.AI.DurableTask/DurableAgentThread.cs Outdated
- Adds a link from the /dotnet/samples/README.md to /dotnet/samples/AzureFunctions
- Make DurableAgentThread deserialization internal for future-proofing
- Update JSON serialization logic to address recently discovered issues with source generator serialization
Comment thread python/packages/azurefunctions/agent_framework_azurefunctions/_app.py Outdated
Comment thread python/packages/azurefunctions/agent_framework_azurefunctions/_app.py Outdated
Comment thread python/packages/azurefunctions/agent_framework_azurefunctions/_app.py Outdated
Comment thread python/packages/azurefunctions/pyproject.toml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs hosting Usage: [Issues, PRs], Target: all hosting related solutions .NET Usage: [Issues, PRs], Target: .Net python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants