Aspire

Bending Aspire to your will: custom icons, URLs and OpenAPI export command

Bart Wullems (The Art of Simplicity) Bart Wullems
Aspire

Bart Wullems shows how a few annotations in the AppHost reshape the Aspire dashboard: named URLs and icons for each resource, plus a clickable curl command that pulls the catalog service's OpenAPI document into a timestamped file. It trims the daily API-testing loop to one screen.

Key points

  • WithIconName() sets any Fluent UI system icon on a resource so dashboard entries are recognizable at a glance.
  • .WithUrls() overrides dashboard links, but Urls.Clear() also drops Aspire's defaults, so keep what you need.
  • WithProcessCommand() turns a local executable such as curl into a clickable dashboard button for a resource.
  • The process spec is a factory: the endpoint URL resolves on click, because ports are unknown at build time.
  • UpdateState keeps the command disabled until the resource health status is Healthy, preventing exports from stopped services.
  • The API is experimental (ASPIREPROCESSCOMMAND001) and was tested with Aspire 13.6.5 on .NET 10.

Real-world use

  • An API-testing loop where a developer, or an AI agent, needs the OpenAPI spec without hunting for the service port.
  • A local sample app with frontend, catalog, basket services, PostgreSQL and Redis that must be reset for repeatable runs.
  • Running the same export command from the dashboard only after the catalog service reports a healthy state.

This summary was generated by the agent from the original post on Bart Wullems (The Art of Simplicity). The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message