Skip to content

Fixed network rule set typos across ServiceBus module #17965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,27 @@ function NetworkRuleSetTests {
$createdNamespace2 = Get-AzServiceBusNamespace -ResourceGroup $resourceGroupName -Name $namespaceName2
Assert-AreEqual $createdNamespace2.Name $namespaceName2 "Namespace created earlier is not found."

Write-Debug "Add a new IPRule to the default NetwrokRuleSet"
Write-Debug "Add a new IPRule to the default NetworkRuleSet"
$result = Add-AzServiceBusIPRule -ResourceGroup $resourceGroupName -Name $namespaceName -IpMask "1.1.1.1" -Action "Allow"

Write-Debug "Add a new IPRule to the default NetwrokRuleSet"
Write-Debug "Add a new IPRule to the default NetworkRuleSet"
$result = Add-AzServiceBusIPRule -ResourceGroup $resourceGroupName -Name $namespaceName -IpMask "2.2.2.2" -Action "Allow"

Write-Debug "Add a new IPRule to the default NetwrokRuleSet"
Write-Debug "Add a new IPRule to the default NetworkRuleSet"
$result = Add-AzServiceBusIPRule -ResourceGroup $resourceGroupName -Name $namespaceName -IpMask "3.3.3.3"

Write-Debug "Add a new VirtualNetworkRule to the default NetwrokRuleSet"
Write-Debug "Add a new VirtualNetworkRule to the default NetworkRuleSet"
$result = Add-AzServiceBusVirtualNetworkRule -ResourceGroup $resourceGroupName -Name $namespaceName -SubnetId "/subscriptions/326100e2-f69d-4268-8503-075374f62b6e/resourcegroups/v-ajnavtest/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/default"
$result = Add-AzServiceBusVirtualNetworkRule -ResourceGroup $resourceGroupName -Name $namespaceName -SubnetId "/subscriptions/326100e2-f69d-4268-8503-075374f62b6e/resourcegroups/v-ajnavtest/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/sbdefault"
$result = Add-AzServiceBusVirtualNetworkRule -ResourceGroup $resourceGroupName -Name $namespaceName -SubnetId "/subscriptions/326100e2-f69d-4268-8503-075374f62b6e/resourcegroups/v-ajnavtest/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/sbdefault01"

Write-Debug "Get NetwrokRuleSet"
Write-Debug "Get NetworkRuleSet"
$getResult1 = Get-AzServiceBusNetworkRuleSet -ResourceGroup $resourceGroupName -Name $namespaceName

Assert-AreEqual $getResult1.VirtualNetworkRules.Count 3 "VirtualNetworkRules count did not matched"
Assert-AreEqual $getResult1.IpRules.Count 3 "IPRules count did not matched"

Write-Debug "Remove a new IPRule to the default NetwrokRuleSet"
Write-Debug "Remove a new IPRule to the default NetworkRuleSet"
$result = Remove-AzServiceBusIPRule -ResourceGroup $resourceGroupName -Name $namespaceName -IpMask "3.3.3.3"

