Skip to content

Commit 47d345d

Browse files
authored
Merge pull request #631 from Azure/dev
huangpf PR: dev <- Azure:dev
2 parents 7b48033 + 6cffcaa commit 47d345d

File tree

37 files changed

+6192
-397
lines changed

37 files changed

+6192
-397
lines changed

setup/azurecmdfiles.wxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,9 @@
19161916
<Component Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" Guid="*">
19171917
<File Id="filF30732FD3174ABEC7D2103467F25E8E5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\AzureRM.OperationalInsights.psd1" />
19181918
</Component>
1919+
<Component Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" Guid="*">
1920+
<File Id="filD2FB04719F134FB9BF2BC1EE41908381" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
1921+
</Component>
19191922
<Component Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" Guid="*">
19201923
<File Id="filD490745C6F4007A53448F93D7655F3D4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\Hyak.Common.dll" />
19211924
</Component>
@@ -6074,6 +6077,7 @@
60746077
<ComponentRef Id="cmp275E5D23204FF3DB5A484691FFA2C6F5" />
60756078
<ComponentRef Id="cmp5E9A44B7330C75772463CB17D6D24AA6" />
60766079
<ComponentRef Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" />
6080+
<ComponentRef Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" />
60776081
<ComponentRef Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" />
60786082
<ComponentRef Id="cmp6D68CAF3787D43356F3C2CB592699D2D" />
60796083
<ComponentRef Id="cmp20FBC1203D91D529F69E519C9C2F78B8" />

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@
397397
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestAddNetworkInterface.json">
398398
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
399399
</None>
400+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestEffectiveRoutesAndNsg.json">
401+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
402+
</None>
400403
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestSingleNetworkInterfaceDnsSettings.json">
401404
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
402405
</None>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void TestAddNetworkInterface()
5353
}
5454

5555

56-
[Fact(Skip ="to be recorded after fixing compute test proj")]
56+
[Fact]
5757
[Trait(Category.AcceptanceType, Category.CheckIn)]
5858
public void TestEffectiveRoutesAndNsg()
5959
{

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,12 @@ function Test-EffectiveRoutesAndNsg
578578
Assert-AreEqual $getnic.Primary true;
579579
Assert-NotNull $getnic.MacAddress;
580580

581-
# Get Effective route
581+
# Get Effective route by name
582582
$effectiveRoute = Get-AzureRmEffectiveRouteTable -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
583+
Assert-NotNull $effectiveRoute[0].Source
583584

584-
# Get Effective NSG
585-
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
586-
585+
# Get Effective NSG by name
586+
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
587587
}
588588
finally
589589
{

src/ResourceManager/Compute/Commands.Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests/TestEffectiveRoutesAndNsg.json

Lines changed: 5056 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public class PSEffectiveRoute
2626
[JsonProperty(Order = 1)]
2727
public string State { get; set; }
2828

29+
[JsonProperty(Order = 1)]
30+
public string Source { get; set; }
31+
2932
[JsonProperty(Order = 1)]
3033
public List<string> AddressPrefix { get; set; }
3134

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public override void Execute()
4646
var psEffectiveNsgs = Mapper.Map<List<PSEffectiveNetworkSecurityGroup>>(getEffectiveNsgs.Value);
4747

4848
WriteObject(psEffectiveNsgs, true);
49+
50+
if (psEffectiveNsgs.Count == 0)
51+
{
52+
WriteWarning(Microsoft.Azure.Commands.Network.Properties.Resources.EmptyEffectiveNetworkSecurityGroupOnNic);
53+
}
4954
}
5055
}
5156
}

src/ResourceManager/Network/Commands.Network/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Network/Commands.Network/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,7 @@
255255
<data name="UltraPerformanceGatewayWarningMessage" xml:space="preserve">
256256
<value>Please check the availability of UltraPerformance gateway on https://azure.microsoft.com/en-us/documentation/articles/expressroute-about-virtual-network-gateways/. You will be billed for this gateway once this command succeeds.</value>
257257
</data>
258+
<data name="EmptyEffectiveNetworkSecurityGroupOnNic" xml:space="preserve">
259+
<value>The effective network security group list is empty because the specified network interface is not associated with a network security group or the subnet that is referenced by the network interface is also not associated with a network security group.</value>
260+
</data>
258261
</root>

src/ResourceManager/OperationalInsights/AzureRM.OperationalInsights.psd1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ CmdletsToExport = '*'
7676
VariablesToExport = '*'
7777

7878
# Aliases to export from this module
79-
AliasesToExport = @()
79+
AliasesToExport = @(
80+
'New-AzureRmOperationalInsightsAzureAuditDataSource'
81+
)
8082

8183
# List of all modules packaged with this module
8284
ModuleList = @()

src/ResourceManager/OperationalInsights/Commands.OperationalInsights.Test/ScenarioTests/DataSourceTests.ps1

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ function Test-DataSourceCreateUpdateDelete
3131
$workspace = New-AzureRmOperationalInsightsWorkspace -ResourceGroupName $rgname -Name $wsname -Location $wslocation -Force
3232

