azure-resource-manager-redis-dotnet
microsoft/skills
Azure Resource Manager .NET SDK를 통해 Azure Cache for Redis 인스턴스를 관리할 수 있습니다. 여기에는 인스턴스 생성, 방화벽 규칙, 액세스 키, 패치 일정, 지리적 복제 및 비공개 엔드포인트 등이 포함됩니다.
...모든 것을 확장하십시오Azure.ResourceManager.Redis (.NET)
Azure Resource Manager를 통해 Azure Cache for Redis 리소스를 프로비저닝하고 관리하기 위한 관리 플레인 SDK입니다.
⚠️ 관리 플레인 대 데이터 플레인
- 이 SDK(Azure.ResourceManager.Redis): 캐시 생성, 방화벽 규칙 구성, 액세스 키 관리, 지리적 복제 설정
- 데이터 플레인 SDK(StackExchange.Redis): 키 가져오기/설정, pub/sub, 스트림, Lua 스크립트
설치
dotnet add package Azure.ResourceManager.Redis
dotnet add package Azure.Identity
현재 버전: 1.5.1 (안정 버전)
API 버전: 2024-11-01
대상 프레임워크: .NET 8.0, .NET Standard 2.0
환경 변수
AZURE_SUBSCRIPTION_ID= # 필수: Azure 구독 ID
AZURE_TOKEN_CREDENTIALS=prod # 프로덕션 환경에서 DefaultAzureCredential을 사용하는 경우에만 필수
AZURE_TENANT_ID= # 서비스 주체 인증용 (선택 사항)
AZURE_CLIENT_ID= # 서비스 주체 인증용 (선택 사항)
AZURE_CLIENT_SECRET= # 서비스 주체 인증용 (선택 사항)
인증
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Redis;
// 로컬 개발 환경: DefaultAzureCredential. 프로덕션 환경: AZURE_TOKEN_CREDENTIALS=prod 또는 AZURE_TOKEN_CREDENTIALS=로 설정
var credential = new DefaultAzureCredential(
DefaultAzureCredential.DefaultEnvironmentVariableName
);
// 또는 프로덕션 환경에서 특정 자격 증명을 직접 사용:
// https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes 참조
// var credential = new ManagedIdentityCredential();
var armClient = new ArmClient(credential);
// 구독 가져오기
var subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID");
var subscription = armClient.GetSubscriptionResource(
new ResourceIdentifier($"/subscriptions/{subscriptionId}"));
리소스 계층 구조
ArmClient
└── SubscriptionResource
└── ResourceGroupResource
└── RedisResource
├── RedisFirewallRuleResource
├── RedisPatchScheduleResource
├── RedisLinkedServerWithPropertyResource
├── RedisPrivateEndpointConnectionResource
└── RedisCacheAccessPolicyResource
핵심 워크플로
1. Redis 캐시 생성
using Azure.ResourceManager.Redis;
using Azure.ResourceManager.Redis.Models;
// 리소스 그룹 가져오기
var resourceGroup = await subscription
.GetResourceGroupAsync("my-resource-group");
// 캐시 구성 정의
var cacheData = new RedisCreateOrUpdateContent(
location: AzureLocation.EastUS,
sku: new RedisSku(RedisSkuName.Standard, RedisSkuFamily.BasicOrStandard, 1))
{
EnableNonSslPort = false,
MinimumTlsVersion = RedisTlsVersion.Tls1_2,
RedisConfiguration = new RedisCommonConfiguration
{
MaxMemoryPolicy = "volatile-lru"
},
Tags =
{
["environment"] = "production"
}
};
// 캐시 생성 (장시간 실행 작업)
var cacheCollection = resourceGroup.Value.GetAllRedis();
var operation = await cacheCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"my-redis-cache",
cacheData);
RedisResource cache = operation.Value;
Console.WriteLine($"캐시 생성됨: {cache.Data.HostName}");
2. Redis 캐시 가져오기
// 기존 캐시 가져오기
var cache = await resourceGroup.Value
.GetRedisAsync("my-redis-cache");
Console.WriteLine($"호스트: {cache.Value.Data.HostName}");
Console.WriteLine($"포트: {cache.Value.Data.Port}");
Console.WriteLine($"SSL 포트: {cache.Value.Data.SslPort}");
Console.WriteLine($"프로비저닝 상태: {cache.Value.Data.ProvisioningState}");
3. Redis 캐시 업데이트
var patchData = new RedisPatch
{
Sku = new RedisSku(RedisSkuName.Standard, RedisSkuFamily.BasicOrStandard, 2),
RedisConfiguration = new RedisCommonConfiguration
{
MaxMemoryPolicy = "allkeys-lru"
}
};
var updateOperation = await cache.Value.UpdateAsync(
WaitUntil.Completed,
patchData);
4. Redis 캐시 삭제
await cache.Value.DeleteAsync(WaitUntil.Completed);
5. 액세스 키 가져오기
var keys = await cache.Value.GetKeysAsync();
Console.WriteLine($"주 키: {keys.Value.PrimaryKey}");
Console.WriteLine($"보조 키: {keys.Value.SecondaryKey}");
6. 액세스 키 재생성
var regenerateContent = new RedisRegenerateKeyContent(RedisRegenerateKeyType.Primary);
var newKeys = await cache.Value.RegenerateKeyAsync(regenerateContent);
Console.WriteLine($"새로운 기본 키: {newKeys.Value.PrimaryKey}");
7. 방화벽 규칙 관리
// 방화벽 규칙 생성
var firewallData = new RedisFirewallRuleData(
startIP: System.Net.IPAddress.Parse("10.0.0.1"),
endIP: System.Net.IPAddress.Parse("10.0.0.255"));
var firewallCollection = cache.Value.GetRedisFirewallRules();
var firewallOperation = await firewallCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"allow-internal-network",
firewallData);
// 모든 방화벽 규칙 나열
await foreach (var rule in firewallCollection.GetAllAsync())
{
Console.WriteLine($"규칙: {rule.Data.Name} ({rule.Data.StartIP} - {rule.Data.EndIP})");
}
// 방화벽 규칙 삭제
var ruleToDelete = await firewallCollection.GetAsync("allow-internal-network");
await ruleToDelete.Value.DeleteAsync(WaitUntil.Completed);
8. 패치 일정 구성 (프리미엄 SKU)
// 패치 일정을 설정하려면 프리미엄 SKU가 필요합니다
var scheduleData = new RedisPatchScheduleData(
new[]
{
new RedisPatchScheduleSetting(RedisDayOfWeek.Saturday, 2) // 토요일 오전 2시
{
MaintenanceWindow = TimeSpan.FromHours(5)
},
new RedisPatchScheduleSetting(RedisDayOfWeek.Saturday, 2) // 토요일 오전 2시
{
MaintenanceWindow = TimeSpan.FromHours(5)
}
});
var scheduleCollection = cache.Value.GetRedisPatchSchedules();
await scheduleCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
RedisPatchScheduleDefaultName.Default,
scheduleData);
9. 데이터 가져오기/내보내기 (프리미엄 SKU)
// BLOB 스토리지에서 데이터 가져오기
var importContent = new ImportRdbContent(
files: new[] { "https://mystorageaccount.blob.core.windows.net/container/dump.rdb" },
format: "RDB");
await cache.Value.ImportDataAsync(WaitUntil.Completed, importContent);
// 데이터를 Blob 스토리지로 내보내기
var exportContent = new ExportRdbContent(
prefix: "backup",
container: "https://mystorageaccount.blob.core.windows.net/container?sastoken",
format: "RDB");
await cache.Value.ExportDataAsync(WaitUntil.Completed, exportContent);
10. 강제 재시작
var rebootContent = new RedisRebootContent
{
RebootType = RedisRebootType.AllNodes,
ShardId = 0 // 클러스터형 캐시의 경우
};
await cache.Value.ForceRebootAsync(rebootContent);
SKU 참조
| SKU | 제품군 | 용량 | 기능 |
|---|---|---|---|
| 기본 | C | 0-6 | 단일 노드, SLA 없음, 개발/테스트 전용 |
| 표준 | C | 0-6 | 노드 2개(주/복제), SLA |
| 프리미엄 | P | 1~5 | 클러스터링, 지리적 복제, VNet, 지속성 |
용량 크기(C 계열 - 기본/표준):
- C0: 250 MB
- C1: 1 GB
- C2: 2.5 GB
- C3: 6 GB
- C4: 13 GB
- C5: 26 GB
- C6: 53 GB
용량 크기 (Family P - Premium):
- P1: 샤드당 6 GB
- P2: 샤드당 13 GB
- P3: 샤드당 26 GB
- P4: 샤드당 53 GB
- P5: 샤드당 120 GB
키 유형 참조
| 유형 | 용도 |
|---|---|
ArmClient |
모든 ARM 작업의 진입점 |
RedisResource |
Redis 캐시 인스턴스를 나타냅니다 |
RedisCollection |
캐시 CRUD 작업을 위한 컬렉션 |
RedisFirewallRuleResource |
IP 필터링을 위한 방화벽 규칙 |
RedisPatchScheduleResource |
유지보수 시간대 구성 |
속성이 있는 Redis 연결 서버 리소스 |
지리적 복제를 지원하는 연결된 서버 |
RedisPrivateEndpointConnectionResource |
비공개 엔드포인트 연결 |
RedisCacheAccessPolicyResource |
RBAC 액세스 정책 |
RedisCreateOrUpdateContent |
캐시 생성 페이로드 |
RedisPatch |
캐시 업데이트 페이로드 |
RedisSku |
SKU 구성(이름, 제품군, 용량) |
RedisAccessKeys |
주 및 보조 액세스 키 |
RedisRegenerateKeyContent |
키 재생성 요청 |
모범 사례
- 진행하기 전에 완료되어야 하는 작업에는
WaitUntil.Completed를사용하십시오 - 수동으로 폴링하거나 작업을 병렬로 실행하려면
WaitUntil.Started를사용하세요 - 항상
DefaultAzureCredential을사용하십시오. 키를 절대 하드코딩하지 마십시오 - ARM API 오류 발생 시
RequestFailedException을처리하십시오 - 이멱포텐트 작업에는
CreateOrUpdateAsync를사용하십시오 Get*메서드(예:cache.GetRedisFirewallRules())를 통해계층 구조를 탐색하십시오- 지리적 복제, 클러스터링 또는 지속성이 필요한 프로덕션 워크로드에는Premium SKU를 사용하십시오
- 최소 TLS 1.2를 활성화하십시오 —
MinimumTlsVersion = RedisTlsVersion.Tls1_2로설정하십시오 - 보안상의 이유로비 SSL 포트를 비활성화하십시오 —
EnableNonSslPort = false로설정 - 키를 정기적으로 교체하십시오 —
RegenerateKeyAsync를사용하고 연결 문자열을 업데이트하십시오
오류 처리
using Azure;
try
{
var operation = await cacheCollection.CreateOrUpdateAsync(
WaitUntil.Completed, cacheName, cacheData);
}
catch (RequestFailedException ex) when (ex.Status == 409)
{
Console.WriteLine("캐시가 이미 존재합니다");
}
catch (RequestFailedException ex) when (ex.Status == 400)
{
Console.WriteLine($"잘못된 구성: {ex.Message}");
}
catch (RequestFailedException ex)
{
Console.WriteLine($"ARM 오류: {ex.Status} - {ex.ErrorCode}: {ex.Message}");
}
흔히 발생하는 문제점
- SKU 다운그레이드 불가 — 프리미엄(Premium)에서 스탠다드(Standard)/베이직(Basic)으로 다운그레이드할 수 없습니다
- 클러스터링에는 Premium이 필요합니다 — 샤드 구성은 Premium SKU에서만 사용할 수 있습니다
- 지리적 복제에는 Premium이 필요합니다 — 연결된 서버는 Premium 캐시에서만 작동합니다
- VNet 주입에는 프리미엄이 필요합니다 — 가상 네트워크 지원은 프리미엄에서만 제공됩니다
- 패치 일정을 설정하려면 프리미엄이 필요합니다 — 유지 관리 기간은 프리미엄에서만 구성할 수 있습니다
- 캐시 이름은 전역적으로 고유해야 함 — Redis 캐시 이름은 모든 Azure 구독에서 고유해야 함
- 프로비저닝 시간이 길음 — 캐시 생성에는 15~20분이 소요될 수 있습니다. 비동기 패턴의 경우
WaitUntil.Started를사용하십시오
StackExchange.Redis(데이터 플레인) 연결
이 관리 SDK를 사용하여 캐시를 생성한 후, 데이터 작업을 위해 StackExchange.Redis를 사용하십시오:
using StackExchange.Redis;
// 관리 SDK에서 연결 정보 가져오기
var cache = await resourceGroup.Value.GetRedisAsync("my-redis-cache");
var keys = await cache.Value.GetKeysAsync();
// StackExchange.Redis에 연결
var connectionString = $"{cache.Value.Data.HostName}:{cache.Value.Data.SslPort},password={keys.Value.PrimaryKey},ssl=True,abortConnect=False";
var connection = ConnectionMultiplexer.Connect(connectionString);
var db = connection.GetDatabase();
// 데이터 작업
await db.StringSetAsync("key", "value");
var value = await db.StringGetAsync("key");
관련 SDK
| SDK | 용도 | 설치 |
|---|---|---|
StackExchange.Redis |
데이터 플레인(get/set, pub/sub, 스트림) | dotnet add package StackExchange.Redis |
Azure.ResourceManager.Redis |
관리 계층 (이 SDK) | dotnet add package Azure.ResourceManager.Redis |
Microsoft.Azure.StackExchangeRedis |
Azure 전용 Redis 확장 기능 | dotnet add package Microsoft.Azure.StackExchangeRedis |
---
name: azure-resource-manager-redis-dotnet
description: Manage Azure Cache for Redis instances via the Azure Resource Manager .NET SDK, including creation, firewall rules, access keys, patch schedules, geo-replication, and private endpoints.
license: MIT
---
# Azure.ResourceManager.Redis (.NET)
Management plane SDK for provisioning and managing Azure Cache for Redis resources via Azure Resource Manager.
> **⚠️ Management vs Data Plane**
> - **This SDK (Azure.ResourceManager.Redis)**: Create caches, configure firewall rules, manage access keys, set up geo-replication
> - **Data Plane SDK (StackExchange.Redis)**: Get/set keys, pub/sub, streams, Lua scripts
## Installation
```bash
dotnet add package Azure.ResourceManager.Redis
dotnet add package Azure.Identity
```
**Current Version**: 1.5.1 (Stable)
**API Version**: 2024-11-01
**Target Frameworks**: .NET 8.0, .NET Standard 2.0
## Environment Variables
```bash
AZURE_SUBSCRIPTION_ID=<your-subscription-id> # Required: Azure subscription ID
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
AZURE_TENANT_ID=<tenant-id> # For service principal auth (optional)
AZURE_CLIENT_ID=<client-id> # For service principal auth (optional)
AZURE_CLIENT_SECRET=<client-secret> # For service principal auth (optional)
```
## Authentication
```csharp
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Redis;
// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
var credential = new DefaultAzureCredential(
DefaultAzureCredential.DefaultEnvironmentVariableName
);
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes
// var credential = new ManagedIdentityCredential();
var armClient = new ArmClient(credential);
// Get subscription
var subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID");
var subscription = armClient.GetSubscriptionResource(
new ResourceIdentifier($"/subscriptions/{subscriptionId}"));
```
## Resource Hierarchy
```
ArmClient
└── SubscriptionResource
└── ResourceGroupResource
└── RedisResource
├── RedisFirewallRuleResource
├── RedisPatchScheduleResource
├── RedisLinkedServerWithPropertyResource
├── RedisPrivateEndpointConnectionResource
└── RedisCacheAccessPolicyResource
```
## Core Workflows
### 1. Create Redis Cache
```csharp
using Azure.ResourceManager.Redis;
using Azure.ResourceManager.Redis.Models;
// Get resource group
var resourceGroup = await subscription
.GetResourceGroupAsync("my-resource-group");
// Define cache configuration
var cacheData = new RedisCreateOrUpdateContent(
location: AzureLocation.EastUS,
sku: new RedisSku(RedisSkuName.Standard, RedisSkuFamily.BasicOrStandard, 1))
{
EnableNonSslPort = false,
MinimumTlsVersion = RedisTlsVersion.Tls1_2,
RedisConfiguration = new RedisCommonConfiguration
{
MaxMemoryPolicy = "volatile-lru"
},
Tags =
{
["environment"] = "production"
}
};
// Create cache (long-running operation)
var cacheCollection = resourceGroup.Value.GetAllRedis();
var operation = await cacheCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"my-redis-cache",
cacheData);
RedisResource cache = operation.Value;
Console.WriteLine($"Cache created: {cache.Data.HostName}");
```
### 2. Get Redis Cache
```csharp
// Get existing cache
var cache = await resourceGroup.Value
.GetRedisAsync("my-redis-cache");
Console.WriteLine($"Host: {cache.Value.Data.HostName}");
Console.WriteLine($"Port: {cache.Value.Data.Port}");
Console.WriteLine($"SSL Port: {cache.Value.Data.SslPort}");
Console.WriteLine($"Provisioning State: {cache.Value.Data.ProvisioningState}");
```
### 3. Update Redis Cache
```csharp
var patchData = new RedisPatch
{
Sku = new RedisSku(RedisSkuName.Standard, RedisSkuFamily.BasicOrStandard, 2),
RedisConfiguration = new RedisCommonConfiguration
{
MaxMemoryPolicy = "allkeys-lru"
}
};
var updateOperation = await cache.Value.UpdateAsync(
WaitUntil.Completed,
patchData);
```
### 4. Delete Redis Cache
```csharp
await cache.Value.DeleteAsync(WaitUntil.Completed);
```
### 5. Get Access Keys
```csharp
var keys = await cache.Value.GetKeysAsync();
Console.WriteLine($"Primary Key: {keys.Value.PrimaryKey}");
Console.WriteLine($"Secondary Key: {keys.Value.SecondaryKey}");
```
### 6. Regenerate Access Keys
```csharp
var regenerateContent = new RedisRegenerateKeyContent(RedisRegenerateKeyType.Primary);
var newKeys = await cache.Value.RegenerateKeyAsync(regenerateContent);
Console.WriteLine($"New Primary Key: {newKeys.Value.PrimaryKey}");
```
### 7. Manage Firewall Rules
```csharp
// Create firewall rule
var firewallData = new RedisFirewallRuleData(
startIP: System.Net.IPAddress.Parse("10.0.0.1"),
endIP: System.Net.IPAddress.Parse("10.0.0.255"));
var firewallCollection = cache.Value.GetRedisFirewallRules();
var firewallOperation = await firewallCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"allow-internal-network",
firewallData);
// List all firewall rules
await foreach (var rule in firewallCollection.GetAllAsync())
{
Console.WriteLine($"Rule: {rule.Data.Name} ({rule.Data.StartIP} - {rule.Data.EndIP})");
}
// Delete firewall rule
var ruleToDelete = await firewallCollection.GetAsync("allow-internal-network");
await ruleToDelete.Value.DeleteAsync(WaitUntil.Completed);
```
### 8. Configure Patch Schedule (Premium SKU)
```csharp
// Patch schedules require Premium SKU
var scheduleData = new RedisPatchScheduleData(
new[]
{
new RedisPatchScheduleSetting(RedisDayOfWeek.Saturday, 2) // 2 AM Saturday
{
MaintenanceWindow = TimeSpan.FromHours(5)
},
new RedisPatchScheduleSetting(RedisDayOfWeek.Sunday, 2) // 2 AM Sunday
{
MaintenanceWindow = TimeSpan.FromHours(5)
}
});
var scheduleCollection = cache.Value.GetRedisPatchSchedules();
await scheduleCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
RedisPatchScheduleDefaultName.Default,
scheduleData);
```
### 9. Import/Export Data (Premium SKU)
```csharp
// Import data from blob storage
var importContent = new ImportRdbContent(
files: new[] { "https://mystorageaccount.blob.core.windows.net/container/dump.rdb" },
format: "RDB");
await cache.Value.ImportDataAsync(WaitUntil.Completed, importContent);
// Export data to blob storage
var exportContent = new ExportRdbContent(
prefix: "backup",
container: "https://mystorageaccount.blob.core.windows.net/container?sastoken",
format: "RDB");
await cache.Value.ExportDataAsync(WaitUntil.Completed, exportContent);
```
### 10. Force Reboot
```csharp
var rebootContent = new RedisRebootContent
{
RebootType = RedisRebootType.AllNodes,
ShardId = 0 // For clustered caches
};
await cache.Value.ForceRebootAsync(rebootContent);
```
## SKU Reference
| SKU | Family | Capacity | Features |
|-----|--------|----------|----------|
| Basic | C | 0-6 | Single node, no SLA, dev/test only |
| Standard | C | 0-6 | Two nodes (primary/replica), SLA |
| Premium | P | 1-5 | Clustering, geo-replication, VNet, persistence |
**Capacity Sizes (Family C - Basic/Standard)**:
- C0: 250 MB
- C1: 1 GB
- C2: 2.5 GB
- C3: 6 GB
- C4: 13 GB
- C5: 26 GB
- C6: 53 GB
**Capacity Sizes (Family P - Premium)**:
- P1: 6 GB per shard
- P2: 13 GB per shard
- P3: 26 GB per shard
- P4: 53 GB per shard
- P5: 120 GB per shard
## Key Types Reference
| Type | Purpose |
|------|---------|
| `ArmClient` | Entry point for all ARM operations |
| `RedisResource` | Represents a Redis cache instance |
| `RedisCollection` | Collection for cache CRUD operations |
| `RedisFirewallRuleResource` | Firewall rule for IP filtering |
| `RedisPatchScheduleResource` | Maintenance window configuration |
| `RedisLinkedServerWithPropertyResource` | Geo-replication linked server |
| `RedisPrivateEndpointConnectionResource` | Private endpoint connection |
| `RedisCacheAccessPolicyResource` | RBAC access policy |
| `RedisCreateOrUpdateContent` | Cache creation payload |
| `RedisPatch` | Cache update payload |
| `RedisSku` | SKU configuration (name, family, capacity) |
| `RedisAccessKeys` | Primary and secondary access keys |
| `RedisRegenerateKeyContent` | Key regeneration request |
## Best Practices
1. **Use `WaitUntil.Completed`** for operations that must finish before proceeding
2. **Use `WaitUntil.Started`** when you want to poll manually or run operations in parallel
3. **Always use `DefaultAzureCredential`** — never hardcode keys
4. **Handle `RequestFailedException`** for ARM API errors
5. **Use `CreateOrUpdateAsync`** for idempotent operations
6. **Navigate hierarchy** via `Get*` methods (e.g., `cache.GetRedisFirewallRules()`)
7. **Use Premium SKU** for production workloads requiring geo-replication, clustering, or persistence
8. **Enable TLS 1.2 minimum** — set `MinimumTlsVersion = RedisTlsVersion.Tls1_2`
9. **Disable non-SSL port** — set `EnableNonSslPort = false` for security
10. **Rotate keys regularly** — use `RegenerateKeyAsync` and update connection strings
## Error Handling
```csharp
using Azure;
try
{
var operation = await cacheCollection.CreateOrUpdateAsync(
WaitUntil.Completed, cacheName, cacheData);
}
catch (RequestFailedException ex) when (ex.Status == 409)
{
Console.WriteLine("Cache already exists");
}
catch (RequestFailedException ex) when (ex.Status == 400)
{
Console.WriteLine($"Invalid configuration: {ex.Message}");
}
catch (RequestFailedException ex)
{
Console.WriteLine($"ARM Error: {ex.Status} - {ex.ErrorCode}: {ex.Message}");
}
```
## Common Pitfalls
1. **SKU downgrades not allowed** — You cannot downgrade from Premium to Standard/Basic
2. **Clustering requires Premium** — Shard configuration only available on Premium SKU
3. **Geo-replication requires Premium** — Linked servers only work with Premium caches
4. **VNet injection requires Premium** — Virtual network support is Premium-only
5. **Patch schedules require Premium** — Maintenance windows only configurable on Premium
6. **Cache name globally unique** — Redis cache names must be unique across all Azure subscriptions
7. **Long provisioning times** — Cache creation can take 15-20 minutes; use `WaitUntil.Started` for async patterns
## Connecting with StackExchange.Redis (Data Plane)
After creating the cache with this management SDK, use StackExchange.Redis for data operations:
```csharp
using StackExchange.Redis;
// Get connection info from management SDK
var cache = await resourceGroup.Value.GetRedisAsync("my-redis-cache");
var keys = await cache.Value.GetKeysAsync();
// Connect with StackExchange.Redis
var connectionString = $"{cache.Value.Data.HostName}:{cache.Value.Data.SslPort},password={keys.Value.PrimaryKey},ssl=True,abortConnect=False";
var connection = ConnectionMultiplexer.Connect(connectionString);
var db = connection.GetDatabase();
// Data operations
await db.StringSetAsync("key", "value");
var value = await db.StringGetAsync("key");
```
## Related SDKs
| SDK | Purpose | Install |
|-----|---------|---------|
| `StackExchange.Redis` | Data plane (get/set, pub/sub, streams) | `dotnet add package StackExchange.Redis` |
| `Azure.ResourceManager.Redis` | Management plane (this SDK) | `dotnet add package Azure.ResourceManager.Redis` |
| `Microsoft.Azure.StackExchangeRedis` | Azure-specific Redis extensions | `dotnet add package Microsoft.Azure.StackExchangeRedis` |
모든 파일
0개 파일azure-resource-manager-redis-dotnet 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어 주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-redis-dotnet # Copy SKILL.md to your .claude/skills/ directory
복사





집