$getResult = Get-AzServiceBusNetworkRuleSet -ResourceGroup $resourceGroupName -Name $namespaceName
Expand Down Expand Up @@ -106,10 +106,10 @@ function NetworkRuleSetTests {
Assert-AreEqual $setResult1.DefaultAction "Allow"


Write-Debug "Add a new VirtualNetworkRule to the default NetwrokRuleSet"
Write-Debug "Add a new VirtualNetworkRule to the default NetworkRuleSet"
$result = Remove-AzServiceBusVirtualNetworkRule -ResourceGroup $resourceGroupName -Name $namespaceName -SubnetId "/subscriptions/326100e2-f69d-4268-8503-075374f62b6e/resourcegroups/v-ajnavtest/providers/Microsoft.Network/virtualNetworks/sbehvnettest1/subnets/default"

Write-Debug "Delete NetwrokRuleSet"
Write-Debug "Delete NetworkRuleSet"
$result = Remove-AzServiceBusNetworkRuleSet -ResourceGroup $resourceGroupName -Name $namespaceName

Write-Debug " Delete namespaces"
Expand Down
1 change: 1 addition & 0 deletions src/ServiceBus/ServiceBus/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed miscellaneous network rule set typos across module.

## Version 1.8.1
* Fixed that `New-AzServiceBusAuthorizationRuleSASToken` returns invalid token. [#12975]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public abstract class AzureServiceBusCmdletBase : AzureRMCmdlet
protected const string AuthoRuleInputObjectParameterSet = "AuthoRuleInputObjectSet";
protected const string GeoDRInputObjectParameterSet = "GeoDRConfigurationInputObjectSet";
protected const string RuleInputObjectParameterSet = "RuleResourceIdSet";
protected const string NetwrokruleSetInputObjectParameterSet = "NetwrokruleSetInputObjectSet";
protected const string NetworkRuleSetInputObjectParameterSet = "NetworkRuleSetInputObjectSet";
protected const string VirtualNetworkRuleInputObjectParameterSet = "VirtualNetworkRuleInputObjectParameterSet";
protected const string IPRuleInputObjectParameterSet = "IPRuleInputObjectParameterSet";

Expand All @@ -100,8 +100,8 @@ public abstract class AzureServiceBusCmdletBase : AzureRMCmdlet
protected const string MigrationConfigurationParameterSet = "MigrationConfigurationPropertiesSet";
protected const string RuleResourceParameterSet = "RulePropertiesSet";
protected const string RuleResourceActionParameterSet = "RuleActionPropertiesSet";
protected const string NetwrokruleSetPropertiesParameterSet = "NetworkRuleSetPropertiesSet";
protected const string NetwrokruleSetNamespacePropertiesParameterSet = "NetworkRuleSetNamespacePropertiesSet";
protected const string NetworkRuleSetPropertiesParameterSet = "NetworkRuleSetPropertiesSet";
protected const string NetworkRuleSetNamespacePropertiesParameterSet = "NetworkRuleSetNamespacePropertiesSet";
protected const string VirtualNetworkRulePropertiesParameterSet = "VirtualNetworkRulePropertiesParameterSet";
protected const string IPRulePropertiesParameterSet = "IPRulePropertiesParameterSet";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ namespace Microsoft.Azure.Commands.ServiceBus.Commands.NetworkruleSet
/// <para> If EventHub name provided, a single EventHub detials will be returned</para>
/// <para> If EventHub name not provided, list of EventHub will be returned</para>
/// </summary>
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ServiceBusNetworkRuleSet", DefaultParameterSetName = NetwrokruleSetPropertiesParameterSet), OutputType(typeof(PSNetworkRuleSetAttributes))]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ServiceBusNetworkRuleSet", DefaultParameterSetName = NetworkRuleSetPropertiesParameterSet), OutputType(typeof(PSNetworkRuleSetAttributes))]
public class GetAzureServiceBusNetworkRuleSet : AzureServiceBusCmdletBase
{
[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 0, HelpMessage = "Resource Group Name")]
[Parameter(Mandatory = false, ParameterSetName = NetwrokruleSetNamespacePropertiesParameterSet, HelpMessage = "Resource Group Name")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 0, HelpMessage = "Resource Group Name")]
[Parameter(Mandatory = false, ParameterSetName = NetworkRuleSetNamespacePropertiesParameterSet, HelpMessage = "Resource Group Name")]
public string ResourceGroupName { get; set; }

[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 1, HelpMessage = "Namespace Name")]
[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetNamespacePropertiesParameterSet, Position = 0, HelpMessage = "Namespace Name")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 1, HelpMessage = "Namespace Name")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetNamespacePropertiesParameterSet, Position = 0, HelpMessage = "Namespace Name")]
[ValidateNotNullOrEmpty]
[Alias(AliasNamespaceName)]
public string Namespace { get; set; }
Expand All @@ -57,27 +57,27 @@ public override void ExecuteCmdlet()
ResourceGroupName = identifier.ResourceGroupName;
Namespace = identifier.ResourceName;

PSNetworkRuleSetAttributes netwrokruleSet = Client.GetNetworkRuleSet(ResourceGroupName, Namespace);
WriteObject(netwrokruleSet);
PSNetworkRuleSetAttributes networkruleSet = Client.GetNetworkRuleSet(ResourceGroupName, Namespace);
WriteObject(networkruleSet);
}

