Update-AzCognitiveServicesAccountNetworkRuleSet

Update the NetworkRule property of a Cognitive Services account

Syntax

Update-AzCognitiveServicesAccountNetworkRuleSet
      [-ResourceGroupName] <String>
      [-Name] <String>
      [-DefaultAction <PSNetWorkRuleDefaultActionEnum>]
      [-IpRule <PSIpRule[]>]
      [-VirtualNetworkRule <PSVirtualNetworkRule[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzCognitiveServicesAccountNetworkRuleSet cmdlet updates the NetworkRule property of a Cognitive Services account

Examples

Example 1: Update all properties of NetworkRule, input Rules with JSON

PS C:\> Update-AzCognitiveServicesAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "myaccount" -DefaultAction Allow -IpRule (@{IpAddressOrRange="200.0.0.0/24"},@{IpAddressOrRange="28.2.0.0/16"})
    -VirtualNetworkRule (@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"},@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualN
    etworks/vnet2/subnets/subnet2"})

This command update all properties of NetworkRule, input Rules with JSON.

Example 2: Update Bypass property of NetworkRule

PS C:\> Update-AzCognitiveServicesAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "myaccount"

This command update Bypass property of NetworkRule (other properties won't change).

Example 3: Clean up rules of NetworkRule of a Cognitive Services account

PS C:\> Update-AzCognitiveServicesAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "myaccount" -IpRule @() -VirtualNetworkRule @()

This command clean up rules of NetworkRule of a Cognitive Services account (other properties not change).

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultAction

Cognitive Services Account NetworkRule DefaultAction.

Type:Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSNetWorkRuleDefaultActionEnum
Accepted values:Deny, Allow
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IpRule

Cognitive Services Account NetworkRule IpRules.

Type:Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSIpRule[]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Cognitive Services Account Name.

Type:String
Aliases:CognitiveServicesAccountName, AccountName
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Resource Group Name.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VirtualNetworkRule

Cognitive Services Account NetworkRule VirtualNetworkRules.

Type:Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSVirtualNetworkRule[]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSIpRule[]

Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSVirtualNetworkRule[]

Outputs

Microsoft.Azure.Commands.Management.CognitiveServices.Models.PSNetworkRuleSet