Skip to content

Instantly share code, notes, and snippets.

@JamesNK
Last active October 28, 2024 10:51
Show Gist options
  • Save JamesNK/a22d95de1580f67abf348b1779c7006d to your computer and use it in GitHub Desktop.
Save JamesNK/a22d95de1580f67abf348b1779c7006d to your computer and use it in GitHub Desktop.
.NET Aspire app host configuration

General

ASPIRE_ALLOW_UNSECURED_TRANSPORT

  • Description: Allows communication with the app host without https. ASPNETCORE_URLS (dashboard address) and DOTNET_RESOURCE_SERVICE_ENDPOINT_URL (app host resource service address) must be secured with HTTPS unless true.
  • Default: false

Resource service

DOTNET_RESOURCE_SERVICE_ENDPOINT_URL

  • Description: Configures the address of the resource service hosted by the app host. Automatically generated with launchSettings.json to have a random port on localhost. For example, https://localhost:17037.
  • Default: null

DOTNET_DASHBOARD_RESOURCESERVICE_APIKEY

  • Description: The API key used to authenticate requests made to the app host's resource service. The value is used if needed: the app host is in run mode, the dashboard isn't disabled, and the dashboard isn't configured to allow anonymous access with DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS.
  • Default: Automatically generated 128-bit entropy token.

Dashboard

ASPNETCORE_URLS

  • Description: Dashboard address. Must be https unless ASPIRE_ALLOW_UNSECURED_TRANSPORT or DistributedApplicationOptions.AllowUnsecuredTransport is true.
  • Default: null

ASPNETCORE_ENVIRONMENT

DOTNET_DASHBOARD_OTLP_ENDPOINT_URL

  • Description: Configures the dashboard OTLP gRPC address. Used by the dashboard to receive telemetry over OTLP. Set on resources as the OTEL_EXPORTER_OTLP_ENDPOINT env var and OTEL_EXPORTER_OTLP_PROTOCOL env var is grpc.
  • Default: Automatically added to launchConfig.json. Defaults to http://localhost:18889 if no gRPC endpoint is configured.

DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL

  • Description: Configures the dashboard OTLP HTTP address. Used by the dashboard to receive telemetry over OTLP. If only DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL is configured then it is set on resources as the OTEL_EXPORTER_OTLP_ENDPOINT env var and OTEL_EXPORTER_OTLP_PROTOCOL env var is http/protobuf.
  • Default: null

DOTNET_DASHBOARD_FRONTEND_BROWSERTOKEN

  • Description: Configures the frontend browser token. This is the value that must be entered to access the dashboard when the auth mode is BrowserToken. If no browser token is specified then a new token is generated each time the app host is launched.
  • Default: Automatically generated 128-bit entropy token.

Internal

Internal settings are used by the app host and integrations. Internal settings aren't designed to be configured directly.

AppHost:Directory

  • Description: Directory of the project where the app host is located.
  • Default: The content root if there's no project.

AppHost:Path

  • Description: The path to the app host. It combines the directory with the application name.
  • Default: The directory combined with the application name.

AppHost:Sha256

  • Description: Hex encoded hash for the current application. The hash is based on the location of the app on the current machine so it is stable between launches of the app host.
  • Default: It is created from the app host name when the app host is in publish mode. Otherwise it is created from the app host path.

AppHost:OtlpApiKey

  • Description: The API key used to authenticate requests sent to the dashboard OTLP service. The value is present if needed: the app host is in run mode, the dashboard isn't disabled, and the dashboard isn't configured to allow anonymous access with DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS.
  • Default: Automatically generated 128-bit entropy token.

AppHost:BrowserToken

  • Description: The browser token used to authenticate browsing to the dashboard when it is launched by the app host. The browser token can be set by DOTNET_DASHBOARD_FRONTEND_BROWSERTOKEN. The value is present if needed: the app host is in run mode, the dashboard isn't disabled, and the dashboard isn't configured to allow anonymous access with DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS.
  • Default: Automatically generated 128-bit entropy token.

AppHost:ResourceService:AuthMode

  • Description: The authentication mode used to access the resource service. The value is present if needed: the app host is in run mode and the dashboard isn't disabled.
  • Default: ApiKey. If DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS is true then the value is Unsecured.

AppHost:ResourceService:ApiKey

  • Description: The API key used to authenticate requests made to the app host's resource service. The API key can be set by DOTNET_DASHBOARD_RESOURCESERVICE_APIKEY. The value is present if needed: the app host is in run mode, the dashboard isn't disabled, and the dashboard isn't configured to allow anonymous access with DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS.
  • Default: Automatically generated 128-bit entropy token.

AppHost:ContainerHostname

AppHost:DefaultLaunchProfileName

  • ???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment