Skip to content

Commit dc3e96c

Browse files
minor fixes and test
1 parent 8d841ea commit dc3e96c

14 files changed

+197
-26
lines changed

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.13.0.4-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
70-
<Reference Include="Microsoft.Azure.Management.Network">
71-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.2-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
70+
<Reference Include="Microsoft.Azure.Management.Network, Version=6.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.3-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
7272
<Private>True</Private>
7373
</Reference>
7474
<Reference Include="Microsoft.Azure.Management.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -507,4 +507,4 @@
507507
</ItemGroup>
508508
<ItemGroup />
509509
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
510-
</Project>
510+
</Project>

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineNetworkInterfaceTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,13 @@ public void TestAddNetworkInterface()
5151
{
5252
ComputeTestController.NewInstance.RunPsTest("Test-AddNetworkInterface");
5353
}
54+
55+
56+
[Fact(Skip ="to be recorded after fixing compute test proj")]
57+
[Trait(Category.AcceptanceType, Category.CheckIn)]
58+
public void TestEffectiveRoutesAndNsg()
59+
{
60+
ComputeTestController.NewInstance.RunPsTest("Test-EffectiveRoutesAndNsg");
61+
}
5462
}
5563
}

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineNetworkInterfaceTests.ps1

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,3 +460,134 @@ function Test-AddNetworkInterface
460460
Clean-ResourceGroup $rgname
461461
}
462462
}
463+
464+
<#
465+
.SYNOPSIS
466+
Test Get effective routes and nsg
467+
#>
468+
function Test-EffectiveRoutesAndNsg
469+
{
470+
# Setup
471+
$rgname = Get-ComputeTestResourceName
472+
473+
try
474+
{
475+
# Common
476+
$loc = Get-ComputeVMLocation;
477+
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
478+
479+
# VM Profile & Hardware
480+
$vmsize = 'Standard_A2';
481+
$vmname = 'vm' + $rgname;
482+
$p = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize;
483+
Assert-AreEqual $p.HardwareProfile.VmSize $vmsize;
484+
485+
# NRP
486+
$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24";
487+
$vnet = New-AzureRmVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -Subnet $subnet;
488+
$vnet = Get-AzureRmVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname;
489+
$subnetId = $vnet.Subnets[0].Id;
490+
$pubip = New-AzureRmPublicIpAddress -Force -Name ('pubip' + $rgname) -ResourceGroupName $rgname -Location $loc -AllocationMethod Dynamic -DomainNameLabel ('pubip' + $rgname);
491+
$pubip = Get-AzureRmPublicIpAddress -Name ('pubip' + $rgname) -ResourceGroupName $rgname;
492+
$pubipId = $pubip.Id;
493+
494+
# Attach NSG to NIC
495+
$nsg = New-AzureRmNetworkSecurityGroup -Force -Name ('nsg' + $rgname) -ResourceGroupName $rgname -Location $loc
496+
$nsgId = $nsg.Id
497+
498+
$nic = New-AzureRmNetworkInterface -Force -Name ('nic' + $rgname) -ResourceGroupName $rgname -Location $loc -SubnetId $subnetId -PublicIpAddressId $pubip.Id -NetworkSecurityGroupId $nsgId;
499+
$nic = Get-AzureRmNetworkInterface -Name ('nic' + $rgname) -ResourceGroupName $rgname;
500+
$nicId = $nic.Id;
501+
502+
$p = Add-AzureRmVMNetworkInterface -VM $p -Id $nicId;
503+
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces.Count 1;
504+
Assert-AreEqual $p.NetworkProfile.NetworkInterfaces[0].Id $nicId;
505+
Assert-Null $p.NetworkProfile.NetworkInterfaces[0].Primary;
506+
507+
# Storage Account (SA)
508+
$stoname = 'sto' + $rgname;
509+
$stotype = 'Standard_GRS';
510+
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype;
511+
$stoaccount = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname;
512+
513+
$osDiskName = 'osDisk';
514+
$osDiskCaching = 'ReadWrite';
515+
$osDiskVhdUri = "https://$stoname.blob.core.windows.net/test/os.vhd";
516+
$dataDiskVhdUri1 = "https://$stoname.blob.core.windows.net/test/data1.vhd";
517+
$dataDiskVhdUri2 = "https://$stoname.blob.core.windows.net/test/data2.vhd";
518+
$dataDiskVhdUri3 = "https://$stoname.blob.core.windows.net/test/data3.vhd";
519+
520+
$p = Set-AzureRmVMOSDisk -VM $p -Name $osDiskName -VhdUri $osDiskVhdUri -Caching $osDiskCaching -CreateOption FromImage;
521+
522+
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 1 -VhdUri $dataDiskVhdUri1 -CreateOption Empty;
523+
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk2' -Caching 'ReadOnly' -DiskSizeInGB 11 -Lun 2 -VhdUri $dataDiskVhdUri2 -CreateOption Empty;
524+
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk3' -Caching 'ReadOnly' -DiskSizeInGB 12 -Lun 3 -VhdUri $dataDiskVhdUri3 -CreateOption Empty;
525+
$p = Remove-AzureRmVMDataDisk -VM $p -Name 'testDataDisk3';
526+
527+
Assert-AreEqual $p.StorageProfile.OSDisk.Caching $osDiskCaching;
528+
Assert-AreEqual $p.StorageProfile.OSDisk.Name $osDiskName;
529+
Assert-AreEqual $p.StorageProfile.OSDisk.Vhd.Uri $osDiskVhdUri;
530+
Assert-AreEqual $p.StorageProfile.DataDisks.Count 2;
531+
Assert-AreEqual $p.StorageProfile.DataDisks[0].Caching 'ReadOnly';
532+
Assert-AreEqual $p.StorageProfile.DataDisks[0].DiskSizeGB 10;
533+
Assert-AreEqual $p.StorageProfile.DataDisks[0].Lun 1;
534+
Assert-AreEqual $p.StorageProfile.DataDisks[0].Vhd.Uri $dataDiskVhdUri1;
535+
Assert-AreEqual $p.StorageProfile.DataDisks[1].Caching 'ReadOnly';
536+
Assert-AreEqual $p.StorageProfile.DataDisks[1].DiskSizeGB 11;
537+
Assert-AreEqual $p.StorageProfile.DataDisks[1].Lun 2;
538+
Assert-AreEqual $p.StorageProfile.DataDisks[1].Vhd.Uri $dataDiskVhdUri2;
539+
540+
# OS & Image
541+
$user = "Foo12";
542+
$password = $PLACEHOLDER;
543+
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force;
544+
$cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword);
545+
$computerName = 'test';
546+
$vhdContainer = "https://$stoname.blob.core.windows.net/test";
547+
$img = 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201503.01-en.us-127GB.vhd';
548+
549+
# $p.StorageProfile.OSDisk = $null;
550+
$p = Set-AzureRmVMOperatingSystem -VM $p -Windows -ComputerName $computerName -Credential $cred;
551+
552+
Assert-AreEqual $p.OSProfile.AdminUsername $user;
553+
Assert-AreEqual $p.OSProfile.ComputerName $computerName;
554+
Assert-AreEqual $p.OSProfile.AdminPassword $password;
555+
556+
# Image Reference
557+
$imgRef = Get-DefaultCRPImage;
558+
$p = ($imgRef | Set-AzureRmVMSourceImage -VM $p);
559+
Assert-NotNull $p.StorageProfile.ImageReference;
560+
Assert-Null $p.StorageProfile.SourceImageId;
561+
562+
# TODO: Remove Data Disks for now
563+
$p.StorageProfile.DataDisks = $null;
564+
565+
# Virtual Machine
566+
# TODO: Still need to do retry for New-AzureRmVM for SA, even it's returned in Get-.
567+
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $p;
568+
569+
# Get VM
570+
$vm1 = Get-AzureRmVM -Name $vmname -ResourceGroupName $rgname;
571+
Assert-AreEqual $vm1.Name $vmname;
572+
Assert-AreEqual $vm1.NetworkProfile.NetworkInterfaces.Count 1;
573+
Assert-AreEqual $vm1.NetworkProfile.NetworkInterfaces[0].Id $nicId;
574+
575+
# Get NetworkInterface
576+
$getnic = Get-AzureRmNetworkInterface -Name ('nic' + $rgname) -ResourceGroupName $rgname;
577+
Assert-AreEqual $vm1.NetworkProfile.NetworkInterfaces[0].Id $getnic.Id;
578+
Assert-AreEqual $getnic.Primary true;
579+
Assert-NotNull $getnic.MacAddress;
580+
581+
# Get Effective route
582+
$effectiveRoute = Get-AzureRmEffectiveRouteTable -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
583+
584+
# Get Effective NSG
585+
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
586+
587+
}
588+
finally
589+
{
590+
# Cleanup
591+
Clean-ResourceGroup $rgname
592+
}
593+
}

