DockerComposeAspireDashboardResourceBuilderExtensions Methods
ClassMethods2 members
Provides extension methods for creating Aspire Dashboard resources in the application model.
WithForwardedHeaders(IResourceBuilder<DockerComposeAspireDashboardResource>, bool)Section titled WithForwardedHeaders(IResourceBuilder<DockerComposeAspireDashboardResource>, bool)extensionIResourceBuilder<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
builderIResourceBuilder<DockerComposeAspireDashboardResource>The ApplicationModel.IResourceBuilder`1 instance.enabledbooloptionalTrue 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?)extensionIResourceBuilder<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
builderIResourceBuilder<DockerComposeAspireDashboardResource>The ApplicationModel.IResourceBuilder`1 instance to configure.portint?optionalThe 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.