您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

az redis

Manage dedicated Redis caches for your Azure applications.

Commands

az redis create

Create new Redis Cache instance.

az redis delete

Deletes a Redis cache.

az redis export

Export data stored in a Redis cache.

az redis firewall-rules

Manage Redis firewall rules.

az redis firewall-rules create

Create a redis cache firewall rule.

az redis firewall-rules delete

Deletes a single firewall rule in a specified redis cache.

az redis firewall-rules list

Gets all firewall rules in the specified redis cache.

az redis firewall-rules show

Gets a single firewall rule in a specified redis cache.

az redis firewall-rules update

Update a redis cache firewall rule.

az redis force-reboot

Reboot specified Redis node(s).

az redis import

Import data into a Redis cache.

az redis import-method

Import data into Redis cache.

az redis list

List Redis Caches.

az redis list-keys

Retrieve a Redis cache's access keys.

az redis patch-schedule

Manage Redis patch schedules.

az redis patch-schedule create

Create patching schedule for Redis cache.

az redis patch-schedule delete

Deletes the patching schedule of a redis cache (requires Premium SKU).

az redis patch-schedule show

Gets the patching schedule of a redis cache (requires Premium SKU).

az redis patch-schedule update

Update the patching schedule for Redis cache.

az redis regenerate-keys

Regenerate Redis cache's access keys.

az redis server-link

Manage Redis server links.

az redis server-link create

Adds a server link to the Redis cache (requires Premium SKU).

az redis server-link delete

Deletes the linked server from a redis cache (requires Premium SKU).

az redis server-link list

Gets the list of linked servers associated with this redis cache (requires Premium SKU).

az redis server-link show

Gets the detailed information about a linked server of a redis cache (requires Premium SKU).

az redis show

Gets a Redis cache (resource description).

az redis update

Update a Redis cache.

az redis create

Create new Redis Cache instance.

az redis create --location
                --name
                --resource-group
                --sku {Basic, Premium, Standard}
                --vm-size {c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5}
                [--enable-non-ssl-port]
                [--minimum-tls-version {1.0, 1.1, 1.2}]
                [--redis-configuration]
                [--replicas-per-master]
                [--shard-count]
                [--static-ip]
                [--subnet-id]
                [--subscription]
                [--tags]
                [--tenant-settings]
                [--zones {1, 2, 3}]

Examples

Create new Redis Cache instance. (autogenerated)

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Basic --vm-size c0

Required Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--sku

Type of Redis cache.

accepted values: Basic, Premium, Standard
--vm-size

Size of Redis cache to deploy. Basic and Standard Cache sizes start with C. Premium Cache sizes start with P.

accepted values: c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5

Optional Parameters

--enable-non-ssl-port

If specified, then the non-ssl redis server port (6379) will be enabled.

--minimum-tls-version

Specifies the TLS version required by clients to connect to cache.

accepted values: 1.0, 1.1, 1.2
--redis-configuration

JSON encoded configuration settings. Use @{file} to load from a file.

--replicas-per-master

The number of replicas to be created per master.

--shard-count

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

--static-ip

Specify a static ip if required for the VNET. If you do not specify a static IP then an IP address is chosen automatically.

--subnet-id

The full resource ID of a subnet in a virtual network to deploy the redis cache in. Example format /subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/Microsoft.{Network|ClassicNetwork}/virtualNetworks/vnet1/subnets/subnet1.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--tenant-settings

Space-separated tenant settings in key[=value] format.

--zones -z

Space-separated list of availability zones into which to provision the resource.

accepted values: 1, 2, 3

az redis delete

Deletes a Redis cache.

az redis delete [--ids]
                [--name]
                [--resource-group]
                [--subscription]
                [--yes]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

az redis export

Export data stored in a Redis cache.

az redis export --container
                --prefix
                [--file-format]
                [--ids]
                [--name]
                [--resource-group]
                [--subscription]

Required Parameters

--container

SAS url for container where data needs to be exported to.

--prefix

Prefix to use for exported files.

Optional Parameters

--file-format

Format of the blob (Currently rdb is the only supported format, with other formats expected in the future).

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis force-reboot

Reboot specified Redis node(s).

This operation requires write permission to the cache resource. There can be potential data loss.

az redis force-reboot --reboot-type {AllNodes, PrimaryNode, SecondaryNode}
                      [--ids]
                      [--name]
                      [--resource-group]
                      [--shard-id]
                      [--subscription]

Required Parameters

--reboot-type

Which Redis node(s) to reboot. Depending on this value data loss is possible.

accepted values: AllNodes, PrimaryNode, SecondaryNode

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--shard-id

If clustering is enabled, the ID of the shard to be rebooted.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis import

Import data into a Redis cache.

az redis import --files
                [--file-format]
                [--ids]
                [--name]
                [--resource-group]
                [--subscription]

Required Parameters

--files

SAS url for blobs that needs to be imported.

Optional Parameters

--file-format

Format of the blob (Currently rdb is the only supported format, with other formats expected in the future).

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis import-method

Import data into Redis cache.

az redis import-method --files
                       [--file-format]
                       [--ids]
                       [--name]
                       [--resource-group]
                       [--subscription]

Required Parameters

--files

SAS url for blobs that needs to be imported.

Optional Parameters

--file-format

Format of the blob (Currently rdb is the only supported format, with other formats expected in the future).

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis list

List Redis Caches.

Lists details about all caches within current Subscription or provided Resource Group.

az redis list [--query-examples]
              [--resource-group]
              [--subscription]

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis list-keys

Retrieve a Redis cache's access keys.

This operation requires write permission to the cache resource.

az redis list-keys [--ids]
                   [--name]
                   [--resource-group]
                   [--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis regenerate-keys

Regenerate Redis cache's access keys.

This operation requires write permission to the cache resource.

az redis regenerate-keys --key-type {Primary, Secondary}
                         [--ids]
                         [--name]
                         [--resource-group]
                         [--subscription]

Required Parameters

--key-type

The Redis access key to regenerate.

accepted values: Primary, Secondary

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis show

Gets a Redis cache (resource description).

az redis show [--ids]
              [--name]
              [--query-examples]
              [--resource-group]
              [--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az redis update

Update a Redis cache.

Scale or update settings of a Redis cache.

az redis update [--add]
                [--force-string]
                [--ids]
                [--name]
                [--remove]
                [--resource-group]
                [--set]
                [--sku {Basic, Premium, Standard}]
                [--subscription]
                [--vm-size {c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5}]

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Redis cache.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--sku

Type of Redis cache.

accepted values: Basic, Premium, Standard
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--vm-size

Size of Redis cache to deploy. Basic and Standard Cache sizes start with C. Premium Cache sizes start with P.

accepted values: c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5