Get started with Dapr and Aspire
Esta página aún no está disponible en tu idioma.
Dapr is a portable runtime for building distributed applications with APIs for service invocation, state, messaging, secrets, and more. The Aspire Dapr integration models Dapr sidecars and component resources alongside the apps that use them.
Why use Dapr with Aspire
Section titled “Why use Dapr with Aspire”- Sidecars in the application model. Add and configure a Dapr sidecar next to an app resource instead of managing a separate
dapr runcommand. - Reusable component resources. Model state stores, pub/sub brokers, and other Dapr components once, then reference them from sidecars.
- Automatic endpoint injection. Aspire passes the sidecar HTTP and gRPC ports and endpoints to each app resource.
- Dashboard visibility. Sidecars appear as resources with logs, endpoints, and lifecycle status in the Aspire dashboard.
- Dapr SDK support. C#, TypeScript, Python, and Go apps can use the official Dapr SDK for their language.
Prerequisites
Section titled “Prerequisites”Install the Dapr CLI and run:
dapr initThe Community Toolkit package is tested with the most recent stable Dapr release identified in its source. At the audited release, that is Dapr runtime 1.15.3 and Dapr CLI 1.15.0.
How the pieces fit together
Section titled “How the pieces fit together”architecture-beta group apphost(server)[AppHost] group consumer(server)[App resource] service component(database)[Dapr component] in apphost service sidecar(server)[Dapr sidecar] in apphost service app(server)[Application] in consumer component:R --> L:sidecar sidecar:R --> L:app
-
Model Dapr in the AppHost
Section titled “Model Dapr in the AppHost”Install the hosting integration, add component resources, and attach a sidecar to each app that uses Dapr.
Set up Dapr in the AppHost
-
Connect from an app
Section titled “Connect from an app”Use the injected Dapr HTTP or gRPC endpoint with the official SDK for your app’s language.
Connect to Dapr