We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.redis.getCache
Start a Neo task
Explain and create an azure.redis.getCache resource
Use this data source to access information about an existing Redis Cache
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.redis.getCache({
name: "myrediscache",
resourceGroupName: "redis-cache",
});
export const primaryAccessKey = example.then(example => example.primaryAccessKey);
export const hostname = example.then(example => example.hostname);
import pulumi
import pulumi_azure as azure
example = azure.redis.get_cache(name="myrediscache",
resource_group_name="redis-cache")
pulumi.export("primaryAccessKey", example.primary_access_key)
pulumi.export("hostname", example.hostname)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/redis"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := redis.LookupCache(ctx, &redis.LookupCacheArgs{
Name: "myrediscache",
ResourceGroupName: "redis-cache",
}, nil)
if err != nil {
return err
}
ctx.Export("primaryAccessKey", example.PrimaryAccessKey)
ctx.Export("hostname", example.Hostname)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Redis.GetCache.Invoke(new()
{
Name = "myrediscache",
ResourceGroupName = "redis-cache",
});
return new Dictionary<string, object?>
{
["primaryAccessKey"] = example.Apply(getCacheResult => getCacheResult.PrimaryAccessKey),
["hostname"] = example.Apply(getCacheResult => getCacheResult.Hostname),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.redis.RedisFunctions;
import com.pulumi.azure.redis.inputs.GetCacheArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = RedisFunctions.getCache(GetCacheArgs.builder()
.name("myrediscache")
.resourceGroupName("redis-cache")
.build());
ctx.export("primaryAccessKey", example.primaryAccessKey());
ctx.export("hostname", example.hostname());
}
}
variables:
example:
fn::invoke:
function: azure:redis:getCache
arguments:
name: myrediscache
resourceGroupName: redis-cache
outputs:
primaryAccessKey: ${example.primaryAccessKey}
hostname: ${example.hostname}
API Providers
This data source uses the following Azure API Providers:
Microsoft.Cache- 2024-11-01
Using getCache
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCache(args: GetCacheArgs, opts?: InvokeOptions): Promise<GetCacheResult>
function getCacheOutput(args: GetCacheOutputArgs, opts?: InvokeOptions): Output<GetCacheResult>def get_cache(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCacheResult
def get_cache_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCacheResult]func LookupCache(ctx *Context, args *LookupCacheArgs, opts ...InvokeOption) (*LookupCacheResult, error)
func LookupCacheOutput(ctx *Context, args *LookupCacheOutputArgs, opts ...InvokeOption) LookupCacheResultOutput> Note: This function is named LookupCache in the Go SDK.
public static class GetCache
{
public static Task<GetCacheResult> InvokeAsync(GetCacheArgs args, InvokeOptions? opts = null)
public static Output<GetCacheResult> Invoke(GetCacheInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCacheResult> getCache(GetCacheArgs args, InvokeOptions options)
public static Output<GetCacheResult> getCache(GetCacheArgs args, InvokeOptions options)
fn::invoke:
function: azure:redis/getCache:getCache
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Redis cache
- Resource
Group stringName - The name of the resource group the Redis cache instance is located in.
- Name string
- The name of the Redis cache
- Resource
Group stringName - The name of the resource group the Redis cache instance is located in.
- name String
- The name of the Redis cache
- resource
Group StringName - The name of the resource group the Redis cache instance is located in.
- name string
- The name of the Redis cache
- resource
Group stringName - The name of the resource group the Redis cache instance is located in.
- name str
- The name of the Redis cache
- resource_
group_ strname - The name of the resource group the Redis cache instance is located in.
- name String
- The name of the Redis cache
- resource
Group StringName - The name of the resource group the Redis cache instance is located in.
getCache Result
The following output properties are available:
- Access
Keys boolAuthentication Enabled - Specifies if access key authentication is enabled.
- Capacity int
- The size of the Redis Cache deployed.
- Family string
- The SKU family/pricing group used. Possible values are
C(for Basic/Standard SKU family) andP(forPremium) - Hostname string
- The Hostname of the Redis Instance
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location of the Redis Cache.
- Minimum
Tls stringVersion - The minimum TLS version.
- Name string
- Non
Ssl boolPort Enabled - Patch
Schedules List<GetCache Patch Schedule> - A list of
patch_scheduleblocks as defined below. - Port int
- The non-SSL Port of the Redis Instance
- Primary
Access stringKey - The Primary Access Key for the Redis Instance
- Primary
Connection stringString - The primary connection string of the Redis Instance.
- Private
Static stringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- Redis
Configurations List<GetCache Redis Configuration> - A
redis_configurationblock as defined below. - Resource
Group stringName - Secondary
Access stringKey - The Secondary Access Key for the Redis Instance
- Secondary
Connection stringString - The secondary connection string of the Redis Instance.
- int
- Sku
Name string - The SKU of Redis used. Possible values are
Basic,StandardandPremium. - Ssl
Port int - The SSL Port of the Redis Instance
- Subnet
Id string - Dictionary<string, string>
- Zones List<string>
- A list of Availability Zones in which this Redis Cache is located.
- Access
Keys boolAuthentication Enabled - Specifies if access key authentication is enabled.
- Capacity int
- The size of the Redis Cache deployed.
- Family string
- The SKU family/pricing group used. Possible values are
C(for Basic/Standard SKU family) andP(forPremium) - Hostname string
- The Hostname of the Redis Instance
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location of the Redis Cache.
- Minimum
Tls stringVersion - The minimum TLS version.
- Name string
- Non
Ssl boolPort Enabled - Patch
Schedules []GetCache Patch Schedule - A list of
patch_scheduleblocks as defined below. - Port int
- The non-SSL Port of the Redis Instance
- Primary
Access stringKey - The Primary Access Key for the Redis Instance
- Primary
Connection stringString - The primary connection string of the Redis Instance.
- Private
Static stringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- Redis
Configurations []GetCache Redis Configuration - A
redis_configurationblock as defined below. - Resource
Group stringName - Secondary
Access stringKey - The Secondary Access Key for the Redis Instance
- Secondary
Connection stringString - The secondary connection string of the Redis Instance.
- int
- Sku
Name string - The SKU of Redis used. Possible values are
Basic,StandardandPremium. - Ssl
Port int - The SSL Port of the Redis Instance
- Subnet
Id string - map[string]string
- Zones []string
- A list of Availability Zones in which this Redis Cache is located.
- access
Keys BooleanAuthentication Enabled - Specifies if access key authentication is enabled.
- capacity Integer
- The size of the Redis Cache deployed.
- family String
- The SKU family/pricing group used. Possible values are
C(for Basic/Standard SKU family) andP(forPremium) - hostname String
- The Hostname of the Redis Instance
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location of the Redis Cache.
- minimum
Tls StringVersion - The minimum TLS version.
- name String
- non
Ssl BooleanPort Enabled - patch
Schedules List<GetCache Patch Schedule> - A list of
patch_scheduleblocks as defined below. - port Integer
- The non-SSL Port of the Redis Instance
- primary
Access StringKey - The Primary Access Key for the Redis Instance
- primary
Connection StringString - The primary connection string of the Redis Instance.
- private
Static StringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis
Configurations List<GetCache Redis Configuration> - A
redis_configurationblock as defined below. - resource
Group StringName - secondary
Access StringKey - The Secondary Access Key for the Redis Instance
- secondary
Connection StringString - The secondary connection string of the Redis Instance.
- Integer
- sku
Name String - The SKU of Redis used. Possible values are
Basic,StandardandPremium. - ssl
Port Integer - The SSL Port of the Redis Instance
- subnet
Id String - Map<String,String>
- zones List<String>
- A list of Availability Zones in which this Redis Cache is located.
- access
Keys booleanAuthentication Enabled - Specifies if access key authentication is enabled.
- capacity number
- The size of the Redis Cache deployed.
- family string
- The SKU family/pricing group used. Possible values are
C(for Basic/Standard SKU family) andP(forPremium) - hostname string
- The Hostname of the Redis Instance
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The location of the Redis Cache.
- minimum
Tls stringVersion - The minimum TLS version.
- name string
- non
Ssl booleanPort Enabled - patch
Schedules GetCache Patch Schedule[] - A list of
patch_scheduleblocks as defined below. - port number
- The non-SSL Port of the Redis Instance
- primary
Access stringKey - The Primary Access Key for the Redis Instance
- primary
Connection stringString - The primary connection string of the Redis Instance.
- private
Static stringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis
Configurations GetCache Redis Configuration[] - A
redis_configurationblock as defined below. - resource
Group stringName - secondary
Access stringKey - The Secondary Access Key for the Redis Instance
- secondary
Connection stringString - The secondary connection string of the Redis Instance.
- number
- sku
Name string - The SKU of Redis used. Possible values are
Basic,StandardandPremium. - ssl
Port number - The SSL Port of the Redis Instance
- subnet
Id string - {[key: string]: string}
- zones string[]
- A list of Availability Zones in which this Redis Cache is located.
- access_
keys_ boolauthentication_ enabled - Specifies if access key authentication is enabled.
- capacity int
- The size of the Redis Cache deployed.
- family str
- The SKU family/pricing group used. Possible values are
C(for Basic/Standard SKU family) andP(forPremium) - hostname str
- The Hostname of the Redis Instance
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The location of the Redis Cache.
- minimum_
tls_ strversion - The minimum TLS version.
- name str
- non_
ssl_ boolport_ enabled - patch_
schedules Sequence[GetCache Patch Schedule] - A list of
patch_scheduleblocks as defined below. - port int
- The non-SSL Port of the Redis Instance
- primary_
access_ strkey - The Primary Access Key for the Redis Instance
- primary_
connection_ strstring - The primary connection string of the Redis Instance.
- private_
static_ strip_ address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis_
configurations Sequence[GetCache Redis Configuration] - A
redis_configurationblock as defined below. - resource_
group_ strname - secondary_
access_ strkey - The Secondary Access Key for the Redis Instance
- secondary_
connection_ strstring - The secondary connection string of the Redis Instance.
- int
- sku_
name str - The SKU of Redis used. Possible values are
Basic,StandardandPremium. - ssl_
port int - The SSL Port of the Redis Instance
- subnet_
id str - Mapping[str, str]
- zones Sequence[str]
- A list of Availability Zones in which this Redis Cache is located.
- access
Keys BooleanAuthentication Enabled - Specifies if access key authentication is enabled.
- capacity Number
- The size of the Redis Cache deployed.
- family String
- The SKU family/pricing group used. Possible values are
C(for Basic/Standard SKU family) andP(forPremium) - hostname String
- The Hostname of the Redis Instance
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location of the Redis Cache.
- minimum
Tls StringVersion - The minimum TLS version.
- name String
- non
Ssl BooleanPort Enabled - patch
Schedules List<Property Map> - A list of
patch_scheduleblocks as defined below. - port Number
- The non-SSL Port of the Redis Instance
- primary
Access StringKey - The Primary Access Key for the Redis Instance
- primary
Connection StringString - The primary connection string of the Redis Instance.
- private
Static StringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis
Configurations List<Property Map> - A
redis_configurationblock as defined below. - resource
Group StringName - secondary
Access StringKey - The Secondary Access Key for the Redis Instance
- secondary
Connection StringString - The secondary connection string of the Redis Instance.
- Number
- sku
Name String - The SKU of Redis used. Possible values are
Basic,StandardandPremium. - ssl
Port Number - The SSL Port of the Redis Instance
- subnet
Id String - Map<String>
- zones List<String>
- A list of Availability Zones in which this Redis Cache is located.
Supporting Types
GetCachePatchSchedule
- Day
Of stringWeek - the Weekday name for the patch item
- Maintenance
Window string - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- Start
Hour intUtc - The Start Hour for maintenance in UTC
- Day
Of stringWeek - the Weekday name for the patch item
- Maintenance
Window string - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- Start
Hour intUtc - The Start Hour for maintenance in UTC
- day
Of StringWeek - the Weekday name for the patch item
- maintenance
Window String - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour IntegerUtc - The Start Hour for maintenance in UTC
- day
Of stringWeek - the Weekday name for the patch item
- maintenance
Window string - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour numberUtc - The Start Hour for maintenance in UTC
- day_
of_ strweek - the Weekday name for the patch item
- maintenance_
window str - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start_
hour_ intutc - The Start Hour for maintenance in UTC
- day
Of StringWeek - the Weekday name for the patch item
- maintenance
Window String - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour NumberUtc - The Start Hour for maintenance in UTC
GetCacheRedisConfiguration
- Active
Directory boolAuthentication Enabled - Specifies if Microsoft Entra (AAD) authentication is enabled.
- Aof
Backup boolEnabled - Aof
Storage stringConnection String0 - Aof
Storage stringConnection String1 - Authentication
Enabled bool - Data
Persistence stringAuthentication Method - Maxclients int
- Maxfragmentationmemory
Reserved int - Value in megabytes reserved to accommodate for memory fragmentation.
- Maxmemory
Delta int - The max-memory delta for this Redis instance.
- Maxmemory
Policy string - How Redis will select what to remove when
maxmemoryis reached. - Maxmemory
Reserved int - The value in megabytes reserved for non-cache usage e.g. failover
- Notify
Keyspace stringEvents - Rdb
Backup boolEnabled - Is Backup Enabled? Only supported on Premium SKUs.
- Rdb
Backup intFrequency - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- Rdb
Backup intMax Snapshot Count - The maximum number of snapshots that can be created as a backup.
- Rdb
Storage stringConnection String - The Connection String to the Storage Account. Only supported for Premium SKUs.
- Storage
Account stringSubscription Id - The ID of the Subscription containing the Storage Account.
- Active
Directory boolAuthentication Enabled - Specifies if Microsoft Entra (AAD) authentication is enabled.
- Aof
Backup boolEnabled - Aof
Storage stringConnection String0 - Aof
Storage stringConnection String1 - Authentication
Enabled bool - Data
Persistence stringAuthentication Method - Maxclients int
- Maxfragmentationmemory
Reserved int - Value in megabytes reserved to accommodate for memory fragmentation.
- Maxmemory
Delta int - The max-memory delta for this Redis instance.
- Maxmemory
Policy string - How Redis will select what to remove when
maxmemoryis reached. - Maxmemory
Reserved int - The value in megabytes reserved for non-cache usage e.g. failover
- Notify
Keyspace stringEvents - Rdb
Backup boolEnabled - Is Backup Enabled? Only supported on Premium SKUs.
- Rdb
Backup intFrequency - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- Rdb
Backup intMax Snapshot Count - The maximum number of snapshots that can be created as a backup.
- Rdb
Storage stringConnection String - The Connection String to the Storage Account. Only supported for Premium SKUs.
- Storage
Account stringSubscription Id - The ID of the Subscription containing the Storage Account.
- active
Directory BooleanAuthentication Enabled - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof
Backup BooleanEnabled - aof
Storage StringConnection String0 - aof
Storage StringConnection String1 - authentication
Enabled Boolean - data
Persistence StringAuthentication Method - maxclients Integer
- maxfragmentationmemory
Reserved Integer - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta Integer - The max-memory delta for this Redis instance.
- maxmemory
Policy String - How Redis will select what to remove when
maxmemoryis reached. - maxmemory
Reserved Integer - The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace StringEvents - rdb
Backup BooleanEnabled - Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup IntegerFrequency - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup IntegerMax Snapshot Count - The maximum number of snapshots that can be created as a backup.
- rdb
Storage StringConnection String - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage
Account StringSubscription Id - The ID of the Subscription containing the Storage Account.
- active
Directory booleanAuthentication Enabled - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof
Backup booleanEnabled - aof
Storage stringConnection String0 - aof
Storage stringConnection String1 - authentication
Enabled boolean - data
Persistence stringAuthentication Method - maxclients number
- maxfragmentationmemory
Reserved number - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta number - The max-memory delta for this Redis instance.
- maxmemory
Policy string - How Redis will select what to remove when
maxmemoryis reached. - maxmemory
Reserved number - The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace stringEvents - rdb
Backup booleanEnabled - Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup numberFrequency - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup numberMax Snapshot Count - The maximum number of snapshots that can be created as a backup.
- rdb
Storage stringConnection String - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage
Account stringSubscription Id - The ID of the Subscription containing the Storage Account.
- active_
directory_ boolauthentication_ enabled - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof_
backup_ boolenabled - aof_
storage_ strconnection_ string0 - aof_
storage_ strconnection_ string1 - authentication_
enabled bool - data_
persistence_ strauthentication_ method - maxclients int
- maxfragmentationmemory_
reserved int - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory_
delta int - The max-memory delta for this Redis instance.
- maxmemory_
policy str - How Redis will select what to remove when
maxmemoryis reached. - maxmemory_
reserved int - The value in megabytes reserved for non-cache usage e.g. failover
- notify_
keyspace_ strevents - rdb_
backup_ boolenabled - Is Backup Enabled? Only supported on Premium SKUs.
- rdb_
backup_ intfrequency - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb_
backup_ intmax_ snapshot_ count - The maximum number of snapshots that can be created as a backup.
- rdb_
storage_ strconnection_ string - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage_
account_ strsubscription_ id - The ID of the Subscription containing the Storage Account.
- active
Directory BooleanAuthentication Enabled - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof
Backup BooleanEnabled - aof
Storage StringConnection String0 - aof
Storage StringConnection String1 - authentication
Enabled Boolean - data
Persistence StringAuthentication Method - maxclients Number
- maxfragmentationmemory
Reserved Number - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta Number - The max-memory delta for this Redis instance.
- maxmemory
Policy String - How Redis will select what to remove when
maxmemoryis reached. - maxmemory
Reserved Number - The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace StringEvents - rdb
Backup BooleanEnabled - Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup NumberFrequency - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup NumberMax Snapshot Count - The maximum number of snapshots that can be created as a backup.
- rdb
Storage StringConnection String - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage
Account StringSubscription Id - The ID of the Subscription containing the Storage Account.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
