Skip to content
DocsTry Aspire
DocsTry

BitwardenSecretManagerExtensions

Classstaticnet10.0
📦 CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager v13.4.1-beta.706
Extension methods for adding Bitwarden Secrets Manager resources.
namespace Aspire.Hosting;
public static class BitwardenSecretManagerExtensions
{
// ...
}
AddBitwardenSecretManager(IDistributedApplicationBuilder, string, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Adds a Bitwarden Secrets Manager resource. The projectNameOrId parameter resolves to either a project name (creates or finds by name) or a project identifier GUID (adopts the existing project by ID).
AddSecret(IResourceBuilder<BitwardenSecretManagerResource>, string)extensionats export
IResourceBuilder<BitwardenSecretResource>
Adds a managed Bitwarden secret whose local and remote names are the same. The secret value is resolved from configuration key Parameters:{parentName}-{name}.
AddSecret(IResourceBuilder<BitwardenSecretManagerResource>, string, string)extensionats export
IResourceBuilder<BitwardenSecretResource>
Adds a managed Bitwarden secret with distinct Aspire and remote names. The secret value is resolved from configuration key Parameters:{parentName}-{name}.
AsSecretId(IResourceBuilder<BitwardenSecretResource>)extensionats export
IExpressionValue
Returns an ApplicationModel.IExpressionValue that resolves to the Bitwarden secret identifier. Pass it to WithEnvironment to inject the secret ID as an environment variable. The app then uses the Bitwarden SDK to fetch the secret value at runtime.
GetSecret(IResourceBuilder<BitwardenSecretManagerResource>, string)extensionats export
IResourceBuilder<BitwardenSecretResource>
GetSecret(IResourceBuilder<BitwardenSecretManagerResource>, string, string)extensionats export
IResourceBuilder<BitwardenSecretResource>
GetSecret(IResourceBuilder<BitwardenSecretManagerResource>, string, Guid)extensionats export
IResourceBuilder<BitwardenSecretResource>
WithApiUrl(IResourceBuilder<BitwardenSecretManagerResource>, string)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden API URL.
WithApiUrl(IResourceBuilder<BitwardenSecretManagerResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden API URL using a parameter.
WithApiUrl(IResourceBuilder<BitwardenSecretManagerResource>, IResourceBuilder<ExternalServiceResource>)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden API URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
WithApiUrl(IResourceBuilder<BitwardenSecretManagerResource>, EndpointReference)extensionats ignored
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden API URL using an endpoint from another resource in the Aspire model.
WithAuthCacheDirectory(IResourceBuilder<BitwardenSecretManagerResource>, string)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
WithBitwardenAccessToken(IResourceBuilder<TDestination>, IResourceBuilder<BitwardenSecretManagerResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<TDestination>
Overrides the Bitwarden access token injected into the connection for source. By default the management token is used. Supply a least-privilege read-only token here.
WithBitwardenAccessToken(IResourceBuilder<TDestination>, string, IResourceBuilder<ParameterResource>)extensionats ignored
IResourceBuilder<TDestination>
Overrides the Bitwarden access token injected into the specified connection. By default the management token is used. Supply a least-privilege read-only token here. Use the source-based overload when the connection name equals the Bitwarden resource name.
WithBitwardenAuthCacheDirectory(IResourceBuilder<TDestination>, IResourceBuilder<BitwardenSecretManagerResource>, string)extensionats export
IResourceBuilder<TDestination>
Configures the directory where the Bitwarden SDK stores its auth cache inside the resource, for the connection associated with source.
WithBitwardenAuthCacheDirectory(IResourceBuilder<TDestination>, string, string)extensionats ignored
IResourceBuilder<TDestination>
Configures the directory where the Bitwarden SDK stores its auth cache inside the resource, for the specified connection. Use the source-based overload when the connection name equals the Bitwarden resource name.
WithBitwardenAuthCacheDirectory(IResourceBuilder<TDestination>, IResourceBuilder<BitwardenSecretManagerResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<TDestination>
Configures the directory where the Bitwarden SDK stores its auth cache inside the resource, using a parameter, for the connection associated with source.
WithBitwardenAuthCacheDirectory(IResourceBuilder<TDestination>, string, IResourceBuilder<ParameterResource>)extensionats ignored
IResourceBuilder<TDestination>
Configures the directory where the Bitwarden SDK stores its auth cache inside the resource, using a parameter, for the specified connection. Use the source-based overload when the connection name equals the Bitwarden resource name.
WithBitwardenAuthCacheVolume(IResourceBuilder<TDestination>, IResourceBuilder<BitwardenSecretManagerResource>, string?, string)extensionats export
IResourceBuilder<TDestination>
WithBitwardenAuthCacheVolume(IResourceBuilder<TDestination>, string, string?, string)extensionats ignored
IResourceBuilder<TDestination>
Mounts a named volume and configures the Bitwarden SDK to store its auth cache there, for the specified connection. Use this for container resources. Use the source-based overload when the connection name equals the Bitwarden resource name.
WithCacheFile(IResourceBuilder<BitwardenSecretManagerResource>, string)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the AppHost cache file path (integration bookkeeping: Bitwarden project ID, secret ID mappings). Defaults to .bitwarden/{resourceName}.{environment}.json relative to the AppHost directory. Override to share the cache across multiple AppHost projects, or to store it in a CI cache directory.
WithIdentityUrl(IResourceBuilder<BitwardenSecretManagerResource>, string)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden identity URL.
WithIdentityUrl(IResourceBuilder<BitwardenSecretManagerResource>, IResourceBuilder<ParameterResource>)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden identity URL using a parameter.
WithIdentityUrl(IResourceBuilder<BitwardenSecretManagerResource>, IResourceBuilder<ExternalServiceResource>)extensionats export
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden identity URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
WithIdentityUrl(IResourceBuilder<BitwardenSecretManagerResource>, EndpointReference)extensionats ignored
IResourceBuilder<BitwardenSecretManagerResource>
Overrides the Bitwarden identity URL using an endpoint from another resource in the Aspire model.
WithReference(IResourceBuilder<TDestination>, IResourceBuilder<BitwardenSecretManagerResource>, string?)extensionats export
IResourceBuilder<TDestination>
Injects structured Bitwarden client configuration into the destination resource.
View all methods