Dela via


Update-AzCognitiveServicesAccountNetworkRuleSet

Uppdatera egenskapen NetworkRule för ett Cognitive Services-konto

Syntax

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

Description

Cmdleten Update-AzCognitiveServicesAccountNetworkRuleSet uppdaterar egenskapen NetworkRule för ett Cognitive Services-konto

Exempel

Exempel 1: Uppdatera alla egenskaper för NetworkRule, indataregler med 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"})

Det här kommandot uppdaterar alla egenskaper för NetworkRule, indataregler med JSON.

Exempel 2: Uppdatera förbikopplingsegenskapen för NetworkRule

Update-AzCognitiveServicesAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "myaccount"

Den här kommandouppdateringen kringgår egenskapen för NetworkRule (andra egenskaper ändras inte).

Exempel 3: Rensa regler för NetworkRule för ett Cognitive Services-konto

Update-AzCognitiveServicesAccountNetworkRuleSet -ResourceGroupName "myResourceGroup" -Name "myaccount" -IpRule @() -VirtualNetworkRule @()

Det här kommandot rensar reglerna för NetworkRule för ett Cognitive Services-konto (andra egenskaper ändras inte).

Parametrar

-Confirm

Uppmanar dig att bekräfta innan du kör cmdleten.

Typ:SwitchParameter
Aliases:cf
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultAction

Cognitive Services-kontot NetworkRule DefaultAction. Standardvärde Deny.

Typ:PSNetWorkRuleDefaultActionEnum
accepterade värden:Deny, Allow
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.

Typ:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

-IpRule

Cognitive Services-kontot NetworkRule IpRules.

Typ:PSIpRule[]
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

Cognitive Services-kontonamn.

Typ:String
Aliases:CognitiveServicesAccountName, AccountName
Position:1
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Namnet på resursgruppen.

Typ:String
Position:0
standardvärde:None
Obligatorisk:True
Accept pipeline input:True
Accept wildcard characters:False

-VirtualNetworkRule

Cognitive Services-kontot NetworkRule VirtualNetworkRules.

Typ:PSVirtualNetworkRule[]
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Visar vad som skulle hända om cmdleten kördes. Cmdleten körs inte.

Typ:SwitchParameter
Aliases:wi
Position:Named
standardvärde:None
Obligatorisk:False
Accept pipeline input:False
Accept wildcard characters:False

Indata

String

PSIpRule[]

PSVirtualNetworkRule[]

Utdata

PSNetworkRuleSet