# AzureManagedRedisResource Properties

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

Represents an Azure Managed Redis resource.

## Annotations

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

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

## Remarks

This property is not available in polyglot app hosts.

## ATS metadata

### Ignored by ATS

- Excluded from automatic Polyglot export.

## ConnectionStringExpression

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

Gets the connection string template for the manifest for the Azure Managed 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/AzureManagedRedisResource.cs#L97-L99)

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.

## Id

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

Gets the "id" output reference for the resource.

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

## NameOutputReference

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

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/AzureManagedRedisResource.cs#L124-L130)

Gets the password/access key for the Redis server.

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

## Remarks

- When running as a container, returns the password parameter value if one exists.
- When using access key authentication in Azure mode, returns the primary access key from KeyVault.
- When using Entra ID authentication in Azure mode, returns an empty expression.

## Port

- Name: `Port`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureManagedRedisResource.cs#L109-L111)

Gets the port for the Redis server.

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

## Remarks

In container mode, resolves to the container's primary endpoint port. In Azure mode, resolves to 10000.

## UriExpression

- Name: `UriExpression`
- Modifiers: `get`
- Returns: `ReferenceExpression`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureManagedRedisResource.cs#L142-L152)

Gets the connection URI expression for the Redis server.

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

## Remarks

Format: `redis://[:{password}@]{host}:{port}`. The password segment is omitted when using Entra ID authentication in Azure mode.

## UseAccessKeyAuthentication

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

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

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