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
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/virtualNetworks/vnet2/subnets/subnet2"})
This command update all properties of NetworkRule, input Rules with JSON.
Example 2: Update Bypass property of NetworkRule
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
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultAction
Cognitive Services Account NetworkRule DefaultAction. Default value Deny
.
Type: | PSNetWorkRuleDefaultActionEnum |
Accepted values: | Deny, Allow |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IpRule
Cognitive Services Account NetworkRule IpRules.
Type: | PSIpRule[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Cognitive Services Account Name.
Type: | String |
Aliases: | CognitiveServicesAccountName, AccountName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
Resource Group Name.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VirtualNetworkRule
Cognitive Services Account NetworkRule VirtualNetworkRules.
Type: | PSVirtualNetworkRule[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
PSIpRule[]