Skip to content

Commit ec74ff4

Browse files
committed
Merge branch 'dev' of github.com:Azure/azure-powershell into handlers
Conflicts: src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj
2 parents 5669896 + 657c1b8 commit ec74ff4

File tree

107 files changed

+3038
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+3038
-214
lines changed

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ This may take some time...
5656
} else {
5757
cd c:\
5858
$welcomeMessage = @"
59-
For a list of all Azure cmdlets type 'help azure'.
60-
For a list of Azure Pack cmdlets type 'Get-Command *wapack*'.
59+
For a list of all Azure RM cmdlets type 'help azurerm'.
60+
61+
To start using Azure RM login via Login-AzureRmAccount cmdlet.
62+
To switch between subscriptions use Set-AzureRmContext.
6163
6264
To use Azure Service Management cmdlets please execute the following cmdlet:
6365
Install-Module Azure

src/Common/Storage/Azure.Storage.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = '00612bca-fa22-401d-a671-9cc48b010e3b'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '© Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = 'Microsoft Azure PowerShell - Storage'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/Common/Storage/Commands.Storage/Microsoft.WindowsAzure.Commands.Storage.dll-Help.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.8.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'D48CF693-4125-4D2D-8790-1514F44CE325'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '?Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = ''

src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'f875725d-8ce4-423f-a6af-ea880bc63f13'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '© Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = 'Microsoft Azure PowerShell - Api Management'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-help.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.0.1'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = '77A7B3B3-A067-4173-9AC9-8A7248EF3C1C'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '?Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = ''

src/ResourceManager/ApiManagement/Commands.ApiManagement/Microsoft.Azure.Commands.ApiManagement.dll-help.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.0.1'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = '77A7B3B3-A067-4173-9AC9-8A7248EF3C1C'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '?Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = ''

src/ResourceManager/Automation/AzureRM.Automation.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'bcea1c70-a32b-48c3-a05c-323e1c02f4d3'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '© Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = 'Microsoft Azure PowerShell - Automation'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/Automation/Commands.Automation/Microsoft.Azure.Commands.ResourceManager.Automation.dll-help.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.8.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'D48CF693-4125-4D2D-8790-1514F44CE325'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '?Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = ''

src/ResourceManager/AzureBackup/AzureRM.Backup.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = '0b1d76f5-a928-4b8f-9c83-df26947568d4'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '© Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = 'Microsoft Azure PowerShell - AzureBackup'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/AzureBackup/Commands.AzureBackup/Microsoft.Azure.Commands.AzureBackup.dll-help.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '© Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = ''

src/ResourceManager/AzureBatch/AzureRM.Batch.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = 'a8f00f40-1c1a-49b5-9db3-24076b75c3cf'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '© Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = 'Microsoft Azure PowerShell - Batch'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ public EnvironmentSetupHelper()
5858
rmprofile.Environments.Add("foo", AzureEnvironment.PublicEnvironments.Values.FirstOrDefault());
5959
rmprofile.Context = new AzureContext(new AzureSubscription(), new AzureAccount(), rmprofile.Environments["foo"], new AzureTenant());
6060
rmprofile.Context.Subscription.Environment = "foo";
61-
AzureRMCmdlet.DefaultProfile = rmprofile;
62-
AzureSession.DataStore = datastore;
61+
if (AzureRMCmdlet.DefaultProfile == null)
62+
{
63+
AzureRMCmdlet.DefaultProfile = rmprofile;
64+
}
6365
ProfileClient = new ProfileClient(profile);
6466

6567
// Ignore SSL errors
@@ -162,12 +164,18 @@ private void SetupAzureEnvironmentFromEnvironmentVariables(AzureModule mode)
162164
environment.Endpoints[AzureEnvironment.Endpoint.ActiveDirectory] = currentEnvironment.Endpoints.AADAuthUri.AbsoluteUri;
163165
environment.Endpoints[AzureEnvironment.Endpoint.Gallery] = currentEnvironment.Endpoints.GalleryUri.AbsoluteUri;
164166
environment.Endpoints[AzureEnvironment.Endpoint.ServiceManagement] = currentEnvironment.BaseUri.AbsoluteUri;
167+
environment.Endpoints[AzureEnvironment.Endpoint.ResourceManager] = currentEnvironment.Endpoints.ResourceManagementUri.AbsoluteUri;
165168

166169
if (!ProfileClient.Profile.Environments.ContainsKey(testEnvironmentName))
167170
{
168171
ProfileClient.AddOrSetEnvironment(environment);
169172
}
170173

174+
if (!AzureRMCmdlet.DefaultProfile.Environments.ContainsKey(testEnvironmentName))
175+
{
176+
AzureRMCmdlet.DefaultProfile.Environments[testEnvironmentName] = environment;
177+
}
178+
171179
if (currentEnvironment.SubscriptionId != null)
172180
{
173181
testSubscription = new AzureSubscription()
@@ -199,6 +207,17 @@ private void SetupAzureEnvironmentFromEnvironmentVariables(AzureModule mode)
199207
ProfileClient.Profile.Subscriptions[testSubscription.Id] = testSubscription;
200208
ProfileClient.Profile.Accounts[testAccount.Id] = testAccount;
201209
ProfileClient.SetSubscriptionAsDefault(testSubscription.Name, testSubscription.Account);
210+
211+
var testTenant = new AzureTenant() { Id = Guid.NewGuid() };
212+
if (!string.IsNullOrEmpty(currentEnvironment.Tenant))
213+
{
214+
Guid tenant;
215+
if (Guid.TryParse(currentEnvironment.Tenant, out tenant))
216+
{
217+
testTenant.Id = tenant;
218+
}
219+
}
220+
AzureRMCmdlet.DefaultProfile.Context = new AzureContext(testSubscription, testAccount, environment, testTenant);
202221
}
203222
}
204223

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,24 @@ public string GetMatchingKey(System.Net.Http.HttpRequestMessage request)
5353