src/ResourceManager/Compute/Commands.Compute.Test/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="Microsoft.Azure.Graph.RBAC" version="3.1.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Compute" version="13.0.4-prerelease" targetFramework="net45" />
10-
<package id="Microsoft.Azure.Management.Network" version="6.0.2-preview" targetFramework="net45" />
10+
<package id="Microsoft.Azure.Management.Network" version="6.0.3-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Storage" version="4.1.0-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.Framework" version="1.0.6052.28118-prerelease" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.7-preview" targetFramework="net45" />
@@ -28,4 +28,4 @@
2828
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
2929
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
3030
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
31-
</packages>
31+
</packages>

src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.13.0.4-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
8181
<Private>True</Private>
8282
</Reference>
83-
<Reference Include="Microsoft.Azure.Management.Network">
84-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.2-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
83+
<Reference Include="Microsoft.Azure.Management.Network, Version=6.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
84+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.3-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
8585
<Private>True</Private>
8686
</Reference>
8787
<Reference Include="Microsoft.Azure.Management.Storage">
@@ -438,4 +438,4 @@
438438
</ItemGroup>
439439
<ItemGroup />
440440
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
441-
</Project>
441+
</Project>

src/ResourceManager/Compute/Commands.Compute/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Compute" version="13.0.4-prerelease" targetFramework="net45" />
12-
<package id="Microsoft.Azure.Management.Network" version="6.0.2-preview" targetFramework="net45" />
12+
<package id="Microsoft.Azure.Management.Network" version="6.0.3-preview" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Management.Storage" version="4.1.0-preview" targetFramework="net45" />
1414
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1515
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
@@ -25,4 +25,4 @@
2525
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
2626
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />
2727
<package id="WindowsAzure.Storage" version="6.1.0" targetFramework="net45" />
28-
</packages>
28+
</packages>

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
<Reference Include="Microsoft.Azure.Management.Authorization">
6464
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6565
</Reference>
66-
<Reference Include="Microsoft.Azure.Management.Network">
67-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.2-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
66+
<Reference Include="Microsoft.Azure.Management.Network, Version=6.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
67+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.3-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
7070
<Reference Include="Microsoft.Azure.ResourceManager">
@@ -176,6 +176,7 @@
176176
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Resources.ps1">
177177
<Link>ScenarioTests\AzureRM.Resources.ps1</Link>
178178
</None>
179+
<None Include="app.config" />
179180
<None Include="MSSharedLibKey.snk" />
180181
<None Include="packages.config">
181182
<SubType>Designer</SubType>
@@ -437,4 +438,4 @@
437438
</ItemGroup>
438439
<ItemGroup />
439440
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
440-
</Project>
441+
</Project>

