.NET Aspire provides first-class support for deploying to Azure Container Apps, a fully managed serverless container platform that handles infrastructure, scaling, and monitoring.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dotnet/aspire/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Azure subscription
- Azure CLI installed and authenticated
- .NET Aspire application with AppHost project
- Aspire CLI installed (
dotnet tool install -g aspire)
Azure Container Apps Deployment
Azure Container Apps is the recommended deployment target for Aspire applications, offering:- Automatic scaling based on HTTP traffic, events, or CPU/memory
- Built-in ingress and load balancing
- Managed identity and Azure service integration
- Container registry integration
- Observability with Azure Monitor
Setting Up Container App Environment
Add an Azure Container Apps environment to your AppHost:- Container App Environment: The managed environment for your containers
- Container Registry: Azure Container Registry for storing images
- Log Analytics Workspace: For logs and metrics
- Managed Identity: For secure Azure resource access
Customizing the Environment
Using Azure Naming Conventions
Configure resources to use azd-compatible naming:cae-{uniqueString}- Container App Environmentacr-{uniqueString}- Container Registrylaw-{uniqueString}- Log Analytics Workspacemi-{uniqueString}- Managed Identity
Compact Resource Naming
For length-constrained resources (like storage accounts), use compact naming:Configuring the Aspire Dashboard
Control whether the Aspire Dashboard is deployed:Using Custom Log Analytics Workspace
Reference an existing Log Analytics workspace:HTTPS Endpoint Upgrade
By default, HTTP endpoints are upgraded to HTTPS for security:Deploying the Application
Deploy your application using the Aspire CLI:- Builds container images for all project resources
- Pushes images to the provisioned Azure Container Registry
- Generates Bicep/ARM templates for infrastructure
- Deploys resources to Azure
Understanding Deployment Targets
When you add an Azure Container Apps environment, Aspire automatically annotates compute resources with deployment target information:- Which container registry to push images to
- Which Container App Environment to deploy to
- How to configure the container app
Manifest Generation for Azure
When deploying to Azure Container Apps, the manifest includes deployment metadata:Azure Resource Integration
Aspire provides seamless integration with Azure services:Azure Storage
Azure Cosmos DB
Azure Service Bus
Azure SQL Database
Infrastructure as Code
Aspire uses Azure Bicep for infrastructure provisioning. The infrastructure code is generated from your app model.Custom Infrastructure
Customize the generated infrastructure:Azure Provisioning Options
Configure global Azure provisioning settings:Deployment Best Practices
Use Managed Identities
Use Managed Identities
Avoid storing credentials by using Azure Managed Identity:In production, managed identity is used automatically.
Separate Environments
Separate Environments
Use different environments for dev, staging, and production:
Monitor Deployments
Monitor Deployments
Use Azure Monitor and Application Insights:
Configure Scaling
Configure Scaling
Container Apps automatically scale, but you can customize:
Troubleshooting
Common Issues
- Missing Container Registry
- Authentication Failures
- Resource Name Conflicts
Error: No container registry associated with environmentSolution: Ensure the Container Apps environment is properly configured:The registry is created automatically.
Next Steps
Azure Hosting Integrations
Explore all available Azure service integrations
Kubernetes Deployment
Learn about deploying to Kubernetes clusters
CLI Deploy Command
Full reference for the aspire deploy command
App Model
Understand the Aspire application model