if (ParameterSetName.Equals(NetwrokruleSetPropertiesParameterSet))
if (ParameterSetName.Equals(NetworkRuleSetPropertiesParameterSet))
{
// Get a VNet Rule
PSNetworkRuleSetAttributes netwrokruleSet = Client.GetNetworkRuleSet(ResourceGroupName, Namespace);
WriteObject(netwrokruleSet);
PSNetworkRuleSetAttributes networkruleSet = Client.GetNetworkRuleSet(ResourceGroupName, Namespace);
WriteObject(networkruleSet);
}

// only Namespacename provided
if (ParameterSetName.Equals(NetwrokruleSetNamespacePropertiesParameterSet))
if (ParameterSetName.Equals(NetworkRuleSetNamespacePropertiesParameterSet))
{
var namespaceNames = Client.ListAllNamespaces();
IEnumerable<string> ResourceGrouplst = from nsName in namespaceNames
where nsName.Name == Namespace
select nsName.ResourceGroup;

PSNetworkRuleSetAttributes netwrokruleSet = Client.GetNetworkRuleSet(ResourceGrouplst.FirstOrDefault(), Namespace);
WriteObject(netwrokruleSet);
PSNetworkRuleSetAttributes networkruleSet = Client.GetNetworkRuleSet(ResourceGrouplst.FirstOrDefault(), Namespace);
WriteObject(networkruleSet);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ namespace Microsoft.Azure.Commands.ServiceBus.Commands.NetworkruleSet
/// <summary>
/// 'Remove-AzureRmEventHub' Cmdlet removes the specified EventHub
/// </summary>
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ServiceBusNetworkRuleSet", DefaultParameterSetName = NetwrokruleSetPropertiesParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ServiceBusNetworkRuleSet", DefaultParameterSetName = NetworkRuleSetPropertiesParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))]
public class RemoveAzureServiceBusNetworkRuleSet : AzureServiceBusCmdletBase
{
[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 0, HelpMessage = "Resource Group Name")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 0, HelpMessage = "Resource Group Name")]
[ResourceGroupCompleter]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { get; set; }

[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 1, HelpMessage = "Namespace Name")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 1, HelpMessage = "Namespace Name")]
[ValidateNotNullOrEmpty]
[Alias(AliasNamespaceName)]
public string Name { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,43 @@ namespace Microsoft.Azure.Commands.ServiceBus.Commands.NetworkruleSet
/// <summary>
/// 'Set-AzEventHubNamespace' Cmdlet updates the specified Eventhub Namespace
/// </summary>
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ServiceBusNetworkRuleSet", SupportsShouldProcess = true, DefaultParameterSetName = NetwrokruleSetPropertiesParameterSet), OutputType(typeof(PSNetworkRuleSetAttributes))]
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ServiceBusNetworkRuleSet", SupportsShouldProcess = true, DefaultParameterSetName = NetworkRuleSetPropertiesParameterSet), OutputType(typeof(PSNetworkRuleSetAttributes))]
public class SetAzureServiceBusNetworkrule : AzureServiceBusCmdletBase
{
[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetInputObjectParameterSet, Position = 0, HelpMessage = "Resource Group Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 0, HelpMessage = "Resource Group Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetInputObjectParameterSet, Position = 0, HelpMessage = "Resource Group Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 0, HelpMessage = "Resource Group Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetResourceIdParameterSet, Position = 0, HelpMessage = "Resource Group Name.")]
[ResourceGroupCompleter]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { get; set; }

[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetInputObjectParameterSet, Position = 1, HelpMessage = "ServiceBus Namespace Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 1, HelpMessage = "ServiceBus Namespace Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetInputObjectParameterSet, Position = 1, HelpMessage = "ServiceBus Namespace Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 1, HelpMessage = "ServiceBus Namespace Name.")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetResourceIdParameterSet, Position = 1, HelpMessage = "ServiceBus Namespace Name.")]
[ValidateNotNullOrEmpty]
[Alias(AliasNamespaceName)]
public string Name { get; set; }

[Parameter(Mandatory = false, ParameterSetName = NetwrokruleSetPropertiesParameterSet, HelpMessage = "Default Action for NetwrokeuleSet")]
[Parameter(Mandatory = false, ParameterSetName = NetworkRuleSetPropertiesParameterSet, HelpMessage = "Default Action for NetwrokeuleSet")]
[PSArgumentCompleter("Allow", "Deny")]
[PSDefaultValue(Value ="Deny")]
public string DefaultAction { get; set; }

[Parameter(Mandatory = false, ParameterSetName = NetwrokruleSetPropertiesParameterSet, HelpMessage = "Public Network Access for NetwrokeuleSet")]
[Parameter(Mandatory = false, ParameterSetName = NetworkRuleSetPropertiesParameterSet, HelpMessage = "Public Network Access for NetwrokeuleSet")]
[PSArgumentCompleter("Enabled", "Disabled")]
[PSDefaultValue(Value = "Enabled")]
public string PublicNetworkAccess { get; set; }

[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 2, HelpMessage = "List of IPRuleSet")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 2, HelpMessage = "List of IPRuleSet")]
[ValidateNotNullOrEmpty]
public PSNWRuleSetIpRulesAttributes[] IPRule { get; set; }