src/ResourceManager/Network/Commands.Network.Test/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Graph.RBAC" version="3.1.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.Network" version="6.0.2-preview" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Management.Network" version="6.0.3-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Test.Framework" version="1.0.6052.28118-prerelease" targetFramework="net45" />
12-
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.7-preview" targetFramework="net45" />
12+
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.7-preview" targetFramework="net45" />
1313
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1414
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
1515
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
@@ -27,4 +27,4 @@
2727
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
2828
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
2929
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
30-
</packages>
30+
</packages>

src/ResourceManager/Network/Commands.Network/Commands.Network.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
<SpecificVersion>False</SpecificVersion>
7373
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
7474
</Reference>
75-
<Reference Include="Microsoft.Azure.Management.Network">
76-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.2-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
75+
<Reference Include="Microsoft.Azure.Management.Network, Version=6.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
76+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.0.3-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
7777
<Private>True</Private>
7878
</Reference>
7979
<Reference Include="Microsoft.Data.Edm">
@@ -292,6 +292,8 @@
292292
<Compile Include="Models\PSApplicationGatewaySku.cs" />
293293
<Compile Include="Models\PSApplicationGatewaySslCertificate.cs" />
294294
<Compile Include="Models\PSApplicationGatewayUrlPathMap.cs" />
295+
<Compile Include="Models\PSEffectiveNetworkSecurityGroupAssociation.cs" />
296+
<Compile Include="Models\PSEffectiveSecurityRule.cs" />
295297
<Compile Include="Models\PSInboundRule.cs" />
296298
<Compile Include="Models\PSInboundNatPool.cs" />
297299
<Compile Include="Models\PSExpressRouteServiveProvider.cs" />
@@ -313,6 +315,8 @@
313315
<Compile Include="Models\PSExpressRouteCircuitRoutesTableSummary.cs" />
314316
<Compile Include="Models\PSExpressRouteCircuitStats.cs" />
315317
<Compile Include="Models\PSVirtualNetworkPeering.cs" />
318+
<Compile Include="NetworkInterface\EffectiveResources\GetAzureEffectiveNetworkSecurityGroupCommand.cs" />
319+
<Compile Include="NetworkInterface\EffectiveResources\GetAzureEffectiveRouteTableCommand.cs" />
316320
<Compile Include="NetworkInterface\IpConfiguration\AddAzureNetworkInterfaceIpConfigCommand.cs" />
317321
<Compile Include="NetworkInterface\IpConfiguration\AzureNetworkInterfaceIpConfigBase.cs" />
318322
<Compile Include="NetworkInterface\IpConfiguration\GetAzureNetworkInterfaceIpConfigCommand.cs" />
@@ -540,4 +544,4 @@
540544
</Content>
541545
</ItemGroup>
542546
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
543-
</Project>
547+
</Project>

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,32 @@
431431
</ListEntries>
432432
</ListControl>
433433
</View>
434+
<View>
435+
<Name>Microsoft.Azure.Commands.Network.Models.PSEffectiveNetworkSecurityGroup</Name>
436+
<ViewSelectedBy>
437+
<TypeName>Microsoft.Azure.Commands.Network.Models.PSEffectiveNetworkSecurityGroup</TypeName>
438+
</ViewSelectedBy>
439+
<ListControl>
440+
<ListEntries>
441+
<ListEntry>
442+
<ListItems>
443+
<ListItem>
444+
<Label>NetworkSecurityGroup</Label>
445+
<PropertyName>NetworkSecurityGroupText</PropertyName>
446+
</ListItem>
447+
<ListItem>
448+
<Label>Association</Label>
449+
<PropertyName>AssociationText</PropertyName>
450+
</ListItem>
451+
<ListItem>
452+
<Label>EffectiveSecurityRules</Label>
453+
<PropertyName>EffectiveSecurityRulesText</PropertyName>
454+
</ListItem>
455+
</ListItems>
456+
</ListEntry>
457+
</ListEntries>
458+
</ListControl>
459+
</View>
434460
<View>
435461
<Name>Microsoft.Azure.Commands.Network.Models.PSNetworkSecurityGroup</Name>
436462
<ViewSelectedBy>

