共用方式為


az redis

管理 Azure 應用程式的專用 Redis 快取。

命令

名稱 Description 類型 狀態
az redis access-policy

管理 Redis 快取的存取原則。

Core GA
az redis access-policy-assignment

管理 Redis 快取的存取原則指派(Redis 使用者)。

Core GA
az redis access-policy-assignment create

將存取原則指派 (Redis 使用者) 新增至 Redis 快取。

Core GA
az redis access-policy-assignment delete

刪除存取原則指派(Redis 使用者)。

Core GA
az redis access-policy-assignment list

取得與 Redis 快取相關聯的存取原則指派清單(Redis 使用者)。

Core GA
az redis access-policy-assignment show

取得 Redis 快取之存取原則指派 (Redis 使用者) 的詳細資訊。

Core GA
az redis access-policy-assignment update

更新 Redis 快取的存取原則指派 (Redis 使用者)。

Core GA
az redis access-policy create

將存取原則新增至 Redis 快取。

Core GA
az redis access-policy delete

刪除存取原則。

Core GA
az redis access-policy list

取得與 Redis 快取相關聯的存取原則清單。

Core GA
az redis access-policy show

取得 Redis 快取存取原則的詳細資訊。

Core GA
az redis access-policy update

更新 Redis 快取的存取原則。

Core GA
az redis create

建立新的 Redis 快取實例。

Core GA
az redis delete

刪除 Redis 快取。

Core GA
az redis export

匯出儲存在 Redis 快取中的數據。

Core GA
az redis firewall-rules

管理 Redis 防火牆規則。

Core GA
az redis firewall-rules create

建立 redis 快取防火牆規則。

Core GA
az redis firewall-rules delete

刪除指定 redis 快取中的單一防火牆規則。

Core GA
az redis firewall-rules list

取得指定 redis 快取中的所有防火牆規則。

Core GA
az redis firewall-rules show

取得指定 redis 快取中的單一防火牆規則。

Core GA
az redis firewall-rules update

更新 redis 快取防火牆規則。

Core GA
az redis flush

刪除快取中的所有索引鍵。

Core GA
az redis force-reboot

重新啟動指定的 Redis 節點(s)。

Core GA
az redis identity

管理指派給 Azure Cache for Redis 的身分識別。

Core GA
az redis identity assign

指派 Azure Cache for Redis 的身分識別。

Core GA
az redis identity remove

拿掉已為 Azure Cache for Redis 指派的身分識別。

Core GA
az redis identity show

顯示為 Azure Cache for Redis 指派的身分識別。

Core GA
az redis import

將數據匯入 Redis 快取。

Core GA
az redis list

列出 Redis 快取。

Core GA
az redis list-keys

擷取 Redis 快取的存取金鑰。

Core GA
az redis patch-schedule

管理 Redis 修補程式排程。

Core GA
az redis patch-schedule create

建立 Redis 快取的修補排程。

Core GA
az redis patch-schedule delete

刪除 redis 快取的修補排程。

Core GA
az redis patch-schedule show

取得 redis 快取的修補排程。

Core GA
az redis patch-schedule update

更新 Redis 快取的修補排程。

Core GA
az redis regenerate-keys

重新產生 Redis 快取的存取金鑰。

Core GA
az redis server-link

管理 Redis 伺服器連結。

Core GA
az redis server-link create

將伺服器連結新增至 Redis 快取(需要進階 SKU)。

Core GA
az redis server-link delete

從 Redis 快取中刪除連結的伺服器(需要進階 SKU)。

Core GA
az redis server-link list

取得與此 redis 快取相關聯的連結伺服器清單(需要進階 SKU)。

Core GA
az redis server-link show

取得 Redis 快取連結伺服器的詳細資訊(需要進階 SKU)。

Core GA
az redis show

取得 Redis 快取 (資源描述)。

Core GA
az redis update

更新 Redis 快取。

Core GA

az redis create

