Klasik Azure CLI kullanarak Redis için Azure Cache oluşturma ve yönetme

Klasik Azure CLI, Azure altyapınızı herhangi bir platformdan yönetmenin harika bir yoludur. Bu makalede, klasik Azure CLI kullanarak Redis için Azure Cache örneklerinizi oluşturma ve yönetme adımları gösterilmektedir.

Önemli

Bu makale, Azure klasik CLI gerektiren içeriklere sahiptir. Bu, Azure CLI’nin yalnızca Azure klasik dağıtım modeli ile birlikte kullanılması gereken eski bir sürümüdür.

Klasik CLI'yı yüklemek için bkz. Azure klasik CLI'yi yükleme ve Azure Resource Manager dağıtımları için geçerli Azure CLI'yi yükleme. Bkz. Azure CLI'yi yükleme.

Not

En son Azure CLI örnek betikleri için bkz. Azure CLI Redis için Azure Cache örnekleri.

Önkoşullar

Klasik Azure CLI kullanarak Redis için Azure Cache örnekleri oluşturmak ve yönetmek için aşağıdaki adımları tamamlamanız gerekir.

Redis için Azure Cache özellikleri

Aşağıdaki özellikler, Redis için Azure Cache örnekleri oluştururken ve güncelleştirirken kullanılır.

Özellik Anahtar Açıklama
name -n, --name Redis için Azure Cache adı.
kaynak grubu -g, --resource-group Kaynak Grubunun adı.
location -l, --location Önbellek oluşturulacak konum.
boyut -z, --size Redis için Azure Cache boyutu. Geçerli değerler: [C0, C1, C2, C3, C4, C5, C6, P1, P2, P3, P4]
Sku -x, --sku Redis SKU. Şu özelliklerden biri olmalıdır: [Temel, Standart, Premium]
EnableNonSslPort -e, --enable-non-ssl-port Redis için Azure Cache EnableNonSslPort özelliği. Önbelleğiniz için TLS/SSL olmayan Bağlantı Noktasını etkinleştirmek istiyorsanız bu bayrağı ekleyin
Redis Yapılandırması -c, --redis-configuration Redis Yapılandırması. Buraya JSON biçimli bir yapılandırma anahtarı ve değer dizesi girin. Biçim:"{"":"","":""}"
Redis Yapılandırması -f, --redis-configuration-file Redis Yapılandırması. Yapılandırma anahtarlarını ve değerlerini içeren dosyanın yolunu buraya girin. Dosya girdisinin biçimi: {"":"","":""}
Parça Sayısı -r, --shard-count Kümeleme ile Premium Küme Önbelleğinde oluşturulacak parça sayısı.
Sanal Ağ -v, --virtual-network Önbelleğinizi bir sanal ağda barındırırken, Redis için Azure Cache dağıtılacak sanal ağın tam Resource Manager kaynak kimliğini belirtir. Örnek biçim: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
anahtar türü -t, --key-type Yenilenecek anahtarın türü. Geçerli değerler: [Birincil, İkincil]
StaticIP -p, --static-ip <static-ip> Önbelleğinizi bir sanal ağda barındırırken, önbellek için alt ağda benzersiz bir IP adresi belirtir. Sağlanmadıysa, alt ağdan sizin için bir tane seçilir.
Alt ağ t, --subnet alt <ağı> Önbelleğinizi bir sanal ağda barındırırken, önbelleğin dağıtılacağı alt ağın adını belirtir.
VirtualNetwork -v, --virtual-network <virtual-network> Önbelleğinizi bir sanal ağda barındırırken, Redis için Azure Cache dağıtılacak sanal ağın tam Resource Manager kaynak kimliğini belirtir. Örnek biçim: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
Abonelik -s, --subscription Abonelik tanımlayıcısı.

Tüm Redis için Azure Cache komutlarını görme

Tüm Redis için Azure Cache komutlarını ve parametrelerini görmek için komutunu kullanınazure rediscache -h.

C:\>azure rediscache -h
help:    Commands to manage your Azure Cache for Redis(s)
help:
help:    Create an Azure Cache for Redis
help:      rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]]
help:
help:    Delete an existing Azure Cache for Redis
help:      rediscache delete [--name <name> --resource-group <resource-group> ]
help:
help:    List all Azure Cache for Redis within your Subscription or Resource Group
help:      rediscache list [options]
help:
help:    Show properties of an existing Azure Cache for Redis
help:      rediscache show [--name <name> --resource-group <resource-group>]
help:
help:    Change settings of an existing Azure Cache for Redis
help:      rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>]
help:
help:    Renew the authentication key for an existing Azure Cache for Redis
help:      rediscache renew-key [--name <name> --resource-group <resource-group> ]
help:
help:    Lists Primary and Secondary key of an existing Azure Cache for Redis
help:      rediscache list-keys [--name <name> --resource-group <resource-group>]
help:
help:    Options:
help:      -h, --help  output usage information
help:
help:    Current Mode: arm (Azure Resource Management)

