Skip to content

Commit 59acf52

Browse files
authored
Merge pull request #307638 from mattchenderson/aspire-ga
Updating Aspire docs for GA
2 parents fc4bed1 + e2061c3 commit 59acf52

3 files changed

Lines changed: 74 additions & 21 deletions

File tree

articles/azure-functions/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
- name: Isolated worker model
298298
displayName: .NET isolated
299299
href: dotnet-isolated-process-guide.md
300-
- name: .NET Aspire integration (Preview)
300+
- name: Aspire integration
301301
href: dotnet-aspire-integration.md
302302
- name: Legacy models
303303
items:

articles/azure-functions/dotnet-aspire-integration.md

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,25 @@ title: Guide for Using Azure Functions with Aspire
33
description: Learn how to use Azure Functions with Aspire, which simplifies authoring of distributed applications in the cloud.
44
ms.service: azure-functions
55
ms.topic: conceptual
6-
ms.date: 04/21/2025
6+
ms.date: 10/31/2025
77
---
88

9-
# Azure Functions with Aspire (preview)
9+
# Azure Functions with Aspire
1010

1111
[Aspire](/dotnet/aspire/get-started/aspire-overview) is an opinionated stack that simplifies development of distributed applications in the cloud. The integration of Aspire with Azure Functions enables you to develop, debug, and orchestrate an Azure Functions .NET project as part of the Aspire app host.
1212

13-
> [!IMPORTANT]
14-
> The integration of Aspire with Azure Functions is currently in preview and is subject to change.
15-
1613
## Prerequisites
1714

1815
Set up your development environment for using Azure Functions with Aspire:
1916

