# AzureRedisCacheResource Properties

- Package: [Aspire.Hosting.Azure.Redis](/reference/api/csharp/aspire.hosting.azure.redis.md)
- Type: [AzureRedisCacheResource](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource.md)
- Kind: `Properties`
- Members: `6`

Represents an Azure Cache for Redis resource.

## Annotations

- Name: `Annotations`
- Modifiers: `override` `get`
- Returns: `ResourceAnnotationCollection`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureRedisCacheResource.cs#L59)

```csharp
public override ResourceAnnotationCollection Annotations { get; }
```

## ConnectionStringExpression

- Name: `ConnectionStringExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureRedisCacheResource.cs#L65-L68)

Gets the connection string template for the manifest for the Azure Cache for Redis resource.

```csharp
public ReferenceExpression ConnectionStringExpression { get; }
```

## HostName

- Name: `HostName`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureRedisCacheResource.cs#L78-L80)

Gets the host name for the Redis server.

```csharp
public ReferenceExpression HostName { get; }
```

## Remarks

In container mode, resolves to the container's primary endpoint host and port. In Azure mode, resolves to the Azure Redis server's hostname.

## NameOutputReference

- Name: `NameOutputReference`
- Modifiers: `get`
- Returns: `BicepOutputReference`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureRedisCacheResource.cs#L38)

Gets the "name" output reference for the resource.

```csharp
public BicepOutputReference NameOutputReference { get; }
```

## Password

- Name: `Password`
- Modifiers: `nullable` `get`
- Returns: `ReferenceExpression?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureRedisCacheResource.cs#L90-L92)

Gets the password for the Redis server when running as a container.

```csharp
public ReferenceExpression? Password { get; }
```

## Remarks

This property returns null when running in Azure mode, as Redis access is handled via connection strings. When running as a container, it resolves to the password parameter value if one exists.

## UseAccessKeyAuthentication

- Name: `UseAccessKeyAuthentication`
- Modifiers: `get`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureRedisCacheResource.cs#L49)

Gets a value indicating whether the resource uses access key authentication.

```csharp
public bool UseAccessKeyAuthentication { get; }
```