src/ResourceManager/Network/Commands.Network/Models/PSEffectiveSecurityRule.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
namespace Microsoft.Azure.Commands.Network.Models
1717
{
1818
using Newtonsoft.Json;
19-
19+
using System.Collections.Generic;
20+
2021
public class PSEffectiveSecurityRule
2122
{
2223
public string Name { get; set; }
@@ -37,10 +38,10 @@ public class PSEffectiveSecurityRule
3738
public string DestinationAddressPrefix { get; set; }
3839

3940
[JsonProperty(Order = 1)]
40-
public string ExtendedSourceAddressPrefix { get; set; }
41+
public List<string> ExtendedSourceAddressPrefix { get; set; }
4142

4243
[JsonProperty(Order = 1)]
43-
public string ExtendedDestinationAddressPrefix { get; set; }
44+
public List<string> ExtendedDestinationAddressPrefix { get; set; }
4445

4546
[JsonProperty(Order = 1)]
4647
public string Access { get; set; }

src/ResourceManager/Network/Commands.Network/NetworkInterface/EffectiveResources/GetAzureEffectiveNetworkSecurityGroupCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public override void Execute()
4343

4444
var getEffectiveNsgs = this.NetworkInterfaceClient.ListEffectiveNetworkSecurityGroups(this.ResourceGroupName, this.NetworkInterfaceName);
4545

46-
var psEffectiveNsgs = Mapper.Map<List<PSEffectiveNetworkSecurityGroup>>(getEffectiveNsgs);
46+
var psEffectiveNsgs = Mapper.Map<List<PSEffectiveNetworkSecurityGroup>>(getEffectiveNsgs.Value);
4747

4848
WriteObject(psEffectiveNsgs, true);
4949
}

src/ResourceManager/Network/Commands.Network/NetworkInterface/EffectiveResources/GetAzureEffectiveRouteTableCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public override void Execute()
4343

4444
var getEffectiveRouteTable = this.NetworkInterfaceClient.GetEffectiveRouteTable(this.ResourceGroupName, this.NetworkInterfaceName);
4545

46-
var psEffectiveRouteTable = Mapper.Map<List<PSEffectiveRoute>>(getEffectiveRouteTable);
46+
var psEffectiveRouteTable = Mapper.Map<List<PSEffectiveRoute>>(getEffectiveRouteTable.Value);
4747

4848
WriteObject(psEffectiveRouteTable, true);
4949
}

0 commit comments

Comments
 (0)