Azure Cache voor Redis maken en beheren met de klassieke Azure CLI

De klassieke Azure CLI is een uitstekende manier om uw Azure-infrastructuur vanaf elk platform te beheren. In dit artikel wordt beschreven hoe u uw Azure Cache voor Redis-exemplaren maakt en beheert met behulp van de klassieke Azure CLI.

Belangrijk

Dit artikel bevat inhoud waarvoor u de klassieke Azure CLI nodig hebt. Dit is een oudere versie van de Azure CLI die alleen mag worden gebruikt met het klassieke Azure-implementatiemodel.

Als u de klassieke CLI wilt installeren, raadpleegt u De klassieke Azure CLI installeren en zie Azure CLI installeren om de huidige Azure CLI voor Azure Resource Manager-implementaties te installeren.

Vereisten

Als u Azure Cache voor Redis-exemplaren wilt maken en beheren met de klassieke Azure CLI, moet u de volgende stappen uitvoeren.

Eigenschappen van Azure Cache voor Redis

De volgende eigenschappen worden gebruikt bij het maken en bijwerken van Azure Cache voor Redis exemplaren.

Eigenschap Switch Beschrijving
naam -n, --name Naam van de Azure Cache voor Redis.
resourcegroep -g, --resource-group Naam van de resourcegroep.
location -l, --location Locatie voor het maken van de cache.
grootte -z, --size Grootte van de Azure Cache voor Redis. Geldige waarden: [C0, C1, C2, C3, C4, C5, C6, P1, P2, P3, P4]
sku -x, --sku Redis-SKU. Moet een van de volgende opties zijn: [Basic, Standard, Premium]
EnableNonSslPort -e, --enable-non-ssl-port De eigenschap EnableNonSslPort van de Azure Cache voor Redis. Voeg deze vlag toe als u de niet-TLS/SSL-poort voor uw cache wilt inschakelen
Redis-configuratie -c, --redis-configuration Redis-configuratie. Voer hier een met JSON opgemaakte tekenreeks met configuratiesleutels en -waarden in. Indeling:"{"":"","":""}"
Redis-configuratie -f, --redis-configuration-file Redis-configuratie. Voer hier het pad in van een bestand met configuratiesleutels en -waarden. Indeling voor de bestandsindeling: {"":","":""}
Aantal shards -r, --shard-count Het aantal Shards dat moet worden gemaakt in een Premium-clustercache met clustering.
Virtual Network -v, --virtual-network Bij het hosten van uw cache in een VNET geeft u de exacte Resource Manager resource-id van het virtuele netwerk op om de Azure Cache voor Redis in te implementeren. Voorbeeldindeling: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
sleuteltype -t, --key-type Type sleutel dat moet worden vernieuwd. Geldige waarden: [Primair, Secundair]
StaticIP -p, --static-ip <static-ip> Bij het hosten van uw cache in een VNET, geeft u een uniek IP-adres op in het subnet voor de cache. Als dit niet wordt opgegeven, wordt er een voor u gekozen in het subnet.
Subnet t, --subnetsubnet <> Bij het hosten van uw cache in een VNET, geeft u de naam op van het subnet waarin de cache moet worden geïmplementeerd.
VirtualNetwork -v, --virtual-network <virtual-network> Bij het hosten van uw cache in een VNET geeft u de exacte Resource Manager resource-id van het virtuele netwerk op om de Azure Cache voor Redis in te implementeren. Voorbeeldindeling: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1
Abonnement -s, --subscription De abonnements-id.

Alle Azure Cache voor Redis opdrachten weergeven

Als u alle Azure Cache voor Redis opdrachten en de bijbehorende parameters wilt zien, gebruikt u de azure rediscache -h opdracht .

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)

Een Azure Cache voor Redis-instantie maken

Gebruik de volgende opdracht om een Azure Cache voor Redis te maken:

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

Voer de azure rediscache create -h opdracht uit voor meer informatie over deze opdracht.

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)

Een bestaande Azure Cache voor Redis verwijderen

Gebruik de volgende opdracht om een Azure Cache voor Redis te verwijderen:

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

Voer de azure rediscache delete -h opdracht uit voor meer informatie over deze opdracht.

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)

Alle Azure Cache voor Redis binnen uw abonnement of resourcegroep weergeven

Gebruik de volgende opdracht om alle Azure Cache voor Redis in uw abonnement of resourcegroep weer te geven:

    azure rediscache list [options]

Voer de azure rediscache list -h opdracht uit voor meer informatie over deze opdracht.

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)

Eigenschappen van een bestaande Azure Cache voor Redis weergeven

Gebruik de volgende opdracht om eigenschappen van een bestaande Azure Cache voor Redis weer te geven:

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

Voer de azure rediscache show -h opdracht uit voor meer informatie over deze opdracht.

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)

Instellingen van een bestaande Azure Cache voor Redis wijzigen

Als u de instellingen van een bestaande Azure Cache voor Redis wilt wijzigen, gebruikt u de volgende opdracht:

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

Voer de azure rediscache set -h opdracht uit voor meer informatie over deze opdracht.

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)

De verificatiesleutel vernieuwen voor een bestaande Azure Cache voor Redis

Gebruik de volgende opdracht om de verificatiesleutel voor een bestaande Azure Cache voor Redis te vernieuwen:

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

Geef Primary of Secondary op voor key-type.

Voer de azure rediscache renew-key -h opdracht uit voor meer informatie over deze opdracht.

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)

Primaire en secundaire sleutels van een bestaande Azure Cache voor Redis

Gebruik de volgende opdracht om de primaire en secundaire sleutels van een bestaande Azure Cache voor Redis weer te geven:

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

Voer de azure rediscache list-keys -h opdracht uit voor meer informatie over deze opdracht.

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)