Share via


KeycloakResourceBuilderExtensions.WithRealmImport Method

Definition

Adds a realm import to a Keycloak container resource.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.KeycloakResource> WithRealmImport (this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.KeycloakResource> builder, string importDirectory, bool isReadOnly = false);
static member WithRealmImport : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.KeycloakResource> * string * bool -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.KeycloakResource>
<Extension()>
Public Function WithRealmImport (builder As IResourceBuilder(Of KeycloakResource), importDirectory As String, Optional isReadOnly As Boolean = false) As IResourceBuilder(Of KeycloakResource)

Parameters

builder
IResourceBuilder<KeycloakResource>

The resource builder.

importDirectory
String

The directory containing the realm import files.

isReadOnly
Boolean

A flag that indicates if the realm import directory is read-only.

Returns

The IResourceBuilder<T>.

Examples

Import the realms from a directory

var keycloak = builder.AddKeycloak("keycloak")
                      .WithRealmImport("../realms");

Remarks

The realm import files are mounted at /opt/keycloak/data/import in the container.

Applies to