DockerComposeAspireDashboardResourceBuilderExtensions Methods
Class Methods 2 members
Provides extension methods for creating Aspire Dashboard resources in the application model.
WithForwardedHeaders(IResourceBuilder<DockerComposeAspireDashboardResource>, bool) Section titled WithForwardedHeaders(IResourceBuilder<DockerComposeAspireDashboardResource>, bool) extension IResourceBuilder<DockerComposeAspireDashboardResource> Configures whether forwarded headers processing is enabled for the Aspire dashboard container.
public static class DockerComposeAspireDashboardResourceBuilderExtensions{ public static IResourceBuilder<DockerComposeAspireDashboardResource> WithForwardedHeaders( this IResourceBuilder<DockerComposeAspireDashboardResource> builder, bool enabled = true) { // ... }}Parameters
builder IResourceBuilder<DockerComposeAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance. enabled bool optional True to enable forwarded headers ( ASPIRE_DASHBOARD_FORWARDEDHEADERS_ENABLED=true), false to disable it (sets the value to false). Returns
IResourceBuilder<DockerComposeAspireDashboardResource> The same ApplicationModel.IResourceBuilder`1 to allow chaining. Remarks
This sets the
ASPIRE_DASHBOARD_FORWARDEDHEADERS_ENABLED environment variable inside the dashboard container. When enabled, the dashboard will process X-Forwarded-Host and X-Forwarded-Proto headers which is required when the dashboard is accessed through a reverse proxy or load balancer. WithHostPort(IResourceBuilder<DockerComposeAspireDashboardResource>, int?) Section titled WithHostPort(IResourceBuilder<DockerComposeAspireDashboardResource>, int?) extension IResourceBuilder<DockerComposeAspireDashboardResource> Configures the port used to access the Aspire Dashboard from a browser.
public static class DockerComposeAspireDashboardResourceBuilderExtensions{ public static IResourceBuilder<DockerComposeAspireDashboardResource> WithHostPort( this IResourceBuilder<DockerComposeAspireDashboardResource> builder, int? port = null) { // ... }}Parameters
builder IResourceBuilder<DockerComposeAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance to configure. port int? optional The port to bind on the host. If non-null, the dashboard will be exposed on the host. If null, the dashboard will not be exposed on the host but will only be reachable within the container network. Returns
IResourceBuilder<DockerComposeAspireDashboardResource> The ApplicationModel.IResourceBuilder`1 instance for chaining.