Skip to content
Docs Try Aspire

KeycloakResourceBuilderExtensions

Class static net8.0
📦 Aspire.Hosting.Keycloak v13.2.0-preview.1.26170.3
Provides extension methods for adding Keycloak resources to an Hosting.IDistributedApplicationBuilder.
namespace Aspire.Hosting;
public static class KeycloakResourceBuilderExtensions
{
// ...
}
AddKeycloak(IDistributedApplicationBuilder, string, int?, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<KeycloakResource>
Adds a Keycloak container to the application model.
WithDataBindMount(IResourceBuilder<KeycloakResource>, string)extensionats export
IResourceBuilder<KeycloakResource>
Adds a bind mount for the data folder to a Keycloak container resource.
WithDataVolume(IResourceBuilder<KeycloakResource>, string?)extensionats export
IResourceBuilder<KeycloakResource>
Adds a named volume for the data folder to a Keycloak container resource.
WithDisabledFeatures(IResourceBuilder<KeycloakResource>, string[])extensionats export
IResourceBuilder<KeycloakResource>
Additional feature names to disable for the keycloak resource
WithEnabledFeatures(IResourceBuilder<KeycloakResource>, string[])extensionats export
IResourceBuilder<KeycloakResource>
Additional feature names to enable for the keycloak resource
WithOtlpExporter(IResourceBuilder<KeycloakResource>)extensionats export
IResourceBuilder<KeycloakResource>
Injects the appropriate environment variables to allow the resource to enable sending telemetry to the dashboard.
  1. It ensures the "opentelemetry" Keycloak feature is enabled
  2. It sets the OTLP endpoint to the value of the ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL environment variable.
  3. It sets the service name and instance id to the resource name and UID. Values are injected by the orchestrator.
  4. It sets a small batch schedule delay in development. This reduces the delay that OTLP exporter waits to sends telemetry and makes the dashboard telemetry pages responsive.
WithOtlpExporter(IResourceBuilder<KeycloakResource>, OtlpProtocol)extensionats export
IResourceBuilder<KeycloakResource>
Injects the appropriate environment variables to allow the resource to enable sending telemetry to the dashboard.
  1. It ensures the "opentelemetry" Keycloak feature is enabled
  2. It sets the OTLP endpoint to the value of the ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL environment variable.
  3. It sets the service name and instance id to the resource name and UID. Values are injected by the orchestrator.
  4. It sets a small batch schedule delay in development. This reduces the delay that OTLP exporter waits to sends telemetry and makes the dashboard telemetry pages responsive.
WithRealmImport(IResourceBuilder<KeycloakResource>, string, bool)extensionobsolete
IResourceBuilder<KeycloakResource>
Adds a realm import to a Keycloak container resource.
WithRealmImport(IResourceBuilder<KeycloakResource>, string)extensionats ignored
IResourceBuilder<KeycloakResource>
Adds a realm import to a Keycloak container resource.
View all methods