Redis için Azure Cache oluşturma

Redis için Azure Cache oluşturmak için aşağıdaki komutu kullanın:

    azure rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]]

Bu komut hakkında daha fazla bilgi için komutunu çalıştırın azure rediscache create -h .

C:\>azure rediscache create -h
help:    Create an Azure Cache for Redis
help:
help:    Usage: rediscache create [--name <name> --resource-group <resource-group> --location <location> [options]]
help:
help:    Options:
help:      -h, --help                                               output usage information
help:      -v, --verbose                                            use verbose output
help:      -vv                                                      more verbose with debug output
help:      --json                                                   use json output
help:      -n, --name <name>                                        Name of the Azure Cache for Redis.
help:      -g, --resource-group <resource-group>                    Name of the Resource Group
help:      -l, --location <location>                                Location to create cache.
help:      -z, --size <size>                                        Size of the Azure Cache for Redis. Valid values: [C0, C1, C2, C3, C4, C5, C6, P1, P2, P3, P4]
help:      -x, --sku <sku>                                          Redis SKU. Should be one of : [Basic, Standard, Premium]
help:      -e, --enable-non-ssl-port                                EnableNonSslPort property of the Azure Cache for Redis. Add this flag if you want to enable the non-TLS/SSL Port for your cache
help:      -c, --redis-configuration <redis-configuration>          Redis Configuration. Enter a JSON formatted string of configuration keys and values here. Format:"{"<key1>":"<value1>","<key2>":"<value2>"}"
help:      -f, --redis-configuration-file <redisConfigurationFile>  Redis Configuration. Enter the path of a file containing configuration keys and values here. Format for the file entry: {"<key1>":"<value1>","<key2>":"<value2>"}
help:      -r, --shard-count <shard-count>                          Number of Shards to create on a Premium Cluster Cache
help:      -v, --virtual-network <virtual-network>                  The exact ARM resource ID of the virtual network to deploy the Azure Cache for Redis in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
help:      -t, --subnet <subnet>                                    Required when deploying an Azure Cache for Redis inside an existing Azure Virtual Network
help:      -p, --static-ip <static-ip>                              Required when deploying an Azure Cache for Redis inside an existing Azure Virtual Network
help:      -s, --subscription <id>                                  the subscription identifier
help:
help:    Current Mode: arm (Azure Resource Management)

Var olan bir Redis için Azure Cache silme

bir Redis için Azure Cache silmek için aşağıdaki komutu kullanın:

    azure rediscache delete [--name <name> --resource-group <resource-group> ]

Bu komut hakkında daha fazla bilgi için komutunu çalıştırın azure rediscache delete -h .

C:\>azure rediscache delete -h
help:    Delete an existing Azure Cache for Redis
help:
help:    Usage: rediscache delete [--name <name> --resource-group <resource-group> ]
help:
help:    Options:
help:      -h, --help                             output usage information
help:      -v, --verbose                          use verbose output
help:      -vv                                    more verbose with debug output
help:      --json                                 use json output
help:      -n, --name <name>                      Name of the Azure Cache for Redis.
help:      -g, --resource-group <resource-group>  Name of the Resource Group under which the cache exists
help:      -s, --subscription <subscription>      the subscription identifier
help:
help:    Current Mode: arm (Azure Resource Management)

Aboneliğinizdeki veya Kaynak Grubunuzdaki tüm Redis için Azure Cache listeleme

Aboneliğiniz veya Kaynak Grubunuzdaki tüm Redis için Azure Cache listelemek için aşağıdaki komutu kullanın:

    azure rediscache list [options]

Bu komut hakkında daha fazla bilgi için komutunu çalıştırın azure rediscache list -h .

C:\>azure rediscache list -h
help:    List all Azure Cache for Redis within your Subscription or Resource Group
help:
help:    Usage: rediscache list [options]
help:
help:    Options:
help:      -h, --help                             output usage information
help:      -v, --verbose                          use verbose output
help:      -vv                                    more verbose with debug output
help:      --json                                 use json output
help:      -g, --resource-group <resource-group>  Name of the Resource Group
help:      -s, --subscription <subscription>      the subscription identifier
help:
help:    Current Mode: arm (Azure Resource Management)

Mevcut bir Redis için Azure Cache özelliklerini gösterme

