Aspire.Hosting.Azure
17.0.0
Prefix Reserved
dotnet add package Aspire.Hosting.Azure --version 17.0.0
NuGet\Install-Package Aspire.Hosting.Azure -Version 17.0.0
<PackageReference Include="Aspire.Hosting.Azure" Version="17.0.0" />
<PackageVersion Include="Aspire.Hosting.Azure" Version="17.0.0" />
<PackageReference Include="Aspire.Hosting.Azure" />
paket add Aspire.Hosting.Azure --version 17.0.0
#r "nuget: Aspire.Hosting.Azure, 17.0.0"
#:package Aspire.Hosting.Azure@17.0.0
#addin nuget:?package=Aspire.Hosting.Azure&version=17.0.0
#tool nuget:?package=Aspire.Hosting.Azure&version=17.0.0
Azure provisioning integration
Provides core extensions to the Aspire hosting model for Azure services.
Getting started
Prerequisites
- Azure subscription - create one for free
Add the integration
From your AppHost directory, add the Aspire.Hosting.Azure integration with the Aspire CLI:
aspire add Aspire.Hosting.Azure
Configure Azure Provisioning for local development
Adding Azure resources to the AppHost model will automatically enable development-time provisioning
for Azure resources so that you don't need to configure them manually. Provisioning requires a number of settings
to be available via AppHost configuration. From your AppHost directory, set these values with aspire secret set:
aspire secret set Azure:SubscriptionId "<your subscription id>"
aspire secret set Azure:ResourceGroupPrefix "<prefix for the resource group>"
aspire secret set Azure:Location "<azure location>"
NOTE: Developers must have Owner access to the target subscription so that role assignments can be configured for the provisioned resources.
Deploying with short-lived federated credentials
Before provisioning Azure resources, Aspire acquires the ARM token and the token scopes declared by selected Azure deployment steps. ACR login steps declare the ACR scope, including for existing and automatically created registries. Provisioning-only targets do not acquire ACR tokens unless registry login is in their selected dependency graph. The configured principal provider also resolves the deployment identity before resource-group creation.
This reduces failures when a federated assertion expires during provisioning, provided the
configured credential caches audience-specific access tokens. AzureCliCredential asks the
Azure CLI for tokens; reuse depends on the CLI/MSAL token cache, not the credential object's
lifetime. Custom credentials retain their own caching behavior.
Pre-acquisition does not renew a federated assertion or extend an access token's lifetime. If the assertion is already expired, or deployment outlasts the cached access token, fresh authentication is still required. See Azure CLI federated-token limitations. Registry token exchange and container-runtime login still occur after provisioning, when the registry endpoint is available. Offline publishing and resource destruction do not perform this deployment pre-acquisition.
Usage example
In the AppHost, add a resource based on a Bicep template:
C#
var bicepResource = builder.AddBicepTemplate("bicep", "template.bicep")
.WithParameter("parametername", "parametervalue");
TypeScript
const bicepResource = await builder.addBicepTemplate("bicep", "template.bicep")
.withParameter("parametername", "parametervalue");
Additional documentation
- https://aspire.dev/integrations/gallery/
- https://aspire.dev/integrations/cloud/azure/overview/
- https://learn.microsoft.com/azure/azure-resource-manager/bicep/overview
Feedback & contributing
| Product | Versions 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. |
-
net10.0
- Aspire.Hosting (>= 17.0.0)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Azure.Core (>= 1.63.0)
- Azure.Identity (>= 1.21.0)
- Azure.Provisioning (>= 1.6.0)
- Azure.Provisioning.KeyVault (>= 1.1.0)
- Azure.ResourceManager.Authorization (>= 1.1.7)
- Azure.ResourceManager.KeyVault (>= 1.4.0)
- Azure.ResourceManager.Resources.Deployments (>= 1.0.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.1)
- Google.Protobuf (>= 3.36.1)
- Grpc.AspNetCore (>= 2.83.0)
- Grpc.Net.ClientFactory (>= 2.83.0)
- Grpc.Tools (>= 2.83.0)
- Hex1b (>= 0.173.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.307)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.15)
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Primitives (>= 10.0.15)
- ModelContextProtocol (>= 1.4.1)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.15)
- YamlDotNet (>= 18.1.0)
NuGet packages (50)
Showing the top 5 NuGet packages that depend on Aspire.Hosting.Azure:
| Package | Downloads |
|---|---|
|
Aspire.Hosting.Azure.Storage
Azure Storage resource types for Aspire. |
|
|
Aspire.Hosting.Azure.KeyVault
Azure resource types for Aspire. |
|
|
Aspire.Hosting.Azure.ServiceBus
Azure Service Bus resource types for Aspire. |
|
|
Aspire.Hosting.Azure.Functions
Azure Functions resource types for Aspire. |
|
|
Aspire.Hosting.Azure.OperationalInsights
Azure Log Analytics resource types for Aspire. |
GitHub repositories (8)
Showing the top 8 popular GitHub repositories that depend on Aspire.Hosting.Azure:
| 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.
|
|
|
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 10, Wolverine, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
|
ProfessionalCSharp/ProfessionalCSharp2021
Source code for Professional C# and .NET 2021 Edition (with updates for C# 11 and .NET 7)
|
|
|
Azure-Samples/eShopOnAzure
A variant of https://github.com/dotnet/eShop that uses Azure services
|
|
|
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.
|
|
|
Keboo/DotnetTemplates
A repository for my dotnet templates
|
|
|
koralium/flowtide
High-performance streaming SQL query engine designed for real-time data processing. Use cases include event-driven architectures, ETL pipelines, and modern data-intensive applications.
|
|
|
PacktPublishing/Pragmatic-Microservices-with-CSharp-and-Azure
Pragmatic Microservices with C# and Azure, published by Packt
|
| Version | Downloads | Last Updated |
|---|---|---|
| 17.0.0 | 57,582 | 11/18/2026 |
| 13.6.5 | 506,115 | 11/10/2026 |
| 13.6.4 | 371,180 | 10/24/2026 |
| 13.6.3 | 78,978 | 10/21/2026 |
| 13.6.2 | 44,080 | 10/20/2026 |
| 13.6.1 | 444,492 | 10/7/2026 |
| 13.6.0 | 295,194 | 9/29/2026 |
| 13.5.4 | 408,284 | 9/15/2026 |
| 13.5.3 | 627,081 | 8/25/2026 |
| 13.5.2 | 147,875 | 8/21/2026 |
| 13.5.1 | 34,271 | 8/20/2026 |
| 13.5.0 | 75,663 | 8/18/2026 |
| 13.4.6 | 1,550,407 | 6/19/2026 |
| 13.4.5 | 199,149 | 6/17/2026 |
| 13.4.4 | 114,336 | 6/15/2026 |
| 13.4.3 | 213,992 | 6/8/2026 |
| 13.4.2 | 179,566 | 6/3/2026 |
| 13.4.1 | 2,605 | 6/3/2026 |
| 13.4.0 | 87,341 | 6/1/2026 |
| 13.3.5 | 328,994 | 5/21/2026 |