Set-AzEventHubNetworkRuleSet
Update the NetworkruleSet of the given Namespace in the current Azure subscription.
语法
NetworkRuleSetPropertiesSet (默认值)
Set-AzEventHubNetworkRuleSet
[-ResourceGroupName] <String>
[-Name] <String>
[-IPRule] <PSNWRuleSetIpRulesAttributes[]>
[-VirtualNetworkRule] <PSNWRuleSetVirtualNetworkRulesAttributes[]>
[-DefaultAction <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
NetwrokruleSetInputObjectSet
Set-AzEventHubNetworkRuleSet
[-ResourceGroupName] <String>
[-Name] <String>
[-InputObject] <PSNetworkRuleSetAttributes>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
NetworkRuleSetResourceIdParameterSet
Set-AzEventHubNetworkRuleSet
[-ResourceGroupName] <String>
[-Name] <String>
[-ResourceId] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Update the NetworkruleSet of the given Namespace in the current Azure subscription.
示例
Example 1
PS C:\> $IpRules = @([Microsoft.Azure.Commands.EventHub.Models.PSNWRuleSetIpRulesAttributes] @{IpMask = "4.4.4.4";Action = "Allow"},[Microsoft.Azure.Commands.EventHub.Models.PSNWRuleSetIpRulesAttributes] @{IpMask = "3.3.3.3";Action = "Allow"})
PS C:\> $VirtualNetworkRules = @([Microsoft.Azure.Commands.EventHub.Models.PSNWRuleSetVirtualNetworkRulesAttributes]@{Subnet=@{Id="/subscriptions/subscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/default"};IgnoreMissingVnetServiceEndpoint=$True})
PS C:\> Set-AzEventHubNetworkRuleSet -ResourceGroupName v-ajnavtest -Namespace EventHub-Namespace1-1375 -IPRule $IpRules -VirtualNetworkRule $VirtualNetworkRules -DefaultAction "Allow" -Debug
Name : default DefaultAction : Allow Id : /subscriptions/subscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.EventHub/namespaces/EventHub-Namespace-1122/networkRuleSets/default Type : Microsoft.EventHub/Namespaces/NetworkRuleSet IpRules : {4.4.4.4, Allow, 3.3.3.3, Allow} VirtualNetworkRules : {/subscriptions/subscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/default, True}
Update the NetworkRuleSet using -IPRule and -VirtualNetworkRule parameters
Example 2
PS C:\> $getresult = Get-AzEventHubNetworkRuleSet -ResourceGroupName v-ajnavtest -Namespace Eventhub-Namespace1-1375
PS C:\> Set-AzEventHubNetworkRuleSet -ResourceGroupName v-ajnavtest -Namespace Eventhub-Namespace1-1375 -InputObject $getresult
Name : default DefaultAction : Allow Id : /subscriptions/subscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.EventHub/namespaces/EventHub-Namespace-1122/networkRuleSets/default Type : Microsoft.EventHub/Namespaces/NetworkRuleSet IpRules : {4.4.4.4, Allow, 3.3.3.3, Allow} VirtualNetworkRules : {/subscriptions/subscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/default, True}
Update the NetworkRuleSet using -InputObject
Example 3
PS C:\> Set-AzEventHubNetworkRuleSet -ResourceGroupName v-ajnavtest -Namespace Eventhub-Namespace1-1375 -ResourceId /subscriptions/SubscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.EventHub/namespaces/Eventhub-Namespace1-1375
Name : default DefaultAction : Allow Id : /subscriptions/subscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.EventHub/namespaces/EventHub-Namespace-1122/networkRuleSets/default Type : Microsoft.EventHub/Namespaces/NetworkRuleSet IpRules : {4.4.4.4, Allow, 3.3.3.3, Allow} VirtualNetworkRules : {/subscriptions/subscriptionId/resourcegroups/ResourceGroup/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/default, True}
Update the NetworkRuleSet using -ResourceId of the other namespace.
参数
-Confirm
Prompts you for confirmation before running the cmdlet.
参数属性
类型: | SwitchParameter |
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | cf |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-DefaultAction
Default Action for NetworkRuleSet
参数属性
类型: | String |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
NetworkRuleSetPropertiesSet
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
参数属性
类型: | IAzureContextContainer |
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | AzContext, AzureRmContext, AzureCredential |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-InputObject
NetworkruleSet Configuration Object
参数属性
类型: | Microsoft.Azure.Commands.EventHub.Models.PSNetworkRuleSetAttributes |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
NetwrokruleSetInputObjectSet
Position: | 2 |
必需: | True |
来自管道的值: | True |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-IPRule
List of IPRuleSet
参数属性
类型: | Microsoft.Azure.Commands.EventHub.Models.PSNWRuleSetIpRulesAttributes[] |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
NetworkRuleSetPropertiesSet
Position: | 2 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Name
EventHub Namespace Name.
参数属性
类型: | String |
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | NamespaceName |
参数集
(All)
Position: | 1 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ResourceGroupName
Resource Group Name.
参数属性
类型: | String |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | 0 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ResourceId
Resource ID of Namespace
参数属性
类型: | String |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
NetworkRuleSetResourceIdParameterSet
Position: | 2 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-VirtualNetworkRule
List of VirtualNetworkRules
参数属性
类型: | Microsoft.Azure.Commands.EventHub.Models.PSNWRuleSetVirtualNetworkRulesAttributes[] |
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | VirtualNteworkRule |
参数集
NetworkRuleSetPropertiesSet
Position: | 3 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
参数属性
类型: | SwitchParameter |
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | wi |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.