Python용 Azure Redis Cache 라이브러리Azure Redis Cache libraries for Python

개요Overview

Azure Redis Cache는 인기 있는 Redis 프로젝트 오픈 소스를 기반으로 합니다.Azure Redis Cache is based on the popular open source Redis project. Microsoft에서 관리하고 Azure 앱에서 액세스할 수 있는 안전한 전용 Redis 인스턴스에 대한 액세스를 제공합니다.It gives you access to a secure, dedicated Redis instance, managed by Microsoft and accessible from your Azure apps.

Redis는 고급 키-값 저장소이며, 키에는 문자열, 해시, 목록, 집합, 정렬된 집합과 같은 데이터 구조가 포함될 수 있습니다.Redis is an advanced key-value store, where keys can contain data structures such as strings, hashes, lists, sets, and sorted sets. Redis는 이러한 데이터 유형에 대한 소규모 작업 집합을 지원합니다.Redis supports a set of atomic operations on these data types.

Azure Redis Cache에 대해 자세히 알아보세요.Learn more about Azure Redis Cache.

관리 APIManagement API

Redis 관리 API를 사용하여 구독의 Redis 리소스를 만들고 관리합니다.Create and manage your Redis resources in your subscription with the Redis management API.

pip install redis
pip install azure-mgmt-redis

Example

다음 예제에서는 새 Redis 캐시를 만듭니다.The following example creates a new Redis cache:

from azure.mgmt.redis import RedisManagementClient
from azure.mgmt.redis.models import Sku, RedisCreateOrUpdateParameters

redis_client = RedisManagementClient(
    credentials,
    subscription_id
)
group_name = 'myresourcegroup'
cache_name = 'mycachename'
redis_cache = redis_client.redis.create_or_update(
    group_name,
    cache_name,
    RedisCreateOrUpdateParameters(
        sku = Sku(name = 'Basic', family = 'C', capacity = '1'),
        location = "East US"
    )
)
# redis_cache is a RedisResourceWithAccessKey instance