3333
# Create a data source
34-
$dataSource = New-AzureRmOperationalInsightsAzureAuditDataSource -Workspace $workspace -Name $dsName -SubscriptionId $subId1
34+
$dataSource = New-AzureRmOperationalInsightsAzureActivityLogDataSource -Workspace $workspace -Name $dsName -SubscriptionId $subId1
3535
Assert-AreEqual $dsName $dataSource.Name
3636
Assert-NotNull $dataSource.ResourceId
3737
Assert-AreEqual $rgname $dataSource.ResourceGroupName
3838
Assert-AreEqual $wsname $dataSource.WorkspaceName
3939
Assert-AreEqual $subId1 $dataSource.Properties.SubscriptionId
40-
Assert-AreEqual "AzureAuditLog" $dataSource.Kind
40+
Assert-AreEqual "AzureActivityLog" $dataSource.Kind
4141

4242
# Get the data source that was created
4343
$dataSource = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $dsName
@@ -46,27 +46,26 @@ function Test-DataSourceCreateUpdateDelete
4646
Assert-AreEqual $rgname $dataSource.ResourceGroupName
4747
Assert-AreEqual $wsname $dataSource.WorkspaceName
4848
Assert-AreEqual $subId1 $dataSource.Properties.SubscriptionId
49-
Assert-AreEqual "AzureAuditLog" $dataSource.Kind
49+
Assert-AreEqual "AzureActivityLog" $dataSource.Kind
5050

51-
# Create a second data source for list testing
51+
# Create a second data source for list testing, also cover the alias.
5252
$daNametwo = Get-ResourceName
5353
$dataSource = New-AzureRmOperationalInsightsAzureAuditDataSource -Workspace $workspace -Name $daNametwo -SubscriptionId $subId2
5454

5555
# List the data source in the workspace (both param sets)
56-
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureAuditLog
56+
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureActivityLog
5757
Assert-AreEqual 2 $dataSources.Count
5858
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $dsName}).Count
5959
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $daNametwo}).Count
6060

61-
$dataSources = Get-AzureRmOperationalInsightsDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Kind AzureAuditLog
61+
$dataSources = Get-AzureRmOperationalInsightsDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Kind AzureActivityLog
6262
Assert-AreEqual 2 $dataSources.Count
6363
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $dsName}).Count
6464
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $daNametwo}).Count
6565

6666
# Delete one of the data sources
6767
Remove-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $daNametwo -Force
68-
Assert-ThrowsContains { Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $daNametwo } "NotFound"
69-
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureAuditLog
68+
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureActivityLog
7069
Assert-AreEqual 1 $dataSources.Count
7170
Assert-AreEqual 1 ($dataSources | Where {$_.Name -eq $dsName}).Count
7271
Assert-AreEqual 0 ($dataSources | Where {$_.Name -eq $daNametwo}).Count
@@ -75,13 +74,12 @@ function Test-DataSourceCreateUpdateDelete
7574
$dataSource = $dataSources[0]
7675
$dataSource.Properties.SubscriptionId = $subId2
7776
$dataSource = Set-AzureRmOperationalInsightsDataSource -DataSource $dataSource
78-
Assert-AreEqual "AzureAuditLog" $dataSource.Kind
77+
Assert-AreEqual "AzureActivityLog" $dataSource.Kind
7978
Assert-AreEqual $subId2 $dataSource.Properties.SubscriptionId
8079

8180
# Delete the remaining data source via piping
8281
Remove-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $dsName -Force
83-
Assert-ThrowsContains { Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Name $dsName } "NotFound"
84-
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureAuditLog
82+
$dataSources = Get-AzureRmOperationalInsightsDataSource -Workspace $workspace -Kind AzureActivityLog
8583
Assert-AreEqual 0 $dataSources.Count
8684
}
8785

@@ -99,7 +97,7 @@ function Test-DataSourceCreateFailsWithoutWorkspace
9997

10098
New-AzureRmResourceGroup -Name $rgname -Location $wslocation -Force
10199

102-
Assert-ThrowsContains { New-AzureRmOperationalInsightsAzureAuditDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Name $dsName -SubscriptionId $subId1 } "ResourceNotFound"
100+
Assert-ThrowsContains { New-AzureRmOperationalInsightsAzureActivityLogDataSource -ResourceGroupName $rgname -WorkspaceName $wsname -Name $dsName -SubscriptionId $subId1 } "ResourceNotFound"
103101
}
104102

105103
<#
@@ -118,8 +116,8 @@ function Test-CreateAllKindsOfDataSource
118116
# Create a workspace to house the data source
119117
$workspace = New-AzureRmOperationalInsightsWorkspace -ResourceGroupName $rgname -Name $wsname -Location $wslocation -Force
120118

121-
# AzureAuditLog data source
122-
$auditLogDataSource = New-AzureRmOperationalInsightsAzureAuditDataSource -Workspace $workspace -Name "myAuditLog" -SubscriptionId $subId1
119+
# AzureActivityLog data source
120+
$auditLogDataSource = New-AzureRmOperationalInsightsAzureActivityLogDataSource -Workspace $workspace -Name "myAuditLog" -SubscriptionId $subId1
123121

124122
# windows event data source
125123
$windowsEventDataSource = New-AzureRmOperationalInsightsWindowsEventDataSource -Workspace $workspace -Name Application -EventLogName "Application" -CollectErrors -CollectWarnings -CollectInformation

0 commit comments

Comments
 (0)