# AzureRedisCacheResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.Redis](/reference/api/csharp/aspire.hosting.azure.redis.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Redis/AzureRedisCacheResource.cs)
- Inherits: `AzureProvisioningResource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithEndpoints`, `IValueProvider`, `IValueWithReferences`

Represents an Azure Cache for Redis resource.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureRedisCacheResource
    : Aspire.Hosting.Azure.AzureProvisioningResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IResourceWithEndpoints,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences
{
    // ...
}
```

## Constructors

- [AzureRedisCacheResource(string, Action<AzureResourceInfrastructure>)](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/constructors.md#constructor-string-action-azureresourceinfrastructure) -- Represents an Azure Cache for Redis resource.

## Properties

- [Annotations](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/properties.md#annotations) : `ResourceAnnotationCollection` `get`
- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string template for the manifest for the Azure Cache for Redis resource.
- [HostName](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/properties.md#hostname) : `ReferenceExpression` `get` -- Gets the host name for the Redis server.
- [NameOutputReference](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/properties.md#nameoutputreference) : `BicepOutputReference` `get` -- Gets the "name" output reference for the resource.
- [Password](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/properties.md#password) : `ReferenceExpression?` `get` -- Gets the password for the Redis server when running as a container.
- [UseAccessKeyAuthentication](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/properties.md#useaccesskeyauthentication) : `bool` `get` -- Gets a value indicating whether the resource uses access key authentication.

## Methods

- [AddAsExistingResource(AzureResourceInfrastructure)](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/methods.md#addasexistingresource-azureresourceinfrastructure) : `ProvisionableResource`
- [AddRoleAssignments(IAddRoleAssignmentsContext)](/reference/api/csharp/aspire.hosting.azure.redis/azurerediscacheresource/methods.md#addroleassignments-iaddroleassignmentscontext)