建立新的 Redis 快取實例。

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}
                [--disable-access-keys {false, true}]
                [--enable-non-ssl-port]
                [--mi-system-assigned]
                [--mi-user-assigned]
                [--minimum-tls-version {1.0, 1.1, 1.2}]
                [--redis-configuration]
                [--redis-version]
                [--replicas-per-master]
                [--shard-count]
                [--static-ip]
                [--subnet-id]
                [--tags]
                [--tenant-settings]
                [--update-channel {Preview, Stable}]
                [--zonal-allocation --zonal-allocation-policy {Automatic, NoZones, UserDefined}]
                [--zones]

範例

建立新的 Redis 快取實例。 (autogenerated)

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

為新的進階 Azure Redis 快取設定多個區域

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --zones 1 2

部署已自動配置區域的進階 Azure Cache for Redis

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --zonal-allocation-policy Automatic

設定快取的記憶體原則。

az redis create --resource-group resourceGroupName --name cacheName --location westus2 --sku Standard --vm-size c0 --redis-configuration @"config_max-memory.json"

為新的進階 Azure Redis 快取設定並啟用 RDB 備份數據持續性。

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --redis-configuration @"config_rdb.json"

為新的進階 Azure Redis 快取設定並啟用 AOF 備份數據持續性

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --redis-configuration @"config_aof.json"

建立已啟用叢集功能的進階 Azure Redis 快取

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --shard-count 2

在現有的 Azure 虛擬網路內部署進階 Azure Cache for Redis

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --subnet-id "/subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/Microsoft.{Network|ClassicNetwork}/virtualNetworks/vnet1/subnets/subnet1"

部署進階 Azure Cache for Redis,並已設定 Microsoft Entra Authentication 並停用存取密鑰

az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Premium --vm-size p1 --disable-access-keys true --redis-configuration @"config_enable-aad.json"

必要參數

--location -l

Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。

--name -n

Redis 快取的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--sku

Redis 快取的類型。

屬性
接受的值: Basic, Premium, Standard
--vm-size

要部署的 Redis 快取大小。 基本和標準快取大小從 C 開始。進階快取大小從 P 開始。

屬性
接受的值: c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--disable-access-keys

當設定為 true 時,會停用透過存取密鑰對 Redis 的驗證。

屬性
接受的值: false, true
--enable-non-ssl-port

如果指定,則會啟用非 ssl redis 伺服器埠 (6379)。

--mi-system-assigned

指定系統指派身分識別的旗標。

--mi-user-assigned

使用者指派身分識別的一或多個空間分隔資源標識符。

--minimum-tls-version

指定客戶端連線至快取所需的 TLS 版本。

屬性
接受的值: 1.0, 1.1, 1.2
--redis-configuration

用來設定 redis 組態設定的 json 檔案。 如果 json 檔案無效,您可能會遇到剖析錯誤。

使用量:--redis-configuration @"{config_file.json}"

設定 max-memory policies 的範例 json 檔案 [ { “maxmemory-policy”: “allkeys-lru” } ]

啟用 RDB 備份數據持續性的範例 json 檔案是 [ { “rdb-storage-connection-string”: “DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=myAccountKey;EndpointSuffix=core.windows.net“, ”rdb-backup-enabled“: ”true“, ”rdb-backup-frequency“: ”15“, ”rdb-backup-max-snapshot-count“: ”1“ } ]

啟用 AOF 備份數據持續性的範例 json 檔案是 [ { “aof-backup-enabled”: “true”, “aof-storage-connection-string-0”: “DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=myAccountKey;EndpointSuffix=core.windows.net“, ”aof-storage-connection-string-1“: ”DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=myAccountKey;EndpointSuffix=core.windows.net“ } ]

用於設定 Microsoft Entra Authentication 的 json 檔案內容為 { “aad-enabled”: “true”, }。

--redis-version

Redis version. 這的格式應該是 'major[.minor]' (只需要 'major' )或值 'latest',其指的是可用的最新穩定 Redis 版本。 支援的版本:4.0、6.0(最新版)。 預設值為 『latest』。

--replicas-per-master

要為每個主要複本建立的複本數目。

--shard-count

