# KeycloakResource

- Module: [Aspire.Hosting.Keycloak](/reference/api/typescript/aspire.hosting.keycloak.md)
- Version: `13.4.0-preview.1.26281.18`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

A resource that represents a Keycloak resource.

## Definition

```typescript
interface KeycloakResource
  extends IComputeResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IResourceWithServiceDiscovery {
  readonly adminPasswordParameter: ParameterResource;
  readonly adminUserNameParameter: ParameterResource;
  withDataBindMount(source: string): KeycloakResource;
  withDataVolume(name?: string): KeycloakResource;
  withDisabledFeatures(features: string[]): KeycloakResource;
  withEnabledFeatures(features: string[]): KeycloakResource;
  withOtlpExporter(protocol?: OtlpProtocol): KeycloakResource;
  withRealmImport(importPath: string): KeycloakResource;
}
```

## Properties

- `adminPasswordParameter`: `ParameterResource` `get` -- Gets the parameter that contains the Keycloak admin password.
- `adminUserNameParameter`: `ParameterResource` `get` -- Gets the parameter that contains the Keycloak admin.

## Methods

- [withDataBindMount](/reference/api/typescript/aspire.hosting.keycloak/keycloakresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a Keycloak container resource.
    ```typescript
  withDataBindMount(source: string): KeycloakResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.keycloak/keycloakresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a Keycloak container resource.
    ```typescript
  withDataVolume(name?: string): KeycloakResource
  ```
- [withDisabledFeatures](/reference/api/typescript/aspire.hosting.keycloak/keycloakresource/withdisabledfeatures.md) -- `method` -- Additional feature names to disable for the keycloak resource
    ```typescript
  withDisabledFeatures(features: string[]): KeycloakResource
  ```
- [withEnabledFeatures](/reference/api/typescript/aspire.hosting.keycloak/keycloakresource/withenabledfeatures.md) -- `method` -- Additional feature names to enable for the keycloak resource
    ```typescript
  withEnabledFeatures(features: string[]): KeycloakResource
  ```
- [withOtlpExporter](/reference/api/typescript/aspire.hosting.keycloak/keycloakresource/withotlpexporter.md) -- `method` -- Configures the OTLP exporter for Keycloak
    ```typescript
  withOtlpExporter(protocol?: OtlpProtocol): KeycloakResource
  ```
- [withRealmImport](/reference/api/typescript/aspire.hosting.keycloak/keycloakresource/withrealmimport.md) -- `method` -- Adds a realm import to a Keycloak container resource.
    ```typescript
  withRealmImport(importPath: string): KeycloakResource
  ```
