Skip to content

Commit 4b8e8c9

Browse files
author
Nalin Gupta
committed
Resolving all comments.
1 parent 8e27d5a commit 4b8e8c9

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/CortexTests.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ function Test-CortexCRUD
4646
Assert-AreEqual $false $virtualWan.AllowVnetToVnetTraffic
4747
Assert-AreEqual $false $virtualWan.AllowBranchToBranchTraffic
4848

49+
# Get Supported SecurityProvider
50+
$supportedSecurityProvider = Get-AzureRmVirtualWanSupportedSecurityProvider -ResourceGroupName $rgName -VirtualWan $virtualWan
51+
Assert-NotNull $supportedSecurityProvider
52+
4953
# Create the Virtual Hub
5054
$createdVirtualHub = New-AzureRmVirtualHub -ResourceGroupName $rgName -Name $virtualHubName -Location $rglocation -AddressPrefix "192.168.1.0/24" -VirtualWan $virtualWan
5155
$virtualHub = Get-AzureRmVirtualHub -ResourceGroupName $rgName -Name $virtualHubName
@@ -95,6 +99,11 @@ function Test-CortexCRUD
9599
$hubVnetConnection = Get-AzureRmVirtualHubVnetConnection -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name $hubVnetConnectionName
96100
Assert-AreEqual $hubVnetConnectionName $hubVnetConnection.Name
97101

102+
# Update a HubVirtualNetworkConnection
103+
Update-AzureRmVirtualHubVnetConnection -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name $hubVnetConnectionName -EnableInternetSecurity
104+
$hubVnetConnection = Get-AzureRmVirtualHubVnetConnection -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name $hubVnetConnectionName
105+
Assert-True $hubVnetConnection.EnableInternetSecurity
106+
98107
# Download config
99108
$storetype = 'Standard_GRS'
100109
$containerName = 'cont' + $rgName

src/ResourceManager/Network/Commands.Network/Cortex/HubVnetConnection/UpdateAzureRmHubVirtualNetworkConnectionCommand.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,23 @@ public override void Execute()
9393
//// Resolve the VirtualHub
9494
if (ParameterSetName.Equals(CortexParameterSetNames.ByHubVirtualNetworkConnectionObject, StringComparison.OrdinalIgnoreCase))
9595
{
96-
var parsedResourceId = new ResourceIdentifier(this.InputObject.Id);
96+
this.ResourceId = this.InputObject.Id;
97+
98+
if (string.IsNullOrWhiteSpace(this.ResourceId))
99+
{
100+
throw new PSArgumentException(Properties.Resources.HubVnetConnectionNotFound);
101+
}
102+
103+
var parsedResourceId = new ResourceIdentifier(this.ResourceId);
97104
this.ResourceGroupName = parsedResourceId.ResourceGroupName;
98-
this.ParentResourceName = parsedResourceId.ParentResource;
105+
this.ParentResourceName = parsedResourceId.ParentResource.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).Last();
99106
this.Name = parsedResourceId.ResourceName;
100107
}
101108
else if (ParameterSetName.Equals(CortexParameterSetNames.ByHubVirtualNetworkConnectionResourceId, StringComparison.OrdinalIgnoreCase))
102109
{
103110
var parsedResourceId = new ResourceIdentifier(this.ResourceId);
104111
this.ResourceGroupName = parsedResourceId.ResourceGroupName;
105-
this.ParentResourceName = parsedResourceId.ParentResource;
112+
this.ParentResourceName = parsedResourceId.ParentResource.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).Last();
106113
this.Name = parsedResourceId.ResourceName;
107114
}
108115

src/ResourceManager/Network/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3353,6 +3353,10 @@
33533353
<ListItem>
33543354
<Label>RemoteVirtualNetwork</Label>
33553355
<ScriptBlock>$_.RemoteVirtualNetwork.Id</ScriptBlock>
3356+
</ListItem>
3357+
<ListItem>
3358+
<Label>EnableInternetSecurity</Label>
3359+
<PropertyName>EnableInternetSecurity</PropertyName>
33563360
</ListItem>
33573361
<ListItem>
33583362
<Label>ProvisioningState</Label>
@@ -3387,6 +3391,14 @@
33873391
<ListItem>
33883392
<Label>AllowBranchToBranchTraffic</Label>
33893393
<PropertyName>AllowBranchToBranchTraffic</PropertyName>
3394+
</ListItem>
3395+
<ListItem>
3396+
<Label>SecurityProviderName</Label>
3397+
<PropertyName>SecurityProviderName</PropertyName>
3398+
</ListItem>
3399+
<ListItem>
3400+
<Label>Office365LocalBreakoutCategory</Label>
3401+
<PropertyName>Office365LocalBreakoutCategory</PropertyName>
33903402
</ListItem>
33913403
<ListItem>
33923404
<Label>Location</Label>
@@ -3495,6 +3507,10 @@
34953507
<ListItem>
34963508
<Label>BgpSettings</Label>
34973509
<PropertyName>BgpSettings</PropertyName>
3510+
</ListItem>
3511+
<ListItem>
3512+
<Label>IsSecuritySite</Label>
3513+
<PropertyName>IsSecuritySite</PropertyName>
34983514
</ListItem>
34993515
<ListItem>
35003516
<Label>Type</Label>

0 commit comments

Comments
 (0)