Skip to content
DocsTry Aspire
DocsTry

RedisResource Properties

ClassProperties7 members
A resource that represents a Redis resource independent of the hosting model.
ConnectionStringExpressionSection titled ConnectionStringExpressionReferenceExpression
Gets the connection string expression for the Redis server.
public ReferenceExpression ConnectionStringExpression { get; }
HostSection titled HostEndpointReferenceExpression
Gets the host endpoint reference for this resource.
public EndpointReferenceExpression Host { get; }
PasswordParameterSection titled PasswordParameternullableParameterResource?
Gets the parameter that contains the Redis server password.
public ParameterResource? PasswordParameter { get; }
PortSection titled PortEndpointReferenceExpression
Gets the port endpoint reference for this resource.
public EndpointReferenceExpression Port { get; }
PrimaryEndpointSection titled PrimaryEndpointEndpointReference
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).
UriExpressionSection titled UriExpressionReferenceExpression
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.