Skip to content
Docs Try Aspire

RedisResource Properties

Class Properties 7 members
A resource that represents a Redis resource independent of the hosting model.
ConnectionStringExpression Section titled ConnectionStringExpression ReferenceExpression
Gets the connection string expression for the Redis server.
public ReferenceExpression ConnectionStringExpression { get; }
Host Section titled Host EndpointReferenceExpression
Gets the host endpoint reference for this resource.
public EndpointReferenceExpression Host { get; }
PasswordParameter Section titled PasswordParameter nullable ParameterResource?
Gets the parameter that contains the Redis server password.
public ParameterResource? PasswordParameter { get; }
Port Section titled Port EndpointReferenceExpression
Gets the port endpoint reference for this resource.
public EndpointReferenceExpression Port { get; }
PrimaryEndpoint Section titled PrimaryEndpoint EndpointReference
Gets the primary endpoint for the Redis server.
public EndpointReference PrimaryEndpoint { get; }
Indicates whether TLS is enabled for the Redis server.
public bool TlsEnabled { get; }
This property proxies through to EndpointAnnotation.TlsEnabled on the RedisResource.PrimaryEndpoint. When set to true, the connection string expression dynamically includes ,ssl=true and the URI expression uses the rediss:// scheme. This value is resolved lazily at expression evaluation time, avoiding timing issues when TLS is enabled later in the application lifecycle (e.g., during the BeforeStartEvent).
UriExpression Section titled UriExpression ReferenceExpression
Gets the connection URI expression for the Redis server.
public ReferenceExpression UriExpression { get; }
Format: redis://[:{password}@]{host}:{port}. The password segment is omitted when no password is configured.