在進階叢集快取上建立的分區數目。

--static-ip

如果需要 VNET,請指定靜態 IP。 如果您未指定靜態IP,則會自動選擇IP位址。

--subnet-id

虛擬網路中要部署 redis 快取之子網的完整資源標識碼。 範例格式 /subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/Microsoft。{Network|ClassicNetwork}/virtualNetworks/vnet1/subnets/subnet1。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--tenant-settings

key[=value] 格式的空間分隔租用戶設定。

--update-channel

指定您 Redis 快取將接收之每月 Redis 更新的更新通道。 使用「預覽」更新通道的快取會在「穩定」通道快取之前至少 4 周取得最新的 Redis 更新。 預設值為 「Stable」。

屬性
接受的值: Preview, Stable
--zonal-allocation --zonal-allocation-policy

指定可用性區域如何配置給 Redis 快取。 「自動」可啟用區域備援,Azure 會根據區域可用性和容量自動選取區域。 “UserDefined” 會選取您使用 “zones” 參數傳入的可用性區域。 “NoZones” 會產生非區域性快取。 如果未傳遞「區域配置原則」,則會在傳入區域時將它設定為「用戶定義」,否則會在區域不支援的區域中設定為「自動」,並在不支援區域的區域中設定為「NoZones」。

屬性
接受的值: Automatic, NoZones, UserDefined
--zones -z

要在其中布建資源的可用性區域空間分隔清單。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis delete

刪除 Redis 快取。

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

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
--yes -y

請勿提示確認。

屬性
預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis export

匯出儲存在 Redis 快取中的數據。

az redis export --container
                --prefix
                [--auth-method --preferred-data-archive-auth-method {ManagedIdentity, SAS}]
                [--file-format]
                [--ids]
                [--name]
                [--resource-group]
                [--storage-sub-id --storage-subscription-id]
                [--subscription]

範例

使用受控識別導出快取數據

az redis export -n testCacheName -g testResourceGroup --prefix examplePrefix --container containerUrl  --preferred-data-archive-auth-method ManagedIdentity --storage-subscription-id 1a6574ss-ddad-1111-a111-8d756312d1dd

必要參數

--container

需要匯出數據之容器的SAS URL。

--prefix

要用於導出檔案的前置詞。

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--auth-method --preferred-data-archive-auth-method

慣用的驗證方法,用來與用於數據封存的記憶體帳戶通訊,預設值為 SAS。

屬性
接受的值: ManagedIdentity, SAS
--file-format

Blob 的格式(目前 rdb 是唯一支援的格式,未來預期使用其他格式)。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--storage-sub-id --storage-subscription-id

記憶體帳戶的 SubscriptionId。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis flush

刪除快取中的所有索引鍵。

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

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
--yes -y

請勿提示確認。

屬性
預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis force-reboot

重新啟動指定的 Redis 節點(s)。

使用範例 - az redis force-reboot --name testCacheName --resource-group testResourceGroup --reboot-type {AllNodes, PrimaryNode, SecondaryNode} [--shard-id]。

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

必要參數

--reboot-type

要重新啟動的 Redis 節點。 視此值而定,可能會遺失數據。

屬性
接受的值: AllNodes, PrimaryNode, SecondaryNode

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--shard-id

如果已啟用叢集,則會重新啟動分區的標識碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis import

將數據匯入 Redis 快取。

az redis import --files
                [--auth-method --preferred-data-archive-auth-method {ManagedIdentity, SAS}]
                [--file-format]
                [--ids]
                [--name]
                [--resource-group]
                [--storage-sub-id --storage-subscription-id]
                [--subscription]

範例

使用受控識別匯入快取數據

az redis import -n testCacheName -g testResourceGroup --files blobUrl --preferred-data-archive-auth-method ManagedIdentity --storage-subscription-id 1a6574ss-ddad-1111-a111-8d756312d1dd

必要參數

--files

需要匯入之 Blob 的 SAS URL。

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--auth-method --preferred-data-archive-auth-method

