From e82498b67fdd03fc4a97e4e2171bc26156427226 Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Wed, 21 Oct 2015 15:59:36 -0700 Subject: [PATCH 1/3] [#105517922] Update Select-AzureRmSubscription to pass in subscriptionId only or subscriptionName only --- .../Context/SetAzureRMContext.cs | 60 +++++++++++++------ .../Models/RMProfileClient.cs | 12 ++-- .../Properties/Resources.Designer.cs | 18 ++++++ .../Properties/Resources.resx | 6 ++ 4 files changed, 74 insertions(+), 22 deletions(-) diff --git a/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs b/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs index a0a4f38fb9b5..603ae5c795d9 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs +++ b/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs @@ -17,38 +17,36 @@ using Microsoft.Azure.Commands.Profile.Models; using Microsoft.Azure.Commands.ResourceManager.Common; using Microsoft.WindowsAzure.Commands.Common; +using Microsoft.Azure.Commands.Profile.Properties; namespace Microsoft.Azure.Commands.Profile { /// /// Cmdlet to change current Azure context. /// - [Cmdlet(VerbsCommon.Set, "AzureRmContext", DefaultParameterSetName =TenantIdAndSubscriptionIdParameterSet)] + [Cmdlet(VerbsCommon.Set, "AzureRmContext", DefaultParameterSetName = SubscriptionNameParameterSet)] [Alias("Select-AzureRmSubscription")] [OutputType(typeof(PSAzureContext))] public class SetAzureRMContextCommand : AzureRMCmdlet { - private const string TenantIdParameterSet = "TenantId"; - private const string SubscriptionIdParameterSet = "Subscription"; - private const string TenantIdAndSubscriptionIdParameterSet = "TenantIdAndSubscriptionId"; + private const string SubscriptionNameParameterSet = "SubscriptionName"; + private const string SubscriptionIdParameterSet = "SubscriptionId"; private const string ContextParameterSet = "Context"; - [Parameter(ParameterSetName = TenantIdParameterSet, Mandatory = false, HelpMessage = "TenantId name or ID", ValueFromPipelineByPropertyName=true)] - [Parameter(ParameterSetName = TenantIdAndSubscriptionIdParameterSet, Mandatory = false, HelpMessage = "TenantId name or ID", ValueFromPipelineByPropertyName=true)] + [Parameter(ParameterSetName = SubscriptionNameParameterSet, Mandatory = false, HelpMessage = "TenantId name or ID", ValueFromPipelineByPropertyName = true)] + [Parameter(ParameterSetName = SubscriptionIdParameterSet, Mandatory = false, HelpMessage = "TenantId name or ID", ValueFromPipelineByPropertyName = true)] [ValidateNotNullOrEmpty] public string TenantId { get; set; } - - [Parameter(ParameterSetName = SubscriptionIdParameterSet, Mandatory = true, HelpMessage = "Subscription", ValueFromPipelineByPropertyName=true)] - [Parameter(ParameterSetName = TenantIdAndSubscriptionIdParameterSet, Mandatory = true, HelpMessage = "Subscription", ValueFromPipelineByPropertyName=true)] + + [Parameter(ParameterSetName = SubscriptionIdParameterSet, Mandatory = true, HelpMessage = "Subscription", ValueFromPipelineByPropertyName = true)] [ValidateNotNullOrEmpty] public string SubscriptionId { get; set; } - [Parameter(ParameterSetName = SubscriptionIdParameterSet, Mandatory = false, HelpMessage = "Subscription Name", ValueFromPipelineByPropertyName=true)] - [Parameter(ParameterSetName = TenantIdAndSubscriptionIdParameterSet, Mandatory = false, HelpMessage = "Subscription Name", ValueFromPipelineByPropertyName=true)] + [Parameter(ParameterSetName = SubscriptionNameParameterSet, Mandatory = true, HelpMessage = "Subscription Name", ValueFromPipelineByPropertyName = true)] [ValidateNotNullOrEmpty] - public string SubscriptionName{ get; set; } - - [Parameter(ParameterSetName = ContextParameterSet, Mandatory = true, HelpMessage = "Context", ValueFromPipeline=true)] + public string SubscriptionName { get; set; } + + [Parameter(ParameterSetName = ContextParameterSet, Mandatory = true, HelpMessage = "Context", ValueFromPipeline = true)] public PSAzureContext Context { get; set; } protected override void ProcessRecord() @@ -58,14 +56,40 @@ protected override void ProcessRecord() AzureRmProfileProvider.Instance.Profile.SetContextWithCache(new AzureContext(Context.Subscription, Context.Account, Context.Environment, Context.Tenant)); } - else + else if (ParameterSetName == SubscriptionNameParameterSet) { var profileClient = new RMProfileClient(AzureRmProfileProvider.Instance.Profile); - profileClient.SetCurrentContext(SubscriptionId, TenantId); - if (!string.IsNullOrWhiteSpace(SubscriptionName)) + AzureSubscription subscription = null; + string tenantId = AzureRmProfileProvider.Instance.Profile.Context.Tenant.Id.ToString(); + + if (string.IsNullOrWhiteSpace(TenantId)) + { + WriteWarning( + string.Format( + Resources.CurrentTenantInUse, + tenantId)); + } + else { - AzureRmProfileProvider.Instance.Profile.Context.Subscription.Name = SubscriptionName; + tenantId = TenantId; } + + if (!profileClient.TryGetSubscriptionByName( + tenantId, + SubscriptionName, + out subscription)) + { + throw new ItemNotFoundException( + string.Format(Resources.SubscriptionNameNotFoundError, SubscriptionName)); + } + + profileClient.SetCurrentContext(subscription.Id.ToString(), tenantId, verifySubscription: false); + AzureRmProfileProvider.Instance.Profile.Context.Subscription.Name = SubscriptionName; + } + else if (ParameterSetName == SubscriptionIdParameterSet) + { + var profileClient = new RMProfileClient(AzureRmProfileProvider.Instance.Profile); + profileClient.SetCurrentContext(SubscriptionId, TenantId); } WriteObject((PSAzureContext)AzureRmProfileProvider.Instance.Profile.Context); } diff --git a/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs b/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs index dcec21991609..de7e6a3dfb4e 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs +++ b/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs @@ -101,7 +101,7 @@ public AzureRMProfile Login(AzureAccount account, AzureEnvironment environment, return _profile; } - public AzureContext SetCurrentContext(string subscriptionId, string tenantId) + public AzureContext SetCurrentContext(string subscriptionId, string tenantId, bool verifySubscription = true) { if (!string.IsNullOrWhiteSpace(tenantId)) { @@ -123,8 +123,12 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId) if (!string.IsNullOrWhiteSpace(subscriptionId)) { - if (!ListSubscriptions(_profile.Context.Tenant.Id.ToString()).Any(s => - string.Equals(s.Id.ToString(), subscriptionId, StringComparison.OrdinalIgnoreCase) ) ) + var subscription = ListSubscriptions(_profile.Context.Tenant.Id.ToString()) + .FirstOrDefault(s => + string.Equals(s.Id.ToString(), subscriptionId, StringComparison.OrdinalIgnoreCase)); + + if (verifySubscription && + subscription == null) { throw new ArgumentException(string.Format( "Provided subscription {0} does not exist under current tenant {1}", subscriptionId, _profile.Context.Tenant.Id)); @@ -136,7 +140,7 @@ public AzureContext SetCurrentContext(string subscriptionId, string tenantId) newSubscription.Account = _profile.Context.Subscription.Account; newSubscription.Environment = _profile.Context.Subscription.Environment; newSubscription.Properties = _profile.Context.Subscription.Properties; - newSubscription.Name = null; + newSubscription.Name = (subscription == null) ? null : subscription.Name; } _profile.SetContextWithCache(new AzureContext( diff --git a/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.Designer.cs b/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.Designer.cs index 4a66c728e1aa..3fcf05ff0618 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.Designer.cs +++ b/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.Designer.cs @@ -105,6 +105,15 @@ internal static string CommonTenantAuthFailed { } } + /// + /// Looks up a localized string similar to Current tenant with Id '{0}' will be used.. + /// + internal static string CurrentTenantInUse { + get { + return ResourceManager.GetString("CurrentTenantInUse", resourceCulture); + } + } + /// /// Looks up a localized string similar to The provided subscription ID "{0}" is not a valid Guid.. /// @@ -132,6 +141,15 @@ internal static string NoValidTenant { } } + /// + /// Looks up a localized string similar to Unable to find subscription with name '{0}'.. + /// + internal static string SubscriptionNameNotFoundError { + get { + return ResourceManager.GetString("SubscriptionNameNotFoundError", resourceCulture); + } + } + /// /// Looks up a localized string similar to Subscription {0} was not found in tenant {1}. Please verify that the subscription exists in this tenant.. /// diff --git a/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.resx b/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.resx index 9e39364a5eff..56f05dacb496 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.resx +++ b/src/ResourceManager/Profile/Commands.Profile/Properties/Resources.resx @@ -132,6 +132,9 @@ Could not authenticate your user account {0} with the common tenant. Please login again using Login-AzureRmAccount. + + Current tenant with Id '{0}' will be used. + The provided subscription ID "{0}" is not a valid Guid. @@ -141,6 +144,9 @@ Please provide a valid tenant Id on the command line or execute Login-AzureRmAccount. + + Unable to find subscription with name '{0}'. + Subscription {0} was not found in tenant {1}. Please verify that the subscription exists in this tenant. From c5c79e292da882bb0b18fd1a7affdb4e37595aaa Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Wed, 21 Oct 2015 16:44:33 -0700 Subject: [PATCH 2/3] Fixed failing tests --- .../ContextCmdletTests.cs | 6 +- .../PipingWithRmContextWorks.json | 160 ++++++++++++++---- 2 files changed, 132 insertions(+), 34 deletions(-) diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/ContextCmdletTests.cs b/src/ResourceManager/Profile/Commands.Profile.Test/ContextCmdletTests.cs index 462f785dd2ed..08878f8fbd46 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/ContextCmdletTests.cs +++ b/src/ResourceManager/Profile/Commands.Profile.Test/ContextCmdletTests.cs @@ -24,6 +24,7 @@ using System; using Microsoft.Azure.Commands.Profile.Models; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; +using System.Management.Automation; namespace Microsoft.Azure.Commands.ResourceManager.Profile.Test { @@ -58,7 +59,7 @@ public void GetAzureContext() var context = (PSAzureContext) commandRuntimeMock.OutputPipeline[0]; Assert.Equal("test", context.Subscription.SubscriptionName); } - + [Fact] [Trait(Category.AcceptanceType, Category.CheckIn)] public void SelectAzureContextWithNoSubscriptionAndTenant() @@ -76,7 +77,8 @@ public void SelectAzureContextWithNoSubscriptionAndTenant() // Verify Assert.True(commandRuntimeMock.OutputPipeline.Count == 1); var context = (PSAzureContext)commandRuntimeMock.OutputPipeline[0]; - Assert.Equal("72f988bf-86f1-41af-91ab-2d7cd011db47", context.Tenant.TenantId); + // TenantId is not sufficient to change the context. + Assert.NotEqual("72f988bf-86f1-41af-91ab-2d7cd011db47", context.Tenant.TenantId); } [Fact] diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json b/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json index c81f631c6bd2..b4dd48c3dc57 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json +++ b/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json @@ -10,10 +10,10 @@ "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"subscriptionId\": \"279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"displayName\": \"Azure SDK CI\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"subscriptionId\": \"69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"displayName\": \"WebStackAndEF_TestInfra\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"subscriptionId\": \"9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"displayName\": \"FISMA Pen Testing Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"subscriptionId\": \"c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"displayName\": \"Azure SDK Powershell Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"subscriptionId\": \"d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"displayName\": \"Test Subscription 1 for Migration\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"subscriptionId\": \"b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"displayName\": \"XFD Data Systems - Public\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Length": [ - "2747" + "1081" ], "Content-Type": [ "application/json; charset=utf-8" @@ -25,16 +25,16 @@ "no-cache" ], "x-ms-ratelimit-remaining-tenant-reads": [ - "14994" + "14997" ], "x-ms-request-id": [ - "6a51dccb-b1f8-4484-a75b-2dc9c62a91f3" + "284d131d-ec1d-473e-82b2-022824dbd382" ], "x-ms-correlation-request-id": [ - "6a51dccb-b1f8-4484-a75b-2dc9c62a91f3" + "284d131d-ec1d-473e-82b2-022824dbd382" ], "x-ms-routing-request-id": [ - "WESTUS:20151002T035449Z:6a51dccb-b1f8-4484-a75b-2dc9c62a91f3" + "WESTUS:20151022T003227Z:284d131d-ec1d-473e-82b2-022824dbd382" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -43,7 +43,7 @@ "no-cache" ], "Date": [ - "Fri, 02 Oct 2015 03:54:49 GMT" + "Thu, 22 Oct 2015 00:32:27 GMT" ] }, "StatusCode": 200 @@ -58,10 +58,10 @@ "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"subscriptionId\": \"279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"displayName\": \"Azure SDK CI\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"subscriptionId\": \"69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"displayName\": \"WebStackAndEF_TestInfra\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"subscriptionId\": \"9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"displayName\": \"FISMA Pen Testing Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"subscriptionId\": \"c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"displayName\": \"Azure SDK Powershell Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"subscriptionId\": \"d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"displayName\": \"Test Subscription 1 for Migration\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"subscriptionId\": \"b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"displayName\": \"XFD Data Systems - Public\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Length": [ - "2747" + "1081" ], "Content-Type": [ "application/json; charset=utf-8" @@ -73,16 +73,16 @@ "no-cache" ], "x-ms-ratelimit-remaining-tenant-reads": [ - "14993" + "14996" ], "x-ms-request-id": [ - "7d01be5f-25e0-4246-abab-9565e9bf07bb" + "55b62765-1a90-4adf-86a8-68ad7640328a" ], "x-ms-correlation-request-id": [ - "7d01be5f-25e0-4246-abab-9565e9bf07bb" + "55b62765-1a90-4adf-86a8-68ad7640328a" ], "x-ms-routing-request-id": [ - "WESTUS:20151002T035450Z:7d01be5f-25e0-4246-abab-9565e9bf07bb" + "WESTUS:20151022T003228Z:55b62765-1a90-4adf-86a8-68ad7640328a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -91,7 +91,7 @@ "no-cache" ], "Date": [ - "Fri, 02 Oct 2015 03:54:49 GMT" + "Thu, 22 Oct 2015 00:32:28 GMT" ] }, "StatusCode": 200 @@ -106,10 +106,10 @@ "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"subscriptionId\": \"279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"displayName\": \"Azure SDK CI\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"subscriptionId\": \"69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"displayName\": \"WebStackAndEF_TestInfra\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"subscriptionId\": \"9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"displayName\": \"FISMA Pen Testing Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"subscriptionId\": \"c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"displayName\": \"Azure SDK Powershell Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"subscriptionId\": \"d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"displayName\": \"Test Subscription 1 for Migration\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"subscriptionId\": \"b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"displayName\": \"XFD Data Systems - Public\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Length": [ - "2747" + "1081" ], "Content-Type": [ "application/json; charset=utf-8" @@ -121,16 +121,112 @@ "no-cache" ], "x-ms-ratelimit-remaining-tenant-reads": [ - "14992" + "14995" + ], + "x-ms-request-id": [ + "e56eae11-deb0-40ff-8247-33e26f6584d4" + ], + "x-ms-correlation-request-id": [ + "e56eae11-deb0-40ff-8247-33e26f6584d4" + ], + "x-ms-routing-request-id": [ + "WESTUS:20151022T003236Z:e56eae11-deb0-40ff-8247-33e26f6584d4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Oct 2015 00:32:36 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions?api-version=2014-04-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1081" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14994" + ], + "x-ms-request-id": [ + "dc675c1b-2b93-46f0-8398-71b55a651c1c" + ], + "x-ms-correlation-request-id": [ + "dc675c1b-2b93-46f0-8398-71b55a651c1c" + ], + "x-ms-routing-request-id": [ + "WESTUS:20151022T003237Z:dc675c1b-2b93-46f0-8398-71b55a651c1c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Oct 2015 00:32:37 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions?api-version=2014-04-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1081" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14993" ], "x-ms-request-id": [ - "e33163a6-34c3-4f09-80ba-2f7f827c9415" + "c2c75a0f-db5e-4899-8957-699be8cab5d6" ], "x-ms-correlation-request-id": [ - "e33163a6-34c3-4f09-80ba-2f7f827c9415" + "c2c75a0f-db5e-4899-8957-699be8cab5d6" ], "x-ms-routing-request-id": [ - "WESTUS:20151002T035450Z:e33163a6-34c3-4f09-80ba-2f7f827c9415" + "WESTUS:20151022T003238Z:c2c75a0f-db5e-4899-8957-699be8cab5d6" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -139,7 +235,7 @@ "no-cache" ], "Date": [ - "Fri, 02 Oct 2015 03:54:49 GMT" + "Thu, 22 Oct 2015 00:32:38 GMT" ] }, "StatusCode": 200 @@ -154,10 +250,10 @@ "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"subscriptionId\": \"279b0675-cf67-467f-98f0-67ae31eb540f\",\r\n \"displayName\": \"Azure SDK CI\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"subscriptionId\": \"69801886-4b2b-493b-ba5b-3b26dabadadc\",\r\n \"displayName\": \"WebStackAndEF_TestInfra\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"subscriptionId\": \"9ed7cca5-c306-4f66-9d1c-2766e67013d8\",\r\n \"displayName\": \"FISMA Pen Testing Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"subscriptionId\": \"c9cbd920-c00c-427c-852b-8aaf38badaeb\",\r\n \"displayName\": \"Azure SDK Powershell Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"subscriptionId\": \"d1e52cbc-b073-42e2-a0a0-c2f547118a6e\",\r\n \"displayName\": \"Test Subscription 1 for Migration\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"subscriptionId\": \"b6b78feb-3074-4129-8748-42cee6c73020\",\r\n \"displayName\": \"XFD Data Systems - Public\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Length": [ - "2747" + "1081" ], "Content-Type": [ "application/json; charset=utf-8" @@ -169,16 +265,16 @@ "no-cache" ], "x-ms-ratelimit-remaining-tenant-reads": [ - "14991" + "14992" ], "x-ms-request-id": [ - "6a858a8b-5996-41e3-96f6-f13bfb8d607d" + "5ad9419b-700e-4541-9599-356c1a8fd765" ], "x-ms-correlation-request-id": [ - "6a858a8b-5996-41e3-96f6-f13bfb8d607d" + "5ad9419b-700e-4541-9599-356c1a8fd765" ], "x-ms-routing-request-id": [ - "WESTUS:20151002T035450Z:6a858a8b-5996-41e3-96f6-f13bfb8d607d" + "WESTUS:20151022T003239Z:5ad9419b-700e-4541-9599-356c1a8fd765" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -187,7 +283,7 @@ "no-cache" ], "Date": [ - "Fri, 02 Oct 2015 03:54:50 GMT" + "Thu, 22 Oct 2015 00:32:39 GMT" ] }, "StatusCode": 200 @@ -220,13 +316,13 @@ "14999" ], "x-ms-request-id": [ - "ff94ac85-24fd-4d59-936c-90a4bbe24ebe" + "6c65c5d8-7009-4a55-8eae-7433886b8425" ], "x-ms-correlation-request-id": [ - "ff94ac85-24fd-4d59-936c-90a4bbe24ebe" + "6c65c5d8-7009-4a55-8eae-7433886b8425" ], "x-ms-routing-request-id": [ - "WESTUS:20151002T035450Z:ff94ac85-24fd-4d59-936c-90a4bbe24ebe" + "WESTUS:20151022T003238Z:6c65c5d8-7009-4a55-8eae-7433886b8425" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -235,7 +331,7 @@ "no-cache" ], "Date": [ - "Fri, 02 Oct 2015 03:54:49 GMT" + "Thu, 22 Oct 2015 00:32:37 GMT" ] }, "StatusCode": 200 From 3f2656b6bea2fd8819b1cbb993e650c2736b4faf Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Thu, 22 Oct 2015 11:07:40 -0700 Subject: [PATCH 3/3] Addressing review comments --- .../PipingWithRmContextWorks.json | 152 ++++++++++++++---- .../SubscriptionCmdletTests.ps1 | 6 + .../Context/SetAzureRMContext.cs | 2 +- 3 files changed, 131 insertions(+), 29 deletions(-) diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json b/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json index b4dd48c3dc57..4a6878776774 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json +++ b/src/ResourceManager/Profile/Commands.Profile.Test/SessionRecords/Microsoft.Azure.Commands.Profile.Test.SubscriptionCmdletTests/PipingWithRmContextWorks.json @@ -1,5 +1,101 @@ { "Entries": [ + { + "RequestUri": "/subscriptions?api-version=2014-04-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1081" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14999" + ], + "x-ms-request-id": [ + "ab8756d0-4404-4a60-ae6e-2653656c0b23" + ], + "x-ms-correlation-request-id": [ + "ab8756d0-4404-4a60-ae6e-2653656c0b23" + ], + "x-ms-routing-request-id": [ + "WESTUS:20151022T180626Z:ab8756d0-4404-4a60-ae6e-2653656c0b23" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Oct 2015 18:06:26 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions?api-version=2014-04-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"subscriptionId\": \"00977cdb-163f-435f-9c32-39ec8ae61f4d\",\r\n \"displayName\": \"node\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"subscriptionId\": \"2c224e7e-3ef5-431d-a57b-e71f4662e3a6\",\r\n \"displayName\": \"Node CLI Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"subscriptionId\": \"6b085460-5f21-477e-ba44-1035046e9101\",\r\n \"displayName\": \"Azure SDK Infrastructure\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"subscriptionId\": \"db1ab6f0-4769-4b27-930e-01e2ef9c123c\",\r\n \"displayName\": \"Azure SDK sandbox\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1081" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-tenant-reads": [ + "14998" + ], + "x-ms-request-id": [ + "26b98034-05ee-4844-ac72-a8c02a305858" + ], + "x-ms-correlation-request-id": [ + "26b98034-05ee-4844-ac72-a8c02a305858" + ], + "x-ms-routing-request-id": [ + "WESTUS:20151022T180627Z:26b98034-05ee-4844-ac72-a8c02a305858" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Thu, 22 Oct 2015 18:06:26 GMT" + ] + }, + "StatusCode": 200 + }, { "RequestUri": "/subscriptions?api-version=2014-04-01-preview", "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3", @@ -28,13 +124,13 @@ "14997" ], "x-ms-request-id": [ - "284d131d-ec1d-473e-82b2-022824dbd382" + "af0e42bf-875b-4457-963e-24fa3470061e" ], "x-ms-correlation-request-id": [ - "284d131d-ec1d-473e-82b2-022824dbd382" + "af0e42bf-875b-4457-963e-24fa3470061e" ], "x-ms-routing-request-id": [ - "WESTUS:20151022T003227Z:284d131d-ec1d-473e-82b2-022824dbd382" + "WESTUS:20151022T180627Z:af0e42bf-875b-4457-963e-24fa3470061e" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -43,7 +139,7 @@ "no-cache" ], "Date": [ - "Thu, 22 Oct 2015 00:32:27 GMT" + "Thu, 22 Oct 2015 18:06:27 GMT" ] }, "StatusCode": 200 @@ -76,13 +172,13 @@ "14996" ], "x-ms-request-id": [ - "55b62765-1a90-4adf-86a8-68ad7640328a" + "4bc6ff63-684d-423f-87c4-ede93d0b098a" ], "x-ms-correlation-request-id": [ - "55b62765-1a90-4adf-86a8-68ad7640328a" + "4bc6ff63-684d-423f-87c4-ede93d0b098a" ], "x-ms-routing-request-id": [ - "WESTUS:20151022T003228Z:55b62765-1a90-4adf-86a8-68ad7640328a" + "WESTUS:20151022T180627Z:4bc6ff63-684d-423f-87c4-ede93d0b098a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -91,7 +187,7 @@ "no-cache" ], "Date": [ - "Thu, 22 Oct 2015 00:32:28 GMT" + "Thu, 22 Oct 2015 18:06:27 GMT" ] }, "StatusCode": 200 @@ -124,13 +220,13 @@ "14995" ], "x-ms-request-id": [ - "e56eae11-deb0-40ff-8247-33e26f6584d4" + "20764464-9863-4fc0-9228-3bacb5690b52" ], "x-ms-correlation-request-id": [ - "e56eae11-deb0-40ff-8247-33e26f6584d4" + "20764464-9863-4fc0-9228-3bacb5690b52" ], "x-ms-routing-request-id": [ - "WESTUS:20151022T003236Z:e56eae11-deb0-40ff-8247-33e26f6584d4" + "WESTUS:20151022T180628Z:20764464-9863-4fc0-9228-3bacb5690b52" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -139,7 +235,7 @@ "no-cache" ], "Date": [ - "Thu, 22 Oct 2015 00:32:36 GMT" + "Thu, 22 Oct 2015 18:06:27 GMT" ] }, "StatusCode": 200 @@ -172,13 +268,13 @@ "14994" ], "x-ms-request-id": [ - "dc675c1b-2b93-46f0-8398-71b55a651c1c" + "dc63ecd4-c5ee-46a4-876e-fb6ffc3ac8fe" ], "x-ms-correlation-request-id": [ - "dc675c1b-2b93-46f0-8398-71b55a651c1c" + "dc63ecd4-c5ee-46a4-876e-fb6ffc3ac8fe" ], "x-ms-routing-request-id": [ - "WESTUS:20151022T003237Z:dc675c1b-2b93-46f0-8398-71b55a651c1c" + "WESTUS:20151022T180628Z:dc63ecd4-c5ee-46a4-876e-fb6ffc3ac8fe" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -187,7 +283,7 @@ "no-cache" ], "Date": [ - "Thu, 22 Oct 2015 00:32:37 GMT" + "Thu, 22 Oct 2015 18:06:28 GMT" ] }, "StatusCode": 200 @@ -220,13 +316,13 @@ "14993" ], "x-ms-request-id": [ - "c2c75a0f-db5e-4899-8957-699be8cab5d6" + "2ee70574-ce24-40e7-81a2-d94a9f7bd48b" ], "x-ms-correlation-request-id": [ - "c2c75a0f-db5e-4899-8957-699be8cab5d6" + "2ee70574-ce24-40e7-81a2-d94a9f7bd48b" ], "x-ms-routing-request-id": [ - "WESTUS:20151022T003238Z:c2c75a0f-db5e-4899-8957-699be8cab5d6" + "WESTUS:20151022T180629Z:2ee70574-ce24-40e7-81a2-d94a9f7bd48b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -235,7 +331,7 @@ "no-cache" ], "Date": [ - "Thu, 22 Oct 2015 00:32:38 GMT" + "Thu, 22 Oct 2015 18:06:28 GMT" ] }, "StatusCode": 200 @@ -268,13 +364,13 @@ "14992" ], "x-ms-request-id": [ - "5ad9419b-700e-4541-9599-356c1a8fd765" + "fc489996-6e3a-42c3-9a2f-8c4d13daf330" ], "x-ms-correlation-request-id": [ - "5ad9419b-700e-4541-9599-356c1a8fd765" + "fc489996-6e3a-42c3-9a2f-8c4d13daf330" ], "x-ms-routing-request-id": [ - "WESTUS:20151022T003239Z:5ad9419b-700e-4541-9599-356c1a8fd765" + "WESTUS:20151022T180629Z:fc489996-6e3a-42c3-9a2f-8c4d13daf330" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -283,7 +379,7 @@ "no-cache" ], "Date": [ - "Thu, 22 Oct 2015 00:32:39 GMT" + "Thu, 22 Oct 2015 18:06:28 GMT" ] }, "StatusCode": 200 @@ -316,13 +412,13 @@ "14999" ], "x-ms-request-id": [ - "6c65c5d8-7009-4a55-8eae-7433886b8425" + "6830d8eb-637a-4150-b016-7aa4f69013de" ], "x-ms-correlation-request-id": [ - "6c65c5d8-7009-4a55-8eae-7433886b8425" + "6830d8eb-637a-4150-b016-7aa4f69013de" ], "x-ms-routing-request-id": [ - "WESTUS:20151022T003238Z:6c65c5d8-7009-4a55-8eae-7433886b8425" + "WESTUS:20151022T180627Z:6830d8eb-637a-4150-b016-7aa4f69013de" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -331,7 +427,7 @@ "no-cache" ], "Date": [ - "Thu, 22 Oct 2015 00:32:37 GMT" + "Thu, 22 Oct 2015 18:06:27 GMT" ] }, "StatusCode": 200 diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/SubscriptionCmdletTests.ps1 b/src/ResourceManager/Profile/Commands.Profile.Test/SubscriptionCmdletTests.ps1 index e43d95ad10b5..433413fd5d42 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/SubscriptionCmdletTests.ps1 +++ b/src/ResourceManager/Profile/Commands.Profile.Test/SubscriptionCmdletTests.ps1 @@ -52,6 +52,7 @@ function Test-PipingWithContext $name = $firstSubscription.SubscriptionName $nameContext = Get-AzureRmSubscription -SubscriptionName $name | Set-AzureRmContext $idContext = Get-AzureRmSubscription -SubscriptionId $id | Set-AzureRmContext + $contextByName = Set-AzureRmContext -SubscriptionName $name Assert-True { $nameContext -ne $null } Assert-True { $nameContext.Subscription -ne $null } Assert-True { $nameContext.Subscription.SubscriptionId -ne $null } @@ -62,6 +63,11 @@ function Test-PipingWithContext Assert-True { $idContext.Subscription.SubscriptionName -ne $null } Assert-AreEqual $idContext.Subscription.SubscriptionId $nameContext.Subscription.SubscriptionId Assert-AreEqual $idContext.Subscription.SubscriptionName $nameContext.Subscription.SubscriptionName + Assert-True { $contextByName -ne $null } + Assert-True { $contextByName.Subscription -ne $null } + Assert-True { $contextByName.Subscription.SubscriptionId -ne $null } + Assert-True { $contextByName.Subscription.SubscriptionName -ne $null } + Assert-AreEqual $contextByName.Subscription.SubscriptionName $nameContext.Subscription.SubscriptionName } function Test-SetAzureRmContextEndToEnd diff --git a/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs b/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs index 603ae5c795d9..43f4362a9f60 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs +++ b/src/ResourceManager/Profile/Commands.Profile/Context/SetAzureRMContext.cs @@ -64,7 +64,7 @@ protected override void ProcessRecord() if (string.IsNullOrWhiteSpace(TenantId)) { - WriteWarning( + WriteVerbose( string.Format( Resources.CurrentTenantInUse, tenantId));