Redis - Create

Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}?api-version=2016-04-01

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

resourceGroupName
path True
  • string

The name of the resource group.

name
path True
  • string

The name of the Redis cache.

api-version
query True
  • string

Client Api Version.

Request Body

Name Required Type Description
location True
  • string

Resource location.

properties.enableNonSslPort
  • boolean

Specifies whether the non-ssl Redis server port (6379) is enabled.

properties.redisConfiguration
  • object

All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.

properties.shardCount
  • integer

The number of shards to be created on a Premium Cluster Cache.

properties.sku True

The SKU of the Redis cache to deploy.

properties.staticIP
  • string

Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network.

properties.subnetId
  • string

The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1

properties.tenantSettings
  • object

tenantSettings

tags
  • object

Resource tags.

Responses

Name Type Description
200 OK

The existing redis cache was successfully updated. Check provisioningStatus to see detailed status.

201 Created

The new redis cache was successfully created. Check provisioningStatus to see detailed status.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

RedisCacheCreate

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1?api-version=2016-04-01
{
  "location": "West US",
  "properties": {
    "sku": {
      "name": "Premium",
      "family": "P",
      "capacity": 1
    },
    "enableNonSslPort": true,
    "shardCount": 2,
    "redisConfiguration": {
      "maxmemory-policy": "allkeys-lru"
    },
    "subnetId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1",
    "staticIP": "192.168.0.5"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1",
  "location": "West US",
  "name": "cache1",
  "type": "Microsoft.Cache/Redis",
  "tags": {},
  "properties": {
    "accessKeys": {
      "primaryKey": "secretkey1",
      "secondaryKey": "secretKey2"
    },
    "provisioningState": "Succeeded",
    "redisVersion": "3.0",
    "sku": {
      "name": "Premium",
      "family": "P",
      "capacity": 1
    },
    "enableNonSslPort": false,
    "redisConfiguration": {
      "maxmemory-policy": "allkeys-lru"
    },
    "hostName": "cache1.redis.cache.windows.net",
    "port": 6379,
    "sslPort": 6380
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache1",
  "location": "West US",
  "name": "cache1",
  "type": "Microsoft.Cache/Redis",
  "tags": {},
  "properties": {
    "accessKeys": {
      "primaryKey": "secretkey1",
      "secondaryKey": "secretKey2"
    },
    "provisioningState": "Succeeded",
    "redisVersion": "3.0",
    "sku": {
      "name": "Premium",
      "family": "P",
      "capacity": 1
    },
    "enableNonSslPort": false,
    "redisConfiguration": {
      "maxclients": "1000",
      "maxmemory-reserved": "50",
      "maxmemory-delta": "50"
    },
    "hostName": "cache1.redis.cache.windows.net",
    "port": 6379,
    "sslPort": 6380
  }
}

Definitions

RedisAccessKeys

Redis cache access keys.

RedisCreateParameters

Parameters supplied to the Create Redis operation.

RedisResource

A single Redis item in List or Get Operation.

Sku

SKU parameters supplied to the create Redis operation.

SkuFamily

The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium).

SkuName

The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium)

RedisAccessKeys

Redis cache access keys.

Name Type Description
primaryKey
  • string

The current primary key that clients can use to authenticate with Redis cache.

secondaryKey
  • string

The current secondary key that clients can use to authenticate with Redis cache.

RedisCreateParameters

Parameters supplied to the Create Redis operation.

Name Type Description
id
  • string

Resource ID.

location
  • string

Resource location.

name
  • string

Resource name.

properties.enableNonSslPort
  • boolean

Specifies whether the non-ssl Redis server port (6379) is enabled.

properties.redisConfiguration
  • object

All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.

properties.shardCount
  • integer

The number of shards to be created on a Premium Cluster Cache.

properties.sku

The SKU of the Redis cache to deploy.

properties.staticIP
  • string

Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network.

properties.subnetId
  • string

The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1

properties.tenantSettings
  • object

tenantSettings

tags
  • object

Resource tags.

type
  • string

Resource type.

RedisResource

A single Redis item in List or Get Operation.

Name Type Description
id
  • string

Resource ID.

location
  • string

Resource location.

name
  • string

Resource name.

properties.accessKeys

The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache

properties.enableNonSslPort
  • boolean

Specifies whether the non-ssl Redis server port (6379) is enabled.

properties.hostName
  • string

Redis host name.

properties.port
  • integer

Redis non-SSL port.

properties.provisioningState
  • string

Redis instance provisioning status.

properties.redisConfiguration
  • object

All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.

properties.redisVersion
  • string

Redis version.

properties.shardCount
  • integer

The number of shards to be created on a Premium Cluster Cache.

properties.sku

The SKU of the Redis cache to deploy.

properties.sslPort
  • integer

Redis SSL port.

properties.staticIP
  • string

Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network.

properties.subnetId
  • string

The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1

properties.tenantSettings
  • object

tenantSettings

tags
  • object

Resource tags.

type
  • string

Resource type.

Sku

SKU parameters supplied to the create Redis operation.

Name Type Description
capacity
  • integer

The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4).

family

The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium).

name

The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium)

SkuFamily

The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium).

Name Type Description
C
  • string
P
  • string

SkuName

The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium)

Name Type Description
Basic
  • string
Premium
  • string
Standard
  • string