Aspire.Hosting.Azure.Functions 17.0.0

Prefix Reserved
dotnet add package Aspire.Hosting.Azure.Functions --version 17.0.0
                    
NuGet\Install-Package Aspire.Hosting.Azure.Functions -Version 17.0.0
                    
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="17.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.Azure.Functions" Version="17.0.0" />
                    
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 17.0.0
                    
#r "nuget: Aspire.Hosting.Azure.Functions, 17.0.0"
                    
#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@17.0.0
                    
#: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=17.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.Azure.Functions&version=17.0.0
                    
Install as a Cake Tool

Azure Functions hosting integration

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

Getting started

Prerequisites

  • An Aspire project based on the starter template.
  • An Azure Functions app. .NET isolated worker apps can be referenced as projects. TypeScript and JavaScript apps can be referenced by directory.
  • Azure Functions Core Tools for local JavaScript Functions apps. TypeScript Functions apps normally reference azure-functions-core-tools from devDependencies and run it through an npm script.

Add the integration

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

aspire add Aspire.Hosting.Azure.Functions

The .NET Functions resource deliberately retains AddAzureFunctionsProject and its specialized Functions host/debug behavior. Do not replace it with ordinary AddDotnetProject; that migration is tracked separately in #21345. Keep its required generated project metadata and build references. See the project migration guide.

Usage example

In the AppHost, add an Azure Functions app resource and reference Azure resources with either C# or TypeScript.

C# - .NET isolated worker project

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

var builder = DistributedApplication.CreateBuilder(args);

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

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

builder.Build().Run();

C# - TypeScript or JavaScript app directory

#pragma warning disable ASPIREAZUREFUNCTIONS001

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

var builder = DistributedApplication.CreateBuilder(args);

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

builder.AddAzureFunctionsApp("functions", "../functions", AzureFunctionsLanguage.TypeScript)
    .WithReference(blob);

builder.Build().Run();

#pragma warning restore ASPIREAZUREFUNCTIONS001

TypeScript

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

const builder = await createBuilder();

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

await builder.addAzureFunctionsApp("functions", "../functions", AzureFunctionsLanguage.TypeScript)
    .withReference(blob);

await builder.build().run();

TypeScript and JavaScript Functions apps

The directory-based APIs (AddAzureFunctionsApp, AzureFunctionsAppResource, AzureFunctionsLanguage, and the app-specific extension overloads) are experimental pending API review and may change or be removed. C# callers must opt in by suppressing diagnostic ASPIREAZUREFUNCTIONS001, for example with #pragma warning disable ASPIREAZUREFUNCTIONS001. The existing .NET project APIs are unaffected.

Directory-based Functions apps run on the Azure Functions Node worker with FUNCTIONS_WORKER_RUNTIME set to node.

TypeScript apps are started with:

npm run start -- --port <port>

The Functions app should include scripts similar to the standard Azure Functions TypeScript template:

{
  "scripts": {
    "build": "tsc",
    "prestart": "npm run build",
    "start": "func start"
  },
  "devDependencies": {
    "azure-functions-core-tools": "^4.0.0",
    "typescript": "^5.0.0"
  }
}

JavaScript apps are started directly with:

func host start --port <port>

Use WithHostStorage to choose the Azure Storage resource used by the Functions host. If host storage is not specified, Aspire adds an implicit storage resource for the Functions runtime.

Publish and deployment

When a TypeScript or JavaScript Functions app does not include a Dockerfile, Aspire publish generates a Dockerfile that uses the official Azure Functions Node image, copies the app to /home/site/wwwroot, installs npm dependencies, and runs npm run build for TypeScript apps. After the build (or installation for JavaScript), it runs npm prune --omit=dev so the deployed app retains only production dependencies.

If the Functions app directory already contains a Dockerfile, Aspire uses that Dockerfile instead. Use this to select a different Azure Functions Node image, customize the Node version, or add project-specific build steps.

When deployed to Azure Container Apps, Functions resources are published with the container app kind set to functionapp and the Functions container port set to 80.

Debugging

.NET isolated worker Functions projects use the Azure Functions extension integration for debugging.

TypeScript and JavaScript Functions apps use VS Code JavaScript debugging. Aspire does not add a service-discovery endpoint for the Node inspector. During a VS Code debug session, the Aspire extension starts the Functions host with a loopback-only Node inspector port by setting languageWorkers__node__arguments, then attaches the JavaScript debugger to that port.

TypeScript debugging assumes the standard Azure Functions TypeScript output under dist/**/*.js unless an explicit VS Code debugger configuration overrides outFiles.

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.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 "Manage" 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 net10.0 is compatible.  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
A 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
17.0.0 0 11/18/2026
13.6.5 45,359 11/10/2026
13.6.4 72,432 10/24/2026
13.6.3 15,953 10/21/2026
13.6.2 10,653 10/20/2026
13.6.1 70,301 10/7/2026
13.6.0 45,298 9/29/2026
13.5.4 72,177 9/15/2026
13.5.3 123,886 8/25/2026
13.5.2 39,944 8/21/2026
13.5.1 12,343 8/20/2026
13.5.0 14,902 8/18/2026
13.4.6 367,937 6/19/2026
13.4.5 31,216 6/17/2026
13.4.4 15,564 6/15/2026
13.4.3 56,289 6/8/2026
13.4.2 23,962 6/3/2026
13.4.1 1,592 6/3/2026
13.4.0 11,180 6/1/2026
13.3.5 78,272 5/21/2026
Loading failed