Aspire.Hosting.Azure.Functions 13.5.1

Prefix Reserved
dotnet add package Aspire.Hosting.Azure.Functions --version 13.5.1
                    
NuGet\Install-Package Aspire.Hosting.Azure.Functions -Version 13.5.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspire.Hosting.Azure.Functions" Version="13.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.Azure.Functions" Version="13.5.1" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Hosting.Azure.Functions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aspire.Hosting.Azure.Functions --version 13.5.1
                    
#r "nuget: Aspire.Hosting.Azure.Functions, 13.5.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aspire.Hosting.Azure.Functions@13.5.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aspire.Hosting.Azure.Functions&version=13.5.1
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.Azure.Functions&version=13.5.1
                    
Install as a Cake Tool

Azure Functions hosting integration

Use this integration to model, configure, and orchestrate Azure Functions projects in an Aspire solution.

Getting started

Prerequisites

  • An Aspire project based on the starter template.
  • An Azure Functions app project.

Add the integration

From your AppHost directory, add the Aspire.Hosting.Azure.Functions integration with the Aspire CLI:

aspire add Aspire.Hosting.Azure.Functions

Usage example

In the AppHost, use AddAzureFunctionsProject to configure the Functions app resource. C# AppHosts use the generated project metadata type; TypeScript AppHosts point at the Functions app directory.

C#

using Aspire.Hosting;
using Aspire.Hosting.Azure;
using Aspire.Hosting.Azure.Functions;

var builder = new DistributedApplicationBuilder();

var storage = builder.AddAzureStorage("storage").RunAsEmulator();
var queue = storage.AddQueues("queue");
var blob = storage.AddBlobs("blob");

builder.AddAzureFunctionsProject<Projects.Company_FunctionApp>("my-functions-project")
    .WithReference(queue)
    .WithReference(blob);

var app = builder.Build();

app.Run();

TypeScript

import { createBuilder } from "./.aspire/modules/aspire.mjs";

const builder = await createBuilder();

const storage = await builder.addAzureStorage("storage").runAsEmulator();
const queue = await storage.addQueues("queue");
const blob = await storage.addBlobs("blob");

await builder.addAzureFunctionsProject("my-functions-project", "../Company.FunctionApp")
    .withReference(queue)
    .withReference(blob);

await builder.build().run();

Durable Task Scheduler (Durable Functions)

The Azure Functions hosting integration also provides resource APIs for using the Durable Task Scheduler (DTS) with Durable Functions.

In the AppHost, add a Scheduler resource, create one or more Task Hubs, and pass the connection string and hub name to your Functions app resource:

using Aspire.Hosting;
using Aspire.Hosting.Azure;
using Aspire.Hosting.Azure.Functions;

var builder = DistributedApplication.CreateBuilder(args);

var storage = builder.AddAzureStorage("storage").RunAsEmulator();

var scheduler = builder.AddDurableTaskScheduler("scheduler")
    .RunAsEmulator();

var taskHub = scheduler.AddTaskHub("taskhub");

builder.AddAzureFunctionsProject<Projects.Company_FunctionApp>("funcapp")
    .WithHostStorage(storage)
    .WithReference(taskHub);

builder.Build().Run();

Use the DTS emulator

RunAsEmulator() starts a local container running the Durable Task Scheduler emulator.

When a Scheduler runs as an emulator, Aspire automatically provides:

  • A "Scheduler Dashboard" URL for the scheduler resource.
  • A "Task Hub Dashboard" URL for each Task Hub resource.
  • A DTS_TASK_HUB_NAMES environment variable on the emulator container listing the Task Hub names associated with that scheduler.

Use an existing Scheduler

If you already have a Scheduler instance, configure the resource using its connection string:

var schedulerConnectionString = builder.AddParameter(
    "dts-connection-string",
    "Endpoint=https://existing-scheduler.durabletask.io;Authentication=DefaultAzure");

var scheduler = builder.AddDurableTaskScheduler("scheduler")
    .RunAsExisting(schedulerConnectionString);

var taskHubName = builder.AddParameter("taskhub-name", "mytaskhub");
var taskHub = scheduler.AddTaskHub("taskhub").WithTaskHubName(taskHubName);

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on Aspire.Hosting.Azure.Functions:

Repository Stars
microsoft/aspire-samples
Browse the sample apps demonstrating Aspire integration across C#, JavaScript, TypeScript, Python, Go, containers, databases, cloud, AI, and observability scenarios.
microsoft/AzUrlShortener
An simple and easy Url Shortener
J-Tech-Japan/Sekiban
Sekiban - an Opinionated Event Sourcing and CQRS Framework using C#. It can store data into Azure Cosmos DB, AWS Dynamo DB or Postgres
Azure-Samples/eShopLite
eShopLite is a set of reference .NET applications implementing an eCommerce site with features like Semantic Search, MCP, Reasoning models and more.
Version Downloads Last Updated
13.5.1 107 8/20/2026
13.5.0 2,586 8/18/2026
13.4.6 181,841 6/19/2026
13.4.5 20,969 6/17/2026
13.4.4 11,291 6/15/2026
13.4.3 42,680 6/8/2026
13.4.2 17,340 6/3/2026
13.4.1 1,160 6/3/2026
13.4.0 7,853 6/1/2026
13.3.5 55,124 5/21/2026
13.3.4 15,792 5/19/2026
13.3.3 22,055 5/15/2026
13.3.2 9,054 5/14/2026
13.3.1 9,226 5/12/2026
13.3.0 15,587 5/7/2026
13.2.4 55,271 4/24/2026
13.2.3 18,092 4/21/2026
13.2.2 47,957 4/8/2026
13.2.1 31,018 3/31/2026
13.2.0 38,414 3/23/2026
Loading failed