5454
public string GetMatchingKey(RecordEntry recordEntry)
5555
{
56-
var encodedPath = recordEntry.EncodedRequestUri;
57-
if (recordEntry.RequestUri.Contains("?&"))
56+
string path = recordEntry.RequestUri;
57+
if(!string.IsNullOrEmpty(recordEntry.EncodedRequestUri))
5858
{
59-
var updatedPath = recordEntry.RequestUri.Replace("?&", "?");
60-
61-
62-
string version;
63-
if (ContainsIgnoredProvider(updatedPath, out version))
64-
{
65-
updatedPath = RemoveOrReplaceApiVersion(updatedPath, version);
66-
}
59+
path = Encoding.UTF8.GetString(Convert.FromBase64String(recordEntry.EncodedRequestUri));
60+
}
6761

68-
encodedPath = Convert.ToBase64String(Encoding.UTF8.GetBytes(updatedPath));
62+
if (path.Contains("?&"))
63+
{
64+
path = path.Replace("?&", "?");
6965
}
7066

67+
string version;
68+
if (ContainsIgnoredProvider(path, out version))
69+
{
70+
path = RemoveOrReplaceApiVersion(path, version);
71+
}
72+
73+
var encodedPath = Convert.ToBase64String(Encoding.UTF8.GetBytes(path));
7174
return string.Format("{0} {1}", recordEntry.RequestMethod, encodedPath);
7275
}
7376

src/ResourceManager/Compute/AzureRM.Compute.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@{
1010

1111
# Version number of this module.
12-
ModuleVersion = '0.9.8'
12+
ModuleVersion = '0.9.10'
1313

1414
# ID used to uniquely identify this module
1515
GUID = '0a83c907-1ffb-4d87-a492-c65ac7d7ed37'
@@ -21,7 +21,7 @@ Author = 'Microsoft Corporation'
2121
CompanyName = 'Microsoft Corporation'
2222

2323
# Copyright statement for this module
24-
Copyright = '© Microsoft Corporation. All rights reserved.'
24+
Copyright = 'Microsoft Corporation. All rights reserved.'
2525

2626
# Description of the functionality provided by this module
2727
Description = 'Microsoft Azure PowerShell - Compute'
@@ -45,7 +45,7 @@ CLRVersion='4.0'
4545
ProcessorArchitecture = 'None'
4646

4747
# Modules that must be imported into the global environment prior to importing this module
48-
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.8' })
48+
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
4949

5050
# Assemblies that must be loaded prior to importing this module
5151
RequiredAssemblies = @()

src/ResourceManager/Compute/Commands.Compute.Test/Common/ComputeTestController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void RunPsTestWorkflow(
9797
string mockName)
9898
{
9999
Dictionary<string, string> d = new Dictionary<string, string>();
100-
d.Add("Microsoft.Authorization", "2014-07-01-preview");
100+
d.Add("Microsoft.Authorization", null);
101101
HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(false, d);
102102

103103
using (UndoContext context = UndoContext.Current)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
55
{
66
public class DscExtensionTests
77
{
8-
[Fact(Skip = "PSGet Migration: TODO: Get-AzureRmSubscription")]
8+
[Fact]
99
[Trait(Category.AcceptanceType, Category.CheckIn)]
1010
public void TestGetAzureRmVMDscExtension()
1111
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
1919
{
2020
public class VirtualMachineProfileTests
2121
{
22-
[Fact(Skip = "PSGet Migration: TODO: Get-AzureRmSubscription")]
22+
[Fact]
2323
[Trait(Category.AcceptanceType, Category.CheckIn)]
2424
public void TestVirtualMachineProfile()
2525
{
2626
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineProfile");
2727
}
2828

29-
[Fact(Skip = "PSGet Migration: TODO: Get-AzureRmSubscription")]
29+
[Fact]
3030
[Trait(Category.AcceptanceType, Category.CheckIn)]
3131
public void TestVirtualMachineProfileWithoutAUC()
3232
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function Test-VirtualMachineProfile
116116
$imgRef = Get-DefaultCRPWindowsImageOffline -loc $loc;
117117
$p = ($imgRef | Set-AzureRmVMSourceImage -VM $p);
118118

119-
$subid = (Get-AzureRmSubscription -Current).SubscriptionId;
119+
$subid = (Get-AzureRmContext).Subscription.SubscriptionId;
120120

121121
$referenceUri = "/subscriptions/" + $subid + "/resourceGroups/RgTest1/providers/Microsoft.KeyVault/vaults/TestVault123";
122122
$certStore = "My";
@@ -283,7 +283,7 @@ function Test-VirtualMachineProfileWithoutAUC
283283
$imgRef = Get-DefaultCRPWindowsImageOffline -loc $loc;
284284
$p = ($imgRef | Set-AzureRmVMSourceImage -VM $p);
285285

286-
$subid = (Get-AzureRmSubscription -Current).SubscriptionId;
286+
$subid = (Get-AzureRmContext).Subscription.SubscriptionId;
287287

288288
$referenceUri = "/subscriptions/" + $subid + "/resourceGroups/RgTest1/providers/Microsoft.KeyVault/vaults/TestVault123";
289289
$certStore = "My";

0 commit comments

Comments
 (0)