20-
- Install the [.NET 9 SDK](https://dotnet.microsoft.com/download/dotnet/9.0) and [Aspire 9.0 or later](/dotnet/aspire/fundamentals/setup-tooling). Although the .NET 9 SDK is required, Aspire 9.0 supports the .NET 8 and .NET 9 frameworks.
21-
- If you use Visual Studio, update to version 17.12 or later. You must also have the latest version of the Azure Functions tools for Visual Studio. To check for updates:
17+
- [Install the Aspire Prerequisites](/dotnet/aspire/fundamentals/setup-tooling#install-aspire-prerequisites).
18+
- Full support for the Azure Functions integration requires Aspire 13.1 or later. Aspire 13.0 also includes a preview version of `Aspire.Hosting.Azure.Functions` which acts as a release candidate with go-live support.
19+
- Install the [Azure Functions Core Tools](./functions-run-local.md).
20+
21+
If you use Visual Studio, update to version 17.12 or later. You must also have the latest version of the Azure Functions tools for Visual Studio. To check for updates:
2222
1. Go to **Tools** > **Options**.
2323
1. Under **Projects and Solutions**, select **Azure Functions**.
2424
1. Select **Check for updates** and install updates as prompted.
25-
26-
> [!NOTE]
27-
> The Azure Functions integration with Aspire doesn't yet support .NET 10 Preview.
2825

2926
## Solution structure
3027

@@ -176,11 +173,18 @@ For details on the connection formats that each binding supports, and the permis
176173

177174
## Hosting the application
178175

179-
By default, when you publish an Azure Functions project to Azure, it's deployed to Azure Container Apps.
176+
Aspire supports two different ways to host your Functions project in Azure:
177+
178+
- [Publish as a container app (default)](#publish-as-a-container-app)
179+
- [Publish as a function app](#publish-as-a-function-app) using preview App Service integration
180180

181-
During the preview period, the container app resources don't support event-driven scaling. Azure Functions support is not available for apps deployed in this mode. If you need to open a support ticket, select the Azure Container Apps resource type.
181+
In both cases, your project is deployed as a container. Aspire takes care of building the container image for you and pushing it to Azure Container Registry.
182182

183-
### Access keys
183+
### Publish as a container app
184+
185+
By default, when you publish an Aspire project to Azure, it's deployed to Azure Container Apps. The system sets up scaling rules for your Functions project using [KEDA](https://keda.sh/). When using Azure Container Apps, additional setup is needed for function keys. See [Access keys on Azure Container Apps](#access-keys-on-azure-container-apps) for more information.
186+
187+
#### Access keys on Azure Container Apps
184188

185189
Several Azure Functions scenarios use access keys to provide a basic mitigation against unwanted access. For example, HTTP trigger functions by default require an access key to be invoked, though this requirement can be disabled using the [`AuthLevel` property](./functions-bindings-http-webhook-trigger.md#attributes). See [Work with access keys in Azure Functions](./function-keys-how-to.md) for scenarios which may require a key.
186190

@@ -329,12 +333,60 @@ This example uses a default key vault created by the extension method. It result
329333

330334
To use these keys from clients, you need to retrieve them from the key vault.
331335

336+
### Publish as a function app
337+
338+
> [!NOTE]
339+
> Publishing as a function app requires the Aspire Azure App Service integration, which is currently in preview.
340+
341+
You can configure Aspire to deploy to a function app using the [Aspire Azure App Service integration](/dotnet/aspire/azure/azure-app-service-integration). Because Aspire publishes the Functions project as a container, the hosting plan for your function app must support deploying containerized applications.
342+
343+
To publish your Aspire Functions project as a function app, follow these steps:
344+
345+
1. Add a reference to the [Aspire.Hosting.Azure.AppService] NuGet package in your app host project.
346+
1. In the `AppHost.cs` file, call `AddAzureAppServiceEnvironment()` on your `IDistributedApplicationBuilder` instance to create an App Service plan. Note that despite the name, this does not provision an App Service Environment resource.
347+
1. On the Functions project resource, call `.WithExternalHttpEndpoints()`. This is required for deploying with the Aspire Azure App Service integration.
348+
1. On the Functions project resource, call `.PublishAsAzureAppServiceWebsite((infra, app) => app.Kind = "functionapp,linux")` to publish that project to the plan.
349+
350+
> [!IMPORTANT]
351+
> Make sure that you set the `app.Kind` property to `"functionapp,linux"`. This setting ensures the resource is created as a function app, which affects experiences for working with your application.
352+
353+
The following example shows a minimal `AppHost.cs` file for an app host project that publishes a Functions project as a function app:
354+
355+
```csharp
356+
var builder = DistributedApplication.CreateBuilder(args);
357+
builder.AddAzureAppServiceEnvironment("functions-env");
358+
builder.AddAzureFunctionsProject<Projects.MyFunctionsProject>("MyFunctionsProject")
359+
.WithExternalHttpEndpoints()
360+
.PublishAsAzureAppServiceWebsite((infra, app) => app.Kind = "functionapp,linux");
361+
```
362+
363+
By default, this configuration creates a Premium V3 plan. When using a dedicated App Service plan SKU, scaling isn't event-based. Instead, scaling is managed through the App Service plan settings. If you want to change the SKU, you can do so through the `ConfigureInfrastructure` method on the environment resource. The following example shows how you can set up an Elastic Premium plan:
364+
365+
```csharp
366+
using Azure.Provisioning.AppService;
367+
368+
var builder = DistributedApplication.CreateBuilder(args);
369+
builder.AddAzureAppServiceEnvironment("functions-env");
370+
.ConfigureInfrastructure(infra =>
371+
{
372+
var plan = infra.GetProvisionableResources().OfType<AppServicePlan>().First();
373+
plan.Sku = new AppServiceSkuDescription
374+
{
375+
Name = "EP1",
376+
Tier = "ElasticPremium"
377+
};
378+
});
379+
builder.AddAzureFunctionsProject<Projects.MyFunctionsProject>("MyFunctionsProject")
380+
.WithExternalHttpEndpoints()
381+
.PublishAsAzureAppServiceWebsite((infra, app) => app.Kind = "functionapp,linux");
382+
```
383+
384+
When you configure the plan to use an Elastic Premium SKU, you can only publish Functions projects to that plan. If your app host project includes other web apps, you should use a dedicated App Service plan SKU.
385+
332386
## Considerations and best practices
333387

334388
Consider the following points when you're evaluating the integration of Azure Functions with Aspire:
335389

336-
- Support for the integration is currently in preview.
337-
338390
- Trigger and binding configuration through Aspire is currently limited to specific integrations. For details, see [Connection configuration with Aspire](#connection-configuration-with-aspire) in this article.
339391

340392
- Your function project's `Program.cs` file should use the `IHostApplicationBuilder` version of [host instance startup](./dotnet-isolated-process-guide.md#start-up-and-configuration). `IHostApplicationBuilder` allows you to call `builder.AddServiceDefaults()` to add [Aspire service defaults](/dotnet/aspire/fundamentals/service-defaults) to your Functions project.
@@ -354,6 +406,7 @@ Consider the following points when you're evaluating the integration of Azure Fu
354406
[Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore]: https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore/
355407

356408
[Aspire.Hosting.Azure.Functions]: https://www.nuget.org/packages/Aspire.Hosting.Azure.Functions
409+
[Aspire.Hosting.Azure.AppService]: https://www.nuget.org/packages/Aspire.Hosting.Azure.AppService
357410

358411
[Storage Account Contributor]: ../role-based-access-control/built-in-roles.md#storage-account-contributor
359412
[Storage Blob Data Owner]: ../role-based-access-control/built-in-roles.md#storage-blob-data-owner

articles/azure-functions/dotnet-isolated-process-guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -921,11 +921,11 @@ host.Run();
921921

922922
### Application Insights
923923

924-
You can configure your isolated process application to emit logs directly to [Application Insights](/azure/azure-monitor/app/app-insights-overview?tabs=net). This behavior replaces the default behavior of [relaying logs through the host](./configure-monitoring.md#custom-application-logs). Unless you are using [Aspire](#aspire-preview), configuring direct Application Insights integration is recommended because it gives you control over how those logs are emitted.
924+
You can configure your isolated process application to emit logs directly to [Application Insights](/azure/azure-monitor/app/app-insights-overview?tabs=net). This behavior replaces the default behavior of [relaying logs through the host](./configure-monitoring.md#custom-application-logs). Unless you are using [Aspire](#aspire), configuring direct Application Insights integration is recommended because it gives you control over how those logs are emitted.
925925

926926
Application Insights integration is not enabled by default in all setup experiences. Some templates will create Functions projects with the necessary packages and startup code commented out. If you want to use Application Insights integration, you can uncomment these lines in `Program.cs` and the project's `.csproj` file. The instructions in the rest of this section also describe how to enable the integration.
927927

928-
If your project is part of an [Aspire orchestration](#aspire-preview), it uses OpenTelemetry for monitoring instead. You should not enable direct Application Insights integration within Aspire projects. Instead, configure the Azure Monitor OpenTelemetry exporter as part of the [service defaults project](/dotnet/aspire/fundamentals/service-defaults#opentelemetry-configuration). If your Functions project uses Application Insights integration in an Aspire context, the application will error on startup.
928+
If your project is part of an [Aspire orchestration](#aspire), it uses OpenTelemetry for monitoring instead. You should not enable direct Application Insights integration within Aspire projects. Instead, configure the Azure Monitor OpenTelemetry exporter as part of the [service defaults project](/dotnet/aspire/fundamentals/service-defaults#opentelemetry-configuration). If your Functions project uses Application Insights integration in an Aspire context, the application will error on startup.
929929

930930
#### Install packages
931931

@@ -1218,9 +1218,9 @@ There are a few requirements for running .NET functions in the isolated worker m
12181218

12191219
When you create your function app in Azure using the methods in the previous section, these required settings are added for you. When you create these resources [by using ARM templates or Bicep files for automation](functions-infrastructure-as-code.md), you must make sure to set them in the template.
12201220

1221-
## <a name = "net-aspire-preview"></a>Aspire (Preview)
1221+
## <a name = "net-aspire-preview"></a>Aspire
12221222

1223-
[Aspire](/dotnet/aspire/get-started/aspire-overview) is an opinionated stack that simplifies development of distributed applications in the cloud. You can enlist .NET 8 and .NET 9 isolated worker model projects in Aspire 9.0 orchestrations using preview support. See [Azure Functions with Aspire (Preview)](./dotnet-aspire-integration.md) for more information.
1223+
[Aspire](/dotnet/aspire/get-started/aspire-overview) is an opinionated stack that simplifies development of distributed applications in the cloud. You can enlist isolated worker model projects in Aspire 13 orchestrations. See [Azure Functions with Aspire](./dotnet-aspire-integration.md) for more information.
12241224

12251225
## Debugging
12261226

@@ -1326,7 +1326,7 @@ Azure Functions currently can be used with the following "Preview" or "Go-live"
13261326
| Windows | .NET 10 Preview 5<sup>1,2</sup> |
13271327

13281328
1. Apps targeting .NET 10 must use [version 2.0.5 or later of `Microsoft.Azure.Functions.Worker.Sdk`][Microsoft.Azure.Functions.Worker.Sdk]. You should also update to [version 2.50.0-preview1 or later of `Microsoft.Azure.Functions.Worker`][Microsoft.Azure.Functions.Worker], which updates dependencies to align with .NET 10. When using Visual Studio, you also need to use [Visual Studio 2026 Insiders][vs-insiders] and [update the Functions tools and templates](#considerations-for-using-net-preview-versions) to version 4.114.0 or later.
1329-
2. For the latest information about support for .NET 10 in public Azure, see this [tracking thread on GitHub](https://github.com/Azure/azure-functions-dotnet-worker/issues/3152).
1329+
2. For the latest information about support for .NET 10 in global Azure, see this [tracking thread on GitHub](https://github.com/Azure/azure-functions-dotnet-worker/issues/3152).
13301330
3. You can't run .NET 10 apps on Linux in the Consumption plan. To run on Linux, you should instead use the [Flex Consumption plan](./flex-consumption-plan.md).
13311331

13321332
See [Supported versions][supported-versions] for a list of generally available releases that you can use.

0 commit comments

Comments
 (0)