Understanding resources
Bu içerik henüz dilinizde mevcut değil.
Aspire makes it easy to define everything your app needs—frontends, APIs, databases, and more—using the AppHost. Just describe your resources in code, and Aspire handles the connections for you.
Types of resources
Section titled “Types of resources”Resources can include:
- AI Services: Large Language Models, AI endpoints, and cognitive services.
- Caches: Redis, in-memory caches, and distributed caching solutions.
- Containers: Docker containers for databases, message brokers, and other services.
- Databases: SQL Server, PostgreSQL, MySQL, MongoDB, and other data stores.
- Executables: Console applications, scripts, and background services.
- Frameworks: Web applications, APIs, and microservices built with various frameworks.
- Messaging Services: Service Bus, RabbitMQ, Kafka, and other messaging systems.
- Projects: .NET projects, Node.js applications, Python services, and more.
- Storage: Blob storage, file systems, and cloud storage services.
Resource dependencies
Section titled “Resource dependencies”Resources work together through explicit dependencies that you define in your AppHost. When you model these dependencies, Aspire automatically handles the wiring, startup order, and connection management—letting you focus on building your app instead of managing infrastructure.
For example, if your API service depends on a database and configures a wait strategy, Aspire can automatically inject the connection string and ensure the database is started before the API service.
- Start the database first.
- Wait for it to become healthy.
- Inject the connection string into your API service.
- Start your API service.
Discover how to model Resource Hierarchies and represent complex app structures.
Resource configuration
Section titled “Resource configuration”You configure resources through a combination of environment variables (for mutable per-environment values), automatically injected connection strings that flow to dependent services, explicit resource parameters controlling ports, volumes, or other knobs, and custom health checks that let Aspire understand readiness beyond simple process status.
Custom resources
Section titled “Custom resources”Under-the-hood, every integration is either a Container or Executable, meaning you can add any container image, codebase, script, or cloud resource to your AppHost. Creating reusable Aspire integrations is just like creating a reusable UI component. It can be as simple or complex as you need, and is fully shareable.
Resource lifecycle
Section titled “Resource lifecycle”Aspire manages the complete lifecycle of your resources during local development:
- Discovery: Resources are discovered and their dependencies are analyzed.
- Startup: Resources are started in dependency order, respecting their relationships.
- Health Monitoring: Resource health and readiness are continuously monitored.
- Shutdown: Resources are gracefully stopped when the application terminates.
Explore how Built-In Resources and Lifecycle work together to power your applications.