Skip to content

Commit 2dcced8

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents f494746 + c2b149e commit 2dcced8

File tree

17 files changed

+529
-848
lines changed

17 files changed

+529
-848
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Contribute Code or Provide Feedback
22

3-
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://windowsazure.github.com/guidelines.html).
3+
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
44

55
If you encounter any bugs with Microsoft Azure PowerShell please file an issue in the [Issues](https://github.com/Azure/azure-powershell/issues) section of the project.

src/Common/Commands.Common.Authentication/Commands.Common.Authentication.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AssemblyName>Commands.Common.Authentication</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14-
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
14+
<TargetFrameworkProfile />
1515
<RestorePackages>true</RestorePackages>
1616
<CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
1717
<NuGetPackageImportStamp>06e19c11</NuGetPackageImportStamp>
@@ -51,7 +51,8 @@
5151
</PropertyGroup>
5252
<ItemGroup>
5353
<Reference Include="Hyak.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
54-
<HintPath>..\..\packages\Hyak.Common.1.0.3\lib\net45\Hyak.Common.dll</HintPath>
54+
<SpecificVersion>False</SpecificVersion>
55+
<HintPath>..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
5556
<Private>True</Private>
5657
</Reference>
5758
<Reference Include="Microsoft.Azure.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -178,5 +179,4 @@
178179
<None Include="packages.config" />
179180
</ItemGroup>
180181
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
181-
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
182182
</Project>

src/Common/Commands.Common.Authentication/Models/XmlProfileSerializer.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ public bool Deserialize(string contents, AzureSMProfile profile)
3838
DeserializeErrors = new List<string>();
3939

4040
DataContractSerializer serializer = new DataContractSerializer(typeof(ProfileData));
41+
42+
// For backward compatibility since namespace of ProfileData has been changed
43+
// we need to replace previous namespace with the current one
44+
if (!string.IsNullOrWhiteSpace(contents))
45+
{
46+
contents = contents.Replace(
47+
"http://schemas.datacontract.org/2004/07/Microsoft.Azure.Common.Authentication",
48+
"http://schemas.datacontract.org/2004/07/Microsoft.Azure.Commands.Common.Authentication");
49+
}
50+
4151
using (MemoryStream s = new MemoryStream(Encoding.UTF8.GetBytes(contents ?? "")))
4252
{
4353
data = (ProfileData)serializer.ReadObject(s);

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
<Compile Include="Mocks\MockClientFactory.cs" />
141141
<Compile Include="Mocks\MockCommandRuntime.cs" />
142142
<Compile Include="PermissiveRecordMatcherWithApiExclusion.cs" />
143+
<Compile Include="ProfileClient.cs" />
143144
<Compile Include="PSCmdletExtensions.cs" />
144145
<Compile Include="Constants.cs" />
145146
<Compile Include="Mocks\MockAccessToken.cs" />
@@ -171,10 +172,6 @@
171172
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
172173
<Name>Commands.Common</Name>
173174
</ProjectReference>
174-
<ProjectReference Include="..\..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj">
175-
<Project>{cff09e81-1e31-444e-b4d4-a21e946c29e2}</Project>
176-
<Name>Commands.ServiceManagement.Common</Name>
177-
</ProjectReference>
178175
<ProjectReference Include="..\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj">
179176
<Project>{3819d8a7-c62c-4c47-8ddd-0332d9ce1252}</Project>
180177
<Name>Commands.ResourceManager.Common</Name>

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/EnvironmentSetupHelper.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ public EnvironmentSetupHelper()
6161
rmprofile.Context.Subscription.Environment = "foo";
6262
if (AzureRmProfileProvider.Instance.Profile == null)
6363
{
64-
AzureRmProfileProvider.Instance.Profile = rmprofile; }
64+
AzureRmProfileProvider.Instance.Profile = rmprofile;
65+
}
6566

66-
AzureSession.DataStore = datastore; ProfileClient = new ProfileClient(profile);
67+
AzureSession.DataStore = datastore;
68+
ProfileClient = new ProfileClient(profile);
6769

6870
// Ignore SSL errors
6971
System.Net.ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => true;

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Mocks/MockClientFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
using Microsoft.Azure.Commands.Common.Authentication.Factories;
3030
using Microsoft.Azure.Commands.Common.Authentication.Models;
3131
using Microsoft.Azure.ServiceManagemenet.Common;
32+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
3233

3334
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
3435
{

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/ProfileClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ public AzureSubscription SetSubscriptionAsDefault(Guid id, string accountName)
656656
{
657657
if (subscription.IsPropertySet(AzureSubscription.Property.StorageAccount))
658658
{
659-
subscription.SetProperty(AzureSubscription.Property.StorageAccount, null);
659+
GeneralUtilities.ClearCurrentStorageAccount();
660660
}
661661

662662
Profile.DefaultSubscription = subscription;

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ExpressRouteCircuitTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Commands.Network.Test.ScenarioTests
1919
{
2020
public class ExpressRouteCircuitTests : Microsoft.WindowsAzure.Commands.Test.Utilities.Common.RMTestBase
2121
{
22-
[Fact(Skip = "Rerecord tests")]
22+
[Fact]
2323
[Trait(Category.AcceptanceType, Category.CheckIn)]
2424
public void TestExpressRouteCircuitCRUD()
2525
{
@@ -33,7 +33,7 @@ public void TestExpressRouteCircuitPeeringCRUD()
3333
NetworkResourcesController.NewInstance.RunPsTest("Test-ExpressRouteCircuitPeeringCRUD");
3434
}
3535

36-
[Fact(Skip = "Rerecord tests")]
36+
[Fact]
3737
[Trait(Category.AcceptanceType, Category.CheckIn)]
3838
public void TestExpressRouteCircuitAuthorizationCRUD()
3939
{

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Test-ExpressRouteCircuitCRUD
3131
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation
3232

3333
# Create the ExpressRouteCircuit
34-
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -BillingType MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000;
34+
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 500;
3535

3636
# get Circuit
3737
$getCircuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname
@@ -47,7 +47,7 @@ function Test-ExpressRouteCircuitCRUD
4747
Assert-AreEqual "MeteredData" $getCircuit.Sku.Family
4848
Assert-AreEqual "equinix" $getCircuit.ServiceProviderProperties.ServiceProviderName
4949
Assert-AreEqual "Silicon Valley" $getCircuit.ServiceProviderProperties.PeeringLocation
50-
Assert-AreEqual "1000" $getCircuit.ServiceProviderProperties.BandwidthInMbps
50+
Assert-AreEqual "500" $getCircuit.ServiceProviderProperties.BandwidthInMbps
5151

5252
# list
5353
$list = Get-AzureRmExpressRouteCircuit -ResourceGroupName $rgname
@@ -59,20 +59,22 @@ function Test-ExpressRouteCircuitCRUD
5959
Assert-AreEqual @($list[0].Peerings).Count @($getCircuit.Peerings).Count
6060

6161
# set
62-
$getCircuit.ServiceProviderProperties.BandwidthInMbps = 500
62+
$getCircuit.ServiceProviderProperties.BandwidthInMbps = 1000
63+
$getCircuit.Sku.Tier = "Premium"
64+
$getCircuit.Sku.Family = "UnlimitedData"
6365

64-
$getCircuit = Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $getCircuit -BillingType UnlimitedData
66+
$getCircuit = Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $getCircuit
6567
Assert-AreEqual $rgName $getCircuit.ResourceGroupName
6668
Assert-AreEqual $circuitName $getCircuit.Name
6769
Assert-NotNull $getCircuit.Location
6870
Assert-NotNull $getCircuit.Etag
6971
Assert-AreEqual 0 @($getCircuit.Peerings).Count
70-
Assert-AreEqual "standard_meteredData" $getCircuit.Sku.Name
71-
Assert-AreEqual "Standard" $getCircuit.Sku.Tier
72-
Assert-AreEqual "MeteredData" $getCircuit.Sku.Family
72+
Assert-AreEqual "Standard_MeteredData" $getCircuit.Sku.Name
73+
Assert-AreEqual "Premium" $getCircuit.Sku.Tier
74+
Assert-AreEqual "UnlimitedData" $getCircuit.Sku.Family
7375
Assert-AreEqual "equinix" $getCircuit.ServiceProviderProperties.ServiceProviderName
7476
Assert-AreEqual "Silicon Valley" $getCircuit.ServiceProviderProperties.PeeringLocation
75-
Assert-AreEqual "500" $getCircuit.ServiceProviderProperties.BandwidthInMbps
77+
Assert-AreEqual "1000" $getCircuit.ServiceProviderProperties.BandwidthInMbps
7678

7779
# Delete Circuit
7880
$delete = Remove-AzureRmExpressRouteCircuit -ResourceGroupName $rgname -name $circuitName -PassThru -Force
@@ -108,7 +110,7 @@ function Test-ExpressRouteCircuitPeeringCRUD
108110

109111
# Create the ExpressRouteCircuit with peering
110112
$peering = New-AzureRmExpressRouteCircuitPeeringConfig -Name AzurePrivatePeering -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200
111-
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -BillingType UnlimitedData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000 -Peering $peering
113+
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000 -Peering $peering
112114

113115
#verification
114116
Assert-AreEqual $rgName $circuit.ResourceGroupName
@@ -146,7 +148,7 @@ function Test-ExpressRouteCircuitPeeringCRUD
146148
Assert-AreEqual 1 @($listPeering).Count
147149

148150
# add a new Peering
149-
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Add-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 99 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MicrosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MicrosoftConfigCustomerAsn 1000 -MicrosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit -BillingType UnlimitedData
151+
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Add-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 99 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MicrosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MicrosoftConfigCustomerAsn 1000 -MicrosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit
150152

151153
$p = $circuit | Get-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering
152154
Assert-AreEqual "MicrosoftPeering" $p.Name
@@ -165,7 +167,7 @@ function Test-ExpressRouteCircuitPeeringCRUD
165167
Assert-AreEqual 2 @($listPeering).Count
166168

167169
# Set a new peering
168-
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Set-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 100 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MicrosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MicrosoftConfigCustomerAsn 1000 -MicrosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit -BillingType UnlimitedData
170+
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Set-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 100 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MicrosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MicrosoftConfigCustomerAsn 1000 -MicrosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit
169171
$p = $circuit | Get-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering
170172
Assert-AreEqual "MicrosoftPeering" $p.Name
171173
Assert-AreEqual "MicrosoftPeering" $p.PeeringType
@@ -215,7 +217,7 @@ function Test-ExpressRouteCircuitAuthorizationCRUD
215217

216218
# Create the ExpressRouteCircuit with authorization
217219
$authorization = New-AzureRmExpressRouteCircuitAuthorization -Name $authorizationName
218-
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000 -Authorization $authorization
220+
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 500 -Authorization $authorization
219221

220222
#verification
221223
Assert-AreEqual $rgName $circuit.ResourceGroupName
@@ -228,7 +230,7 @@ function Test-ExpressRouteCircuitAuthorizationCRUD
228230
Assert-AreEqual "MeteredData" $circuit.Sku.Family
229231
Assert-AreEqual "equinix" $circuit.ServiceProviderProperties.ServiceProviderName
230232
Assert-AreEqual "Silicon Valley" $circuit.ServiceProviderProperties.PeeringLocation
231-
Assert-AreEqual "1000" $circuit.ServiceProviderProperties.BandwidthInMbps
233+
Assert-AreEqual "500" $circuit.ServiceProviderProperties.BandwidthInMbps
232234

233235
# Verify the authorization
234236
Assert-AreEqual $authorizationName $circuit.Authorizations[0].Name

0 commit comments

Comments
 (0)