Mevcut bir Redis için Azure Cache özelliklerini göstermek için aşağıdaki komutu kullanın:

    azure rediscache show [--name <name> --resource-group <resource-group>]

Bu komut hakkında daha fazla bilgi için komutunu çalıştırın azure rediscache show -h .

C:\>azure rediscache show -h
help:    Show properties of an existing Azure Cache for Redis
help:
help:    Usage: rediscache show [--name <name> --resource-group <resource-group>]
help:
help:    Options:
help:      -h, --help                             output usage information
help:      -v, --verbose                          use verbose output
help:      -vv                                    more verbose with debug output
help:      --json                                 use json output
help:      -n, --name <name>                      Name of the Azure Cache for Redis.
help:      -g, --resource-group <resource-group>  Name of the Resource Group
help:      -s, --subscription <subscription>      the subscription identifier
help:
help:    Current Mode: arm (Azure Resource Management)

Mevcut bir Redis için Azure Cache ayarlarını değiştirme

Mevcut bir Redis için Azure Cache ayarlarını değiştirmek için aşağıdaki komutu kullanın:

    azure rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>]

Bu komut hakkında daha fazla bilgi için komutunu çalıştırın azure rediscache set -h .

C:\>azure rediscache set -h
help:    Change settings of an existing Azure Cache for Redis
help:
help:    Usage: rediscache set [--name <name> --resource-group <resource-group> --redis-configuration <redis-configuration>/--redis-configuration-file <redisConfigurationFile>]
help:
help:    Options:
help:      -h, --help                                               output usage information
help:      -v, --verbose                                            use verbose output
help:      -vv                                                      more verbose with debug output
help:      --json                                                   use json output
help:      -n, --name <name>                                        Name of the Azure Cache for Redis.
help:      -g, --resource-group <resource-group>                    Name of the Resource Group
help:      -c, --redis-configuration <redis-configuration>          Redis Configuration. Enter a JSON formatted string of configuration keys and values here.
help:      -f, --redis-configuration-file <redisConfigurationFile>  Redis Configuration. Enter the path of a file containing configuration keys and values here.
help:      -s, --subscription <subscription>                        the subscription identifier
help:
help:    Current Mode: arm (Azure Resource Management)

Mevcut bir Redis için Azure Cache için kimlik doğrulama anahtarını yenileme

Mevcut bir Redis için Azure Cache kimlik doğrulama anahtarını yenilemek için aşağıdaki komutu kullanın:

    azure rediscache renew-key [--name <name> --resource-group <resource-group> --key-type <key-type>]

veya Secondary değerini key-typebelirtinPrimary.

Bu komut hakkında daha fazla bilgi için komutunu çalıştırın azure rediscache renew-key -h .

C:\>azure rediscache renew-key -h
help:    Renew the authentication key for an existing Azure Cache for Redis
help:
help:    Usage: rediscache renew-key [--name <name> --resource-group <resource-group> ]
help:
help:    Options:
help:      -h, --help                             output usage information
help:      -v, --verbose                          use verbose output
help:      -vv                                    more verbose with debug output
help:      --json                                 use json output
help:      -n, --name <name>                      Name of the Azure Cache for Redis.
help:      -g, --resource-group <resource-group>  Name of the Resource Group under which cache exists
help:      -t, --key-type <key-type>              type of key to renew. Valid values are: 'Primary', 'Secondary'.
help:      -s, --subscription <subscription>      the subscription identifier
help:
help:    Current Mode: arm (Azure Resource Management)

Mevcut bir Redis için Azure Cache Birincil ve İkincil anahtarlarını listeleme

Mevcut bir Redis için Azure Cache Birincil ve İkincil anahtarlarını listelemek için aşağıdaki komutu kullanın:

    azure rediscache list-keys [--name <name> --resource-group <resource-group>]

Bu komut hakkında daha fazla bilgi için komutunu çalıştırın azure rediscache list-keys -h .

C:\>azure rediscache list-keys -h
help:    Lists Primary and Secondary key of an existing Azure Cache for Redis
help:
help:    Usage: rediscache list-keys [--name <name> --resource-group <resource-group>]
help:
help:    Options:
help:      -h, --help                             output usage information
help:      -v, --verbose                          use verbose output
help:      -vv                                    more verbose with debug output
help:      --json                                 use json output
help:      -n, --name <name>                      Name of the Azure Cache for Redis.
help:      -g, --resource-group <resource-group>  Name of the Resource Group under which Cache exists
help:      -s, --subscription <subscription>      the subscription identifier
help:
help:    Current Mode: arm (Azure Resource Management)