az cognitiveservices account network-rule

Manage network rules.

Commands

az cognitiveservices account network-rule add

Add a network rule.

az cognitiveservices account network-rule list

List network rules.

az cognitiveservices account network-rule remove

Remove a network rule.

az cognitiveservices account network-rule add

Add a network rule.

Rules can be created for an IPv4 address, address range (CIDR format), or a virtual network subnet.

az cognitiveservices account network-rule add --name
                                              --resource-group
                                              [--ip-address]
                                              [--subnet]
                                              [--subscription]
                                              [--vnet-name]

Examples

Create a rule to allow a specific address-range.

az cognitiveservices account network-rule add -g myRg --name MyAccount --ip-address 23.45.1.0/24

Create a rule to allow access for a subnet.

az cognitiveservices account network-rule add -g myRg --name MyAccount --vnet myvnet --subnet mysubnet

Required Parameters

--name -n

Cognitive service account name.

--resource-group -g

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

Optional Parameters

--ip-address

IPv4 address or CIDR range.

--subnet

Name or ID of subnet. If name is supplied, --vnet-name must be supplied.

--subscription

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

--vnet-name

Name of a virtual network.

az cognitiveservices account network-rule list

List network rules.

az cognitiveservices account network-rule list --name
                                               --resource-group
                                               [--query-examples]
                                               [--subscription]

Examples

List network rules.

az cognitiveservices account network-rule list --name MyAccount --resource-group MyResourceGroup

Required Parameters

--name -n

Cognitive service account name.

--resource-group -g

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

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.

--subscription

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

az cognitiveservices account network-rule remove

Remove a network rule.

az cognitiveservices account network-rule remove --name
                                                 --resource-group
                                                 [--ip-address]
                                                 [--subnet]
                                                 [--subscription]
                                                 [--vnet-name]

Examples

Remove a network rule.

az cognitiveservices account network-rule remove --name MyAccount --resource-group MyResourceGroup --subnet mysubnet

Remove a network rule.

az cognitiveservices account network-rule remove --name MyAccount --ip-address 23.45.1.0/24 --resource-group MyResourceGroup

Required Parameters

--name -n

Cognitive service account name.

--resource-group -g

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

Optional Parameters

--ip-address

IPv4 address or CIDR range.

--subnet

Name or ID of subnet. If name is supplied, --vnet-name must be supplied.

--subscription

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

--vnet-name

Name of a virtual network.