慣用的驗證方法,用來與用於數據封存的記憶體帳戶通訊,預設值為 SAS。

屬性
接受的值: ManagedIdentity, SAS
--file-format

Blob 的格式(目前 rdb 是唯一支援的格式,未來預期使用其他格式)。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--storage-sub-id --storage-subscription-id

記憶體帳戶的 SubscriptionId。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis list

列出 Redis 快取。

列出目前訂用帳戶內或提供之資源群組內所有快取的詳細數據。

az redis list [--resource-group]

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis list-keys

擷取 Redis 快取的存取金鑰。

此作業需要快取資源的寫入許可權。

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

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis regenerate-keys

重新產生 Redis 快取的存取金鑰。

使用範例 - az redis regenerate-keys --name testCacheName --resource-group testResourceGroup --key-type {Primary, Secondary}。

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

必要參數

--key-type

要重新產生之 Redis 存取金鑰。

屬性
接受的值: Primary, Secondary

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis show

取得 Redis 快取 (資源描述)。

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

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az redis update

更新 Redis 快取。

調整或更新 Redis 快取的設定。

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}]

範例

更新名為 MyRedisCache 之 Azure Cache for Redis 的 maxmemory-policy

az redis update --name MyRedisCache --resource-group MyResourceGroup --set "redisConfiguration.maxmemory-policy"="allkeys-lru"

停用進階 Azure Cache for Redis 的 RDB 備份數據持續性

az redis update --name MyRedisCache --resource-group MyResourceGroup --set "redisConfiguration.rdb-backup-enabled"="false"

針對已建立的進階 Azure Cache for Redis 設定已啟用 RDB 備份的數據持續性

az redis update --name MyRedisCache --resource-group MyResourceGroup --set "redisConfiguration.rdb-storage-connection-string"="BlobEndpoint=https//..." "redisConfiguration.rdb-backup-enabled"="true" "redisConfiguration.rdb-backup-frequency"="15" "redisConfiguration.rdb-backup-max-snapshot-count"="1"

調整 Azure Cache for Redis 實例 - 更新為不同的大小(從 c0 調整為 c1 的範例)。

az redis update --name MyRedisCache --resource-group MyResourceGroup --set "sku.capacity"="2"

調整 Azure Cache for Redis 實例 - 將更新至不同層級(從基本層調整為標準或標準至進階版)。

az redis update --name MyRedisCache --resource-group MyResourceGroup --set "sku.name"="Premium" "sku.capacity"="1" "sku.family"="P"

調整 Azure Cache for Redis 實例 - 啟用叢集。

az redis update --name MyRedisCache --resource-group MyResourceGroup --set shardCount=1

使用 Redis 叢集來相應縮小/放大 Azure Cache for Redis 實例。

az redis update --name MyRedisCache --resource-group MyResourceGroup --set shardCount=2

停用 Redis 的存取金鑰驗證。

az redis update --name MyRedisCache --resource-group MyResourceGroup --set "disableAccessKeyAuthentication=true"

使用自動區域配置原則,將非區域備援快取更新至區域備援快取。

az redis update --name MyRedisCache --resource-group MyResourceGroup --set "zonalAllocationPolicy=Automatic"

選擇性參數

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例: --add property.listProperty <key=value, string or JSON string>.

屬性
Parameter group: Generic Update Arguments
預設值: []
--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

屬性
Parameter group: Generic Update Arguments
預設值: False
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
Parameter group: Resource Id Arguments
--name -n

Redis 快取的名稱。

屬性
Parameter group: Resource Id Arguments
--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

屬性
Parameter group: Generic Update Arguments
預設值: []
--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

屬性
Parameter group: Resource Id Arguments
--set

指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>.

屬性
Parameter group: Generic Update Arguments
預設值: []
--sku

Redis 快取的類型。

屬性
接受的值: Basic, Premium, Standard
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

屬性
Parameter group: Resource Id Arguments
--vm-size

要部署的 Redis 快取大小。 基本和標準快取大小從 C 開始。進階快取大小從 P 開始。

屬性
接受的值: c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

Output format.

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False