[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetPropertiesParameterSet, Position = 3, HelpMessage = "List of VirtualNetworkRules")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetPropertiesParameterSet, Position = 3, HelpMessage = "List of VirtualNetworkRules")]
[ValidateNotNullOrEmpty]
[Alias(AliasVirtualNetworkRule)]
public PSNWRuleSetVirtualNetworkRulesAttributes[] VirtualNetworkRule { get; set; }

[Parameter(Mandatory = true, ParameterSetName = NetwrokruleSetInputObjectParameterSet, ValueFromPipeline = true, Position = 2, HelpMessage = "NetworkruleSet Configuration Object")]
[Parameter(Mandatory = true, ParameterSetName = NetworkRuleSetInputObjectParameterSet, ValueFromPipeline = true, Position = 2, HelpMessage = "NetworkruleSet Configuration Object")]
[ValidateNotNullOrEmpty]
public PSNetworkRuleSetAttributes InputObject { get; set; }

Expand All @@ -76,7 +76,7 @@ public override void ExecuteCmdlet()
try
{

if (ParameterSetName.Equals(NetwrokruleSetPropertiesParameterSet))
if (ParameterSetName.Equals(NetworkRuleSetPropertiesParameterSet))
{
PSNetworkRuleSetAttributes networkRuleSetAttributes = new PSNetworkRuleSetAttributes()
{
Expand All @@ -89,7 +89,7 @@ public override void ExecuteCmdlet()
WriteObject(Client.CreateOrUpdateNetworkRuleSet(ResourceGroupName, Name, networkRuleSetAttributes));
}

if (ParameterSetName.Equals(NetwrokruleSetInputObjectParameterSet))
if (ParameterSetName.Equals(NetworkRuleSetInputObjectParameterSet))
{
WriteObject(Client.CreateOrUpdateNetworkRuleSet(ResourceGroupName, Name, InputObject));
}
Expand All @@ -102,7 +102,7 @@ public override void ExecuteCmdlet()

if (ResourceGroupName != null && getParamGeoDR.ResourceName != null)
{
if (ShouldProcess(target: Name, action: string.Format("updating NetwrokruleSet", Name, ResourceGroupName)))
if (ShouldProcess(target: Name, action: string.Format("updating NetworkRuleSet", Name, ResourceGroupName)))
{
WriteObject(Client.CreateOrUpdateNetworkRuleSet(ResourceGroupName, Name, getNWRuleSet));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Set-AzServiceBusNetworkRuleSet [-ResourceGroupName] <String> [-Name] <String> [-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### NetwrokruleSetInputObjectSet
### NetworkRuleSetInputObjectSet
```
Set-AzServiceBusNetworkRuleSet [-ResourceGroupName] <String> [-Name] <String>
[-InputObject] <PSNetworkRuleSetAttributes> [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
Expand All @@ -33,7 +33,7 @@ Set-AzServiceBusNetworkRuleSet [-ResourceGroupName] <String> [-Name] <String> [-
```

## DESCRIPTION
Update the NetwrokruleSet of the given Namespace in the current Azure subscription.
Update the NetworkRuleSet of the given Namespace in the current Azure subscription.

## EXAMPLES

Expand Down Expand Up @@ -124,7 +124,7 @@ NetworkruleSet Configuration Object

```yaml
Type: Microsoft.Azure.Commands.ServiceBus.Models.PSNetworkRuleSetAttributes
Parameter Sets: NetwrokruleSetInputObjectSet
Parameter Sets: NetworkRuleSetInputObjectSet
Aliases:

Required: True
Expand Down