diff --git a/build.proj b/build.proj
index f9b9a39c8122..71eab86ca827 100644
--- a/build.proj
+++ b/build.proj
@@ -90,24 +90,12 @@
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi
index 05a52b0633ba..d78db5c29e82 100644
--- a/setup/azurecmdfiles.wxi
+++ b/setup/azurecmdfiles.wxi
@@ -20,12 +20,12 @@
+
+
+
-
-
-
@@ -82,12 +82,12 @@
+
+
+
-
-
-
@@ -97,15 +97,6 @@
-
-
-
-
-
-
-
-
-
@@ -177,30 +168,18 @@
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -210,9 +189,6 @@
-
-
-
@@ -222,9 +198,6 @@
-
-
-
@@ -239,12 +212,12 @@
+
+
+
-
-
-
@@ -293,9 +266,6 @@
-
-
-
@@ -310,12 +280,12 @@
+
+
+
-
-
-
@@ -438,12 +408,12 @@
+
+
+
-
-
-
@@ -474,15 +444,6 @@
-
-
-
-
-
-
-
-
-
@@ -543,9 +504,6 @@
-
-
-
@@ -557,12 +515,12 @@
+
+
+
-
-
-
@@ -634,12 +592,12 @@
+
+
+
-
-
-
@@ -649,15 +607,6 @@
-
-
-
-
-
-
-
-
-
@@ -703,9 +652,6 @@
-
-
-
@@ -720,12 +666,12 @@
+
+
+
-
-
-
@@ -813,18 +759,15 @@
+
+
+
-
-
-
-
-
-
@@ -846,6 +789,9 @@
+
+
+
@@ -929,12 +875,12 @@
+
+
+
-
-
-
@@ -1102,12 +1048,12 @@
+
+
+
-
-
-
@@ -1164,12 +1110,12 @@
+
+
+
-
-
-
@@ -1316,12 +1262,12 @@
+
+
+
-
-
-
@@ -1468,12 +1414,12 @@
+
+
+
-
-
-
@@ -1545,12 +1491,12 @@
+
+
+
-
-
-
@@ -1652,12 +1598,12 @@
+
+
+
-
-
-
@@ -2114,12 +2060,12 @@
+
+
+
-
-
-
@@ -2281,12 +2227,12 @@
+
+
+
-
-
-
@@ -2370,18 +2316,15 @@
+
+
+
-
-
-
-
-
-
@@ -2432,12 +2375,12 @@
+
+
+
-
-
-
@@ -2513,8 +2456,8 @@
+
-
@@ -2533,14 +2476,11 @@
+
-
-
-
-
@@ -2564,28 +2504,22 @@
+
-
-
-
-
-
-
-
+
-
@@ -2602,13 +2536,12 @@
-
+
-
@@ -2649,8 +2582,8 @@
+
-
@@ -2661,9 +2594,6 @@
-
-
-
@@ -2684,12 +2614,11 @@
-
+
-
@@ -2713,14 +2642,11 @@
+
-
-
-
-
@@ -2736,13 +2662,12 @@
-
+
-
@@ -2770,10 +2695,9 @@
+
-
-
@@ -2781,6 +2705,7 @@
+
@@ -2808,8 +2733,8 @@
+
-
@@ -2865,8 +2790,8 @@
+
-
@@ -2885,8 +2810,8 @@
+
-
@@ -2935,8 +2860,8 @@
+
-
@@ -2985,8 +2910,8 @@
+
-
@@ -3010,8 +2935,8 @@
+
-
@@ -3045,8 +2970,8 @@
+
-
@@ -3187,8 +3112,8 @@
+
-
@@ -3242,8 +3167,8 @@
+
-
@@ -3271,10 +3196,9 @@
+
-
-
@@ -3291,8 +3215,8 @@
+
-
diff --git a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj
index 7c7db64eb253..8ca5d7337b7c 100644
--- a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj
+++ b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj
@@ -50,19 +50,19 @@
False
- ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
False
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
False
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -77,12 +77,12 @@
..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/Common/Commands.Common.Storage/WindowsAzureSubscriptionExtensions.cs b/src/Common/Commands.Common.Storage/WindowsAzureSubscriptionExtensions.cs
index 9e9294f98d9b..0ba9d67a5da3 100644
--- a/src/Common/Commands.Common.Storage/WindowsAzureSubscriptionExtensions.cs
+++ b/src/Common/Commands.Common.Storage/WindowsAzureSubscriptionExtensions.cs
@@ -15,11 +15,11 @@
using System;
using System.Collections.Generic;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Storage;
using Microsoft.WindowsAzure.Management.Storage;
using Microsoft.WindowsAzure.Storage;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
{
@@ -27,14 +27,14 @@ public static class WindowsAzureSubscriptionExtensions
{
private static Dictionary storageAccountCache = new Dictionary();
- public static CloudStorageAccount GetCloudStorageAccount(this AzureSubscription subscription)
+ public static CloudStorageAccount GetCloudStorageAccount(this AzureSubscription subscription, AzureProfile profile)
{
if (subscription == null)
{
return null;
}
- using (var storageClient = AzureSession.ClientFactory.CreateClient(subscription, AzureEnvironment.Endpoint.ServiceManagement))
+ using (var storageClient = AzureSession.ClientFactory.CreateClient(profile, subscription, AzureEnvironment.Endpoint.ServiceManagement))
{
return StorageUtilities.GenerateCloudStorageAccount(
storageClient, subscription.GetProperty(AzureSubscription.Property.StorageAccount));
diff --git a/src/Common/Commands.Common.Storage/packages.config b/src/Common/Commands.Common.Storage/packages.config
index 3b37ad98079a..04635ae33785 100644
--- a/src/Common/Commands.Common.Storage/packages.config
+++ b/src/Common/Commands.Common.Storage/packages.config
@@ -1,9 +1,9 @@
-
-
+
+
-
+
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj
index 72de007a39a1..f19e4cd484ed 100644
--- a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj
+++ b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj
@@ -49,24 +49,24 @@
- ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
False
- ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll
@@ -77,13 +77,13 @@
..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
-
+
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
@@ -156,7 +156,6 @@
-
diff --git a/src/Common/Commands.Common.Test/Common/AuthenticationFactoryTests.cs b/src/Common/Commands.Common.Test/Common/AuthenticationFactoryTests.cs
index 1c40dff9da38..787e2da883bc 100644
--- a/src/Common/Commands.Common.Test/Common/AuthenticationFactoryTests.cs
+++ b/src/Common/Commands.Common.Test/Common/AuthenticationFactoryTests.cs
@@ -15,10 +15,10 @@
using System.Collections.Generic;
using Xunit;
using System;
-using Microsoft.Azure.Common.Extensions.Factories;
+using Microsoft.Azure.Common.Authentication.Factories;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
-using Microsoft.Azure.Common.Extensions.Authentication;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
{
@@ -34,10 +34,16 @@ public void VerifySubscriptionTokenCacheRemove()
var subscriptionId = Guid.NewGuid();
- var credential = authFactory.GetSubscriptionCloudCredentials(new AzureContext
- {
- Environment = AzureEnvironment.PublicEnvironments["AzureCloud"],
- Account = new AzureAccount
+ var credential = authFactory.GetSubscriptionCloudCredentials(new AzureContext(
+ new AzureSubscription
+ {
+ Id = subscriptionId,
+ Properties = new Dictionary
+ {
+ { AzureSubscription.Property.Tenants, "123"}
+ }
+ },
+ new AzureAccount
{
Id = "testuser",
Type = AzureAccount.AccountType.User,
@@ -46,16 +52,9 @@ public void VerifySubscriptionTokenCacheRemove()
{ AzureAccount.Property.Tenants, "123" }
}
},
- Subscription = new AzureSubscription
- {
- Id = subscriptionId,
- Properties = new Dictionary
- {
- { AzureSubscription.Property.Tenants, "123"}
- }
- }
+ AzureEnvironment.PublicEnvironments["AzureCloud"]
- });
+ ));
Assert.True(credential is AccessTokenCredential);
Assert.Equal(subscriptionId, new Guid(((AccessTokenCredential)credential).SubscriptionId));
diff --git a/src/Common/Commands.Common.Test/Common/ConversionUtilitiesTests.cs b/src/Common/Commands.Common.Test/Common/ConversionUtilitiesTests.cs
index 68cf9479d686..72d0961ad985 100644
--- a/src/Common/Commands.Common.Test/Common/ConversionUtilitiesTests.cs
+++ b/src/Common/Commands.Common.Test/Common/ConversionUtilitiesTests.cs
@@ -15,7 +15,7 @@
using System.Collections.Generic;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Xunit;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Common.Test
{
diff --git a/src/Common/Commands.Common.Test/Common/Data.cs b/src/Common/Commands.Common.Test/Common/Data.cs
index 18c6d3189341..65a7e521ebbd 100644
--- a/src/Common/Commands.Common.Test/Common/Data.cs
+++ b/src/Common/Commands.Common.Test/Common/Data.cs
@@ -20,7 +20,7 @@
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
{
@@ -66,7 +66,7 @@ public static class Data
static Data()
{
- AzureAppDir = Path.Combine(Directory.GetCurrentDirectory(), Resources.AzureDirectoryName);
+ AzureAppDir = AzureSession.ProfileDirectory;
AzureSdkAppDir = Path.Combine(Directory.GetCurrentDirectory(), "Microsoft Azure PowerShell");
TestResultDirectory = FileUtilities.GetAssemblyDirectory();
diff --git a/src/Common/Commands.Common.Test/Common/GeneralTests.cs b/src/Common/Commands.Common.Test/Common/GeneralTests.cs
index 52c47af4e469..a6497020f8c5 100644
--- a/src/Common/Commands.Common.Test/Common/GeneralTests.cs
+++ b/src/Common/Commands.Common.Test/Common/GeneralTests.cs
@@ -16,7 +16,7 @@
using System.IO;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Xunit;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
{
diff --git a/src/Common/Commands.Common.Test/Common/JsonUtilitiesTests.cs b/src/Common/Commands.Common.Test/Common/JsonUtilitiesTests.cs
index 9d01c351e8e7..bb6345ef2b3d 100644
--- a/src/Common/Commands.Common.Test/Common/JsonUtilitiesTests.cs
+++ b/src/Common/Commands.Common.Test/Common/JsonUtilitiesTests.cs
@@ -19,7 +19,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
{
diff --git a/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs b/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs
deleted file mode 100644
index 334469eefacf..000000000000
--- a/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs
+++ /dev/null
@@ -1,1692 +0,0 @@
-// ----------------------------------------------------------------------------------
-//
-// Copyright Microsoft Corporation
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ----------------------------------------------------------------------------------
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Microsoft.Azure.Subscriptions.Models;
-using Microsoft.Azure.Common.Extensions.Models;
-using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
-using Microsoft.WindowsAzure.Commands.Profile;
-using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions.Authentication;
-using Xunit;
-using Microsoft.Azure.Common.Extensions;
-
-namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
-{
- public class ProfileClientTests
- {
- private string oldProfileData;
- private string oldProfileDataBadSubscription;
- private string oldProfileDataCorruptedFile;
- private string oldProfileDataPath;
- private string oldProfileDataPathError;
- private string newProfileDataPath;
- private string jsonProfileWithoutAccount;
- private string jsonProfileWithBadData;
- private string defaultSubscription = "06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F";
- private WindowsAzure.Subscriptions.Models.SubscriptionListOperationResponse.Subscription rdfeSubscription1;
- private WindowsAzure.Subscriptions.Models.SubscriptionListOperationResponse.Subscription rdfeSubscription2;
- private Azure.Subscriptions.Models.Subscription csmSubscription1;
- private Azure.Subscriptions.Models.Subscription csmSubscription1withDuplicateId;
- private Azure.Subscriptions.Models.Subscription csmSubscription2;
- private AzureSubscription azureSubscription1;
- private AzureSubscription azureSubscription2;
- private AzureSubscription azureSubscription3withoutUser;
- private AzureEnvironment azureEnvironment;
- private AzureAccount azureAccount;
- private TenantIdDescription commonTenant;
- private TenantIdDescription guestTenant;
- private Subscriptions.Models.SubscriptionListOperationResponse.Subscription guestRdfeSubscription;
- private Subscription guestCsmSubscription;
-
- public ProfileClientTests()
- {
- SetMockData();
- AzureSession.SetCurrentContext(null, null, null);
- }
-
- [Fact]
- public void ProfileGetsCreatedWithNonExistingFile()
- {
- ProfileClient.DataStore = new MockDataStore();
- ProfileClient client = new ProfileClient();
- }
-
- [Fact]
- public void ProfileMigratesOldData()
- {
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- Assert.False(dataStore.FileExists(oldProfileDataPath));
- Assert.True(dataStore.FileExists(newProfileDataPath));
- }
-
- [Fact]
- public void ProfileMigratesOldDataOnce()
- {
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client1 = new ProfileClient();
-
- Assert.False(dataStore.FileExists(oldProfileDataPath));
- Assert.True(dataStore.FileExists(newProfileDataPath));
-
- ProfileClient client2 = new ProfileClient();
-
- Assert.False(dataStore.FileExists(oldProfileDataPath));
- Assert.True(dataStore.FileExists(newProfileDataPath));
- }
-
- [Fact]
- public void ProfileMigratesAccountsAndDefaultSubscriptions()
- {
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- // Verify Environment migration
- Assert.Equal(4, client.Profile.Environments.Count);
- Assert.Equal("Current", client.Profile.Environments["Current"].Name);
- Assert.Equal("Dogfood", client.Profile.Environments["Dogfood"].Name);
- Assert.Equal("https://login.windows-ppe.net/", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.AdTenant]);
- Assert.Equal("https://management.core.windows.net/", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId]);
- Assert.Equal("https://df.gallery.azure-test.net", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.Gallery]);
- Assert.Equal("https://windows.azure-test.net", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.ManagementPortalUrl]);
- Assert.Equal("https://auxnext.windows.azure-test.net/publishsettings/index", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.PublishSettingsFileUrl]);
- Assert.Equal("https://api-dogfood.resources.windows-int.net", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.ResourceManager]);
- Assert.Equal("https://management-preview.core.windows-int.net/", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.ServiceManagement]);
- Assert.Equal(".database.windows.net", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix]);
-
- // Verify subscriptions
- Assert.Equal(3, client.Profile.Subscriptions.Count);
- Assert.False(client.Profile.Subscriptions.ContainsKey(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E")));
- Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")));
- Assert.Equal("Test 2", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Name);
- Assert.True(client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].IsPropertySet(AzureSubscription.Property.Default));
- Assert.Equal("test@mail.com", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Account);
- Assert.Equal("Dogfood", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Environment);
- Assert.Equal("123", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Properties[AzureSubscription.Property.Tenants]);
- Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")));
- Assert.Equal("Test 3", client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].Name);
- Assert.False(client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].IsPropertySet(AzureSubscription.Property.Default));
- Assert.Equal("test@mail.com", client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].Account);
- Assert.Equal("72f988bf-86f1-41af-91ab-2d7cd011db47", client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].Properties[AzureSubscription.Property.Tenants]);
- Assert.Equal(EnvironmentName.AzureCloud, client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].Environment);
- Assert.Equal(EnvironmentName.AzureChinaCloud, client.Profile.Subscriptions[new Guid("c14d7dc5-ed4d-4346-a02f-9f1bcf78fb66")].Environment);
-
- // Verify accounts
- Assert.Equal(2, client.Profile.Accounts.Count);
- Assert.Equal("test@mail.com", client.Profile.Accounts["test@mail.com"].Id);
- Assert.Equal(AzureAccount.AccountType.User, client.Profile.Accounts["test@mail.com"].Type);
- Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
- .Contains(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F").ToString()));
- Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
- .Contains(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f").ToString()));
- Assert.True(client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E09"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
- .Contains(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f").ToString()));
- Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Tenants)
- .Contains("72f988bf-86f1-41af-91ab-2d7cd011db47"));
- Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Tenants)
- .Contains("123"));
- Assert.Equal("3AF24D48B97730E5C4C9CCB12397B5E046F79E09", client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E09"].Id);
- Assert.Equal(AzureAccount.AccountType.Certificate, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E09"].Type);
- Assert.Equal(0, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E09"].GetPropertyAsArray(AzureAccount.Property.Tenants).Length);
- Assert.Equal(2, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E09"].GetPropertyAsArray(AzureAccount.Property.Subscriptions).Length);
- }
-
- [Fact]
- public void ProfileMigratesAccountsSkipsBadOnesAndBacksUpFile()
- {
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileDataBadSubscription;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- // Verify Environment migration
- Assert.Equal(2, client.Profile.Environments.Count);
-
- // Verify subscriptions
- Assert.Equal(3, client.Profile.Subscriptions.Count);
- Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")));
- Assert.Equal("Test Bad Management Endpoint", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Name);
- Assert.Equal(EnvironmentName.AzureCloud, client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F")].Environment);
- Assert.Equal("Test Null Management Endpoint", client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2ADFF")].Name);
- Assert.Equal(EnvironmentName.AzureCloud, client.Profile.Subscriptions[new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2ADFF")].Environment);
-
- Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")));
- Assert.Equal("Test Bad Cert", client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].Name);
-
- // Verify accounts
- Assert.Equal(2, client.Profile.Accounts.Count);
- Assert.Equal("test@mail.com", client.Profile.Accounts["test@mail.com"].Id);
- Assert.Equal(AzureAccount.AccountType.User, client.Profile.Accounts["test@mail.com"].Type);
- Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
- .Contains(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F").ToString()));
- Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
- .Contains(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f").ToString()));
- Assert.True(client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].GetPropertyAsArray(AzureAccount.Property.Subscriptions)
- .Contains(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f").ToString()));
- Assert.True(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Tenants)
- .Contains("72f988bf-86f1-41af-91ab-2d7cd011db47"));
- Assert.False(client.Profile.Accounts["test@mail.com"].GetPropertyAsArray(AzureAccount.Property.Tenants)
- .Contains("123"));
- Assert.Equal("3AF24D48B97730E5C4C9CCB12397B5E046F79E99", client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].Id);
- Assert.Equal(AzureAccount.AccountType.Certificate, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].Type);
- Assert.Equal(0, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].GetPropertyAsArray(AzureAccount.Property.Tenants).Length);
- Assert.Equal(1, client.Profile.Accounts["3AF24D48B97730E5C4C9CCB12397B5E046F79E99"].GetPropertyAsArray(AzureAccount.Property.Subscriptions).Length);
-
- // Verify backup file
- Assert.True(dataStore.FileExists(oldProfileDataPathError));
- Assert.False(dataStore.FileExists(oldProfileDataPath));
- Assert.Equal(oldProfileDataBadSubscription, dataStore.ReadFileAsText(oldProfileDataPathError));
- }
-
- [Fact]
- public void ProfileMigratesCorruptedFileAndCreatedBackup()
- {
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileDataCorruptedFile;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- // Verify Environment migration
- Assert.Equal(2, client.Profile.Environments.Count);
-
- // Verify subscriptions
- Assert.Equal(0, client.Profile.Subscriptions.Count);
-
- // Verify accounts
- Assert.Equal(0, client.Profile.Accounts.Count);
-
- // Verify backup file
- Assert.True(dataStore.FileExists(oldProfileDataPathError));
- Assert.False(dataStore.FileExists(oldProfileDataPath));
- Assert.Equal(oldProfileDataCorruptedFile, dataStore.ReadFileAsText(oldProfileDataPathError));
- }
-
- [Fact]
- public void CmdletStartsWithCorruptedJson()
- {
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[newProfileDataPath] = jsonProfileWithBadData;
- ProfileClient.DataStore = dataStore;
-
- GetAzureSubscriptionCommand cmdlt = new GetAzureSubscriptionCommand();
-
- ProfileClient client = new ProfileClient();
-
- Assert.Equal(0, client.Profile.Subscriptions.Count);
- Assert.Null(AzureSession.CurrentContext.Subscription);
- Assert.Null(AzureSession.CurrentContext.Account);
- }
-
- [Fact]
- public void CmdletStartsWithJsonWithoutAccounts()
- {
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[newProfileDataPath] = jsonProfileWithoutAccount;
- ProfileClient.DataStore = dataStore;
-
- GetAzureSubscriptionCommand cmdlt = new GetAzureSubscriptionCommand();
-
- ProfileClient client = new ProfileClient();
-
- Assert.Equal(1, client.Profile.Subscriptions.Count);
- Assert.Null(AzureSession.CurrentContext.Subscription);
- Assert.Null(AzureSession.CurrentContext.Account);
- }
-
- [Fact]
- public void AddAzureAccountReturnsAccountWithAllSubscriptionsInRdfeMode()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1 }.ToList());
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "test", Type = AzureAccount.AccountType.User }, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud], null);
-
- Assert.Equal("test", account.Id);
- Assert.Equal(3, account.GetSubscriptions(client.Profile).Count);
- Assert.True(account.GetSubscriptions(client.Profile).Any(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId)));
- Assert.True(account.GetSubscriptions(client.Profile).Any(s => s.Id == new Guid(rdfeSubscription2.SubscriptionId)));
- Assert.True(account.GetSubscriptions(client.Profile).Any(s => s.Id == new Guid(csmSubscription1.SubscriptionId)));
- }
-
- [Fact]
- public void AddAzureAccountReturnsAccountWithAllSubscriptionsInCsmMode()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1 }.ToList());
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "test", Type = AzureAccount.AccountType.User }, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud], null);
-
- Assert.Equal("test", account.Id);
- Assert.Equal(3, account.GetSubscriptions(client.Profile).Count);
- Assert.True(account.GetSubscriptions(client.Profile).Any(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId)));
- Assert.True(account.GetSubscriptions(client.Profile).Any(s => s.Id == new Guid(rdfeSubscription2.SubscriptionId)));
- Assert.True(account.GetSubscriptions(client.Profile).Any(s => s.Id == new Guid(csmSubscription1.SubscriptionId)));
- }
-
- ///
- /// Verify that if a user has a different identity in one tenant, the identity is not added if it has no
- /// access to subscriptions
- ///
- [Fact]
- public void AddAzureAccountWithImpersonatedGuestWithNoSubscriptions()
- {
- SetMocks(new[] { rdfeSubscription1 }.ToList(), new List(),
- new[] { commonTenant, guestTenant }.ToList(),
- (userAccount, environment, tenant) =>
- {
- var token = new MockAccessToken
- {
- UserId = tenant == commonTenant.TenantId ? userAccount.Id : "UserB",
- AccessToken = "def",
- LoginType = LoginType.OrgId
- };
- userAccount.Id = token.UserId;
- return token;
- });
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "UserA", Type = AzureAccount.AccountType.User }, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud], null);
-
- Assert.Equal("UserA", account.Id);
- Assert.Equal(1, account.GetSubscriptions(client.Profile).Count);
- var subrdfe1 = account.GetSubscriptions(client.Profile).FirstOrDefault(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId));
- var userA = client.GetAccount("UserA");
- var userB = client.GetAccount("UserB");
- Assert.NotNull(userA);
- Assert.NotNull(userB);
- Assert.Contains(rdfeSubscription1.SubscriptionId, userA.GetPropertyAsArray(AzureAccount.Property.Subscriptions), StringComparer.OrdinalIgnoreCase);
- Assert.False(userB.HasSubscription(new Guid(rdfeSubscription1.SubscriptionId)));
- Assert.NotNull(subrdfe1);
- Assert.Equal("UserA", subrdfe1.Account);
- }
-
- ///
- /// Verify that multiple accounts can be added if a user has different identitities in different domains, linked to the same login
- /// Verify that subscriptions with admin access forall accounts are added
- ///
- [Fact]
- public void AddAzureAccountWithImpersonatedGuestWithSubscriptions()
- {
- SetMocks(new[] { rdfeSubscription1, guestRdfeSubscription }.ToList(), new List(), new[] { commonTenant, guestTenant }.ToList(),
- (userAccount, environment, tenant) =>
- {
- var token = new MockAccessToken
- {
- UserId = tenant == commonTenant.TenantId ? userAccount.Id : "UserB",
- AccessToken = "def",
- LoginType = LoginType.OrgId
- };
- userAccount.Id = token.UserId;
- return token;
- });
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "UserA", Type = AzureAccount.AccountType.User },
- AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud], null);
-
- Assert.Equal("UserA", account.Id);
- Assert.Equal(1, account.GetSubscriptions(client.Profile).Count);
- var subrdfe1 = account.GetSubscriptions(client.Profile).FirstOrDefault(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId));
- var userA = client.GetAccount("UserA");
- var userB = client.GetAccount("UserB");
- var subGuest = userB.GetSubscriptions(client.Profile).FirstOrDefault(s => s.Id == new Guid(guestRdfeSubscription.SubscriptionId));
- Assert.NotNull(userA);
- Assert.NotNull(userB);
- Assert.Contains(rdfeSubscription1.SubscriptionId, userA.GetPropertyAsArray(AzureAccount.Property.Subscriptions), StringComparer.OrdinalIgnoreCase);
- Assert.Contains(guestRdfeSubscription.SubscriptionId, userB.GetPropertyAsArray(AzureAccount.Property.Subscriptions), StringComparer.OrdinalIgnoreCase);
- Assert.NotNull(subrdfe1);
- Assert.NotNull(subGuest);
- Assert.Equal("UserA", subrdfe1.Account);
- Assert.Equal("UserB", subGuest.Account);
- }
- ///
- /// Test that when account is added more than once with different capitalization, only a single account is added
- /// and that accounts can be retrieved case-insensitively
- ///
- [Fact]
- public void AddAzureAccountIsCaseInsensitive()
- {
- SetMocks(new[] { rdfeSubscription1, guestRdfeSubscription }.ToList(), new List(), new[] { commonTenant, guestTenant }.ToList(),
- (userAccount, environment, tenant) =>
- {
- var token = new MockAccessToken
- {
- UserId = tenant == commonTenant.TenantId ? userAccount.Id : "USERA",
- AccessToken = "def",
- LoginType = LoginType.OrgId
- };
- userAccount.Id = token.UserId;
- return token;
- });
- MockDataStore dataStore = new MockDataStore();
- dataStore.VirtualStore[oldProfileDataPath] = oldProfileData;
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "UserA", Type = AzureAccount.AccountType.User },
- AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud], null);
-
- var userA = client.GetAccount("UserA");
- var secondUserA = client.GetAccount("USERA");
- Assert.NotNull(userA);
- Assert.NotNull(secondUserA);
- Assert.Equal(userA.Id, secondUserA.Id);
- }
-
- [Fact]
- public void GetAzureAccountReturnsAccountWithSubscriptions()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
-
- var account = client.ListAccounts("test").ToList();
-
- Assert.Equal(1, account.Count);
- Assert.Equal("test", account[0].Id);
- Assert.Equal(2, account[0].GetSubscriptions(client.Profile).Count);
- Assert.True(account[0].GetSubscriptions(client.Profile).Any(s => s.Id == azureSubscription1.Id));
- Assert.True(account[0].GetSubscriptions(client.Profile).Any(s => s.Id == azureSubscription2.Id));
- }
-
- [Fact]
- public void GetAzureAccountWithoutEnvironmentReturnsAccount()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
-
- var account = client.ListAccounts("test").ToList();
-
- Assert.Equal(1, account.Count);
- Assert.Equal("test", account[0].Id);
- Assert.Equal(2, account[0].GetSubscriptions(client.Profile).Count);
- Assert.True(account[0].GetSubscriptions(client.Profile).Any(s => s.Id == azureSubscription1.Id));
- Assert.True(account[0].GetSubscriptions(client.Profile).Any(s => s.Id == azureSubscription2.Id));
- }
-
- [Fact]
- public void GetAzureAccountReturnsEmptyEnumerationForNonExistingUser()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
-
- var account = client.ListAccounts("test2").ToList();
-
- Assert.Equal(1, account.Count);
- }
-
- [Fact]
- public void GetAzureAccountReturnsAllAccountsWithNullUser()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- azureSubscription3withoutUser.Account = "test2";
- client.Profile.Accounts["test2"] = new AzureAccount
- {
- Id = "test2",
- Type = AzureAccount.AccountType.User,
- Properties = new Dictionary
- {
- {AzureAccount.Property.Subscriptions, azureSubscription3withoutUser.Id.ToString()}
- }
- };
- client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
-
- var account = client.ListAccounts(null).ToList();
-
- Assert.Equal(2, account.Count);
- }
-
- [Fact]
- public void RemoveAzureAccountRemovesSubscriptions()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- azureSubscription3withoutUser.Account = "test2";
- client.Profile.Accounts["test2"] = new AzureAccount
- {
- Id = "test2",
- Type = AzureAccount.AccountType.User,
- Properties = new Dictionary
- {
- {AzureAccount.Property.Subscriptions, azureSubscription3withoutUser.Id.ToString()}
- }
- };
- client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
- List log = new List();
- client.WarningLog = log.Add;
-
- Assert.Equal(3, client.Profile.Subscriptions.Count);
-
- client.RemoveAccount("test2");
-
- Assert.Equal(2, client.Profile.Subscriptions.Count);
- Assert.Equal(0, log.Count);
- }
-
- [Fact]
- public void RemoveAzureAccountRemovesDefaultSubscriptionAndWritesWarning()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- azureSubscription3withoutUser.Account = "test2";
- client.Profile.Accounts["test2"] = new AzureAccount
- {
- Id = "test2",
- Type = AzureAccount.AccountType.User,
- Properties = new Dictionary
- {
- {AzureAccount.Property.Subscriptions, azureSubscription3withoutUser.Id.ToString()}
- }
- };
- client.Profile.Subscriptions[azureSubscription3withoutUser.Id] = azureSubscription3withoutUser;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
- List log = new List();
- client.WarningLog = log.Add;
-
- Assert.Equal(3, client.Profile.Subscriptions.Count);
-
- var account = client.RemoveAccount("test");
-
- Assert.Equal(1, client.Profile.Subscriptions.Count);
- Assert.Equal("test", account.Id);
- Assert.Equal(2, account.GetPropertyAsArray(AzureAccount.Property.Subscriptions).Length);
- Assert.Equal(1, log.Count);
- Assert.Equal(
- "The default subscription is being removed. Use Select-AzureSubscription -Default to select a new default subscription.",
- log[0]);
- }
-
- [Fact]
- public void RemoveAzureAccountRemovesDefaultAccountFromSubscription()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- azureSubscription3withoutUser.Account = "test2";
- client.Profile.Accounts["test2"] = new AzureAccount
- {
- Id = "test2",
- Type = AzureAccount.AccountType.User,
- Properties = new Dictionary
- {
- {AzureAccount.Property.Subscriptions, azureSubscription1.Id.ToString()}
- }
- };
- client.Profile.Subscriptions[azureSubscription1.Id].Account = azureAccount.Id;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
-
- var account = client.RemoveAccount(azureAccount.Id);
-
- Assert.Equal("test2", client.Profile.Subscriptions[azureSubscription1.Id].Account);
- }
-
- [Fact]
- public void RemoveAzureAccountRemovesInMemoryAccount()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- azureSubscription3withoutUser.Account = "test2";
- client.Profile.Accounts["test2"] = new AzureAccount
- {
- Id = "test2",
- Type = AzureAccount.AccountType.User,
- Properties = new Dictionary
- {
- {AzureAccount.Property.Subscriptions, azureSubscription1.Id.ToString()}
- }
- };
- client.Profile.Subscriptions[azureSubscription1.Id].Account = azureAccount.Id;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
- AzureSession.SetCurrentContext(azureSubscription1, azureEnvironment, azureAccount);
-
- client.RemoveAccount(azureAccount.Id);
-
- Assert.Equal("test2", AzureSession.CurrentContext.Account.Id);
- Assert.Equal("test2", AzureSession.CurrentContext.Subscription.Account);
- Assert.Equal(azureSubscription1.Id, AzureSession.CurrentContext.Subscription.Id);
-
- client.RemoveAccount("test2");
-
- Assert.Null(AzureSession.CurrentContext.Account);
- Assert.Null(AzureSession.CurrentContext.Subscription);
- Assert.Equal(EnvironmentName.AzureCloud, AzureSession.CurrentContext.Environment.Name);
- }
-
- [Fact]
- public void AddAzureEnvironmentAddsEnvironment()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- Assert.Equal(2, client.Profile.Environments.Count);
-
- Assert.Throws(() => client.AddOrSetEnvironment(null));
- var env = client.AddOrSetEnvironment(azureEnvironment);
-
- Assert.Equal(3, client.Profile.Environments.Count);
- Assert.Equal(env, azureEnvironment);
- }
-
- [Fact]
- public void GetAzureEnvironmentsListsEnvironments()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- var env1 = client.ListEnvironments(null);
-
- Assert.Equal(2, env1.Count);
-
- var env2 = client.ListEnvironments("bad");
-
- Assert.Equal(0, env2.Count);
-
- var env3 = client.ListEnvironments(EnvironmentName.AzureCloud);
-
- Assert.Equal(1, env3.Count);
- }
-
- [Fact]
- public void RemoveAzureEnvironmentRemovesEnvironmentSubscriptionsAndAccounts()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.Profile.Environments[azureEnvironment.Name] = azureEnvironment;
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
-
- Assert.Equal(2, client.Profile.Subscriptions.Values.Count(s => s.Environment == "Test"));
- Assert.Equal(3, client.Profile.Environments.Count);
- Assert.Equal(1, client.Profile.Accounts.Count);
-
- Assert.Throws(() => client.RemoveEnvironment(null));
- Assert.Throws(() => client.RemoveEnvironment("bad"));
-
- var env = client.RemoveEnvironment(azureEnvironment.Name);
-
- Assert.Equal(azureEnvironment.Name, env.Name);
- Assert.Equal(0, client.Profile.Subscriptions.Values.Count(s => s.Environment == "Test"));
- Assert.Equal(2, client.Profile.Environments.Count);
- Assert.Equal(0, client.Profile.Accounts.Count);
- }
-
- [Fact]
- public void RemoveAzureEnvironmentDoesNotRemoveEnvironmentSubscriptionsAndAccountsForAzureCloudOrChinaCloud()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- azureSubscription1.Environment = EnvironmentName.AzureCloud;
- azureSubscription2.Environment = EnvironmentName.AzureChinaCloud;
- client.Profile.Subscriptions[azureSubscription1.Id] = azureSubscription1;
- client.Profile.Subscriptions[azureSubscription2.Id] = azureSubscription2;
-
- Assert.Equal(1, client.Profile.Subscriptions.Values.Count(s => s.Environment == EnvironmentName.AzureCloud));
- Assert.Equal(1, client.Profile.Subscriptions.Values.Count(s => s.Environment == EnvironmentName.AzureChinaCloud));
- Assert.Equal(2, client.Profile.Environments.Count);
- Assert.Equal(1, client.Profile.Accounts.Count);
-
- Assert.Throws(() => client.RemoveEnvironment(EnvironmentName.AzureCloud));
- Assert.Throws(() => client.RemoveEnvironment(EnvironmentName.AzureChinaCloud));
-
- Assert.Equal(1, client.Profile.Subscriptions.Values.Count(s => s.Environment == EnvironmentName.AzureCloud));
- Assert.Equal(1, client.Profile.Subscriptions.Values.Count(s => s.Environment == EnvironmentName.AzureChinaCloud));
- Assert.Equal(2, client.Profile.Environments.Count);
- Assert.Equal(1, client.Profile.Accounts.Count);
- }
-
- [Fact]
- public void SetAzureEnvironmentUpdatesEnvironment()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- Assert.Equal(2, client.Profile.Environments.Count);
-
- Assert.Throws(() => client.AddOrSetEnvironment(null));
-
- var env2 = client.AddOrSetEnvironment(azureEnvironment);
- Assert.Equal(env2.Name, azureEnvironment.Name);
- Assert.NotNull(env2.Endpoints[AzureEnvironment.Endpoint.ServiceManagement]);
- AzureEnvironment newEnv = new AzureEnvironment
- {
- Name = azureEnvironment.Name
- };
- newEnv.Endpoints[AzureEnvironment.Endpoint.Graph] = "foo";
- env2 = client.AddOrSetEnvironment(newEnv);
- Assert.Equal("foo", env2.Endpoints[AzureEnvironment.Endpoint.Graph]);
- Assert.NotNull(env2.Endpoints[AzureEnvironment.Endpoint.ServiceManagement]);
- }
-
- [Fact]
- public void GetAzureEnvironmentReturnsCorrectValue()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetEnvironment(azureEnvironment);
-
- Assert.Equal(EnvironmentName.AzureCloud, AzureSession.CurrentContext.Environment.Name);
-
- var defaultEnv = client.GetEnvironmentOrDefault(null);
-
- Assert.Equal(EnvironmentName.AzureCloud, defaultEnv.Name);
-
- var newEnv = client.GetEnvironmentOrDefault(azureEnvironment.Name);
-
- Assert.Equal(azureEnvironment.Name, newEnv.Name);
-
- Assert.Throws(() => client.GetEnvironmentOrDefault("bad"));
- }
-
- [Fact]
- public void GetCurrentEnvironmentReturnsCorrectValue()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- AzureSession.SetCurrentContext(azureSubscription1, azureEnvironment, azureAccount);
-
- var newEnv = client.GetEnvironmentOrDefault(azureEnvironment.Name);
-
- Assert.Equal(azureEnvironment.Name, newEnv.Name);
- }
-
- [Fact]
- public void AddOrSetAzureSubscriptionChecksAndUpdates()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
-
- Assert.Equal(1, client.Profile.Subscriptions.Count);
-
- var subscription = client.AddOrSetSubscription(azureSubscription1);
-
- Assert.Equal(1, client.Profile.Subscriptions.Count);
- Assert.Equal(1, client.Profile.Accounts.Count);
- Assert.Equal(subscription, azureSubscription1);
- Assert.Throws(() => client.AddOrSetSubscription(null));
- Assert.Throws(() => client.AddOrSetSubscription(
- new AzureSubscription { Id = new Guid(), Environment = null, Name = "foo" }));
- }
-
- [Fact]
- public void AddOrSetAzureSubscriptionUpdatesInMemory()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- AzureSession.SetCurrentContext(azureSubscription1, azureEnvironment, azureAccount);
- azureSubscription1.Properties[AzureSubscription.Property.StorageAccount] = "testAccount";
- Assert.Equal(azureSubscription1.Id, AzureSession.CurrentContext.Subscription.Id);
- Assert.Equal(azureSubscription1.Properties[AzureSubscription.Property.StorageAccount],
- AzureSession.CurrentContext.Subscription.Properties[AzureSubscription.Property.StorageAccount]);
-
- var newSubscription = new AzureSubscription
- {
- Id = azureSubscription1.Id,
- Environment = azureSubscription1.Environment,
- Account = azureSubscription1.Account,
- Name = azureSubscription1.Name
- };
- newSubscription.Properties[AzureSubscription.Property.StorageAccount] = "testAccount1";
-
- client.AddOrSetSubscription(newSubscription);
- var newSubscriptionFromProfile = client.Profile.Subscriptions[newSubscription.Id];
-
- Assert.Equal(newSubscription.Id, AzureSession.CurrentContext.Subscription.Id);
- Assert.Equal(newSubscription.Id, newSubscriptionFromProfile.Id);
- Assert.Equal(newSubscription.Properties[AzureSubscription.Property.StorageAccount],
- AzureSession.CurrentContext.Subscription.Properties[AzureSubscription.Property.StorageAccount]);
- Assert.Equal(newSubscription.Properties[AzureSubscription.Property.StorageAccount],
- newSubscriptionFromProfile.Properties[AzureSubscription.Property.StorageAccount]);
- }
-
- [Fact]
- public void RemoveAzureSubscriptionChecksAndRemoves()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.SetSubscriptionAsCurrent(azureSubscription1.Name, azureSubscription1.Account);
- client.SetSubscriptionAsDefault(azureSubscription1.Name, azureSubscription1.Account);
-
- Assert.Equal(1, client.Profile.Subscriptions.Count);
-
- List log = new List();
- client.WarningLog = log.Add;
-
- var subscription = client.RemoveSubscription(azureSubscription1.Name);
-
- Assert.Equal(0, client.Profile.Subscriptions.Count);
- Assert.Equal(azureSubscription1.Name, subscription.Name);
- Assert.Equal(2, log.Count);
- Assert.Equal(
- "The default subscription is being removed. Use Select-AzureSubscription -Default to select a new default subscription.",
- log[0]);
- Assert.Equal(
- "The current subscription is being removed. Use Select-AzureSubscription to select a new current subscription.",
- log[1]);
- Assert.Throws(() => client.RemoveSubscription("bad"));
- Assert.Throws(() => client.RemoveSubscription(null));
- }
-
- [Fact]
- public void RefreshSubscriptionsUpdatesAccounts()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1, csmSubscription1withDuplicateId }.ToList());
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetEnvironment(azureEnvironment);
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.AddOrSetSubscription(azureSubscription1);
-
- var subscriptions = client.RefreshSubscriptions(azureEnvironment);
-
- Assert.True(client.Profile.Accounts[azureAccount.Id].HasSubscription(new Guid(rdfeSubscription1.SubscriptionId)));
- Assert.True(client.Profile.Accounts[azureAccount.Id].HasSubscription(new Guid(rdfeSubscription2.SubscriptionId)));
- Assert.True(client.Profile.Accounts[azureAccount.Id].HasSubscription(new Guid(csmSubscription1.SubscriptionId)));
- Assert.True(client.Profile.Accounts[azureAccount.Id].HasSubscription(new Guid(csmSubscription1withDuplicateId.SubscriptionId)));
- }
-
- [Fact]
- public void RefreshSubscriptionsMergesFromServer()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1, csmSubscription1withDuplicateId }.ToList());
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetEnvironment(azureEnvironment);
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.AddOrSetSubscription(azureSubscription1);
-
- var subscriptions = client.RefreshSubscriptions(azureEnvironment);
-
- Assert.Equal(4, subscriptions.Count);
- Assert.Equal(4, subscriptions.Count(s => s.Account == "test"));
- Assert.Equal(1, subscriptions.Count(s => s.Id == azureSubscription1.Id));
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId)));
- Assert.Equal(2, subscriptions.First(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId)).GetPropertyAsArray(AzureSubscription.Property.SupportedModes).Count());
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(rdfeSubscription2.SubscriptionId)));
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(csmSubscription1.SubscriptionId)));
- }
-
- [Fact]
- public void RefreshSubscriptionsWorksWithMooncake()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1, csmSubscription1withDuplicateId }.ToList());
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
-
- var subscriptions = client.RefreshSubscriptions(client.Profile.Environments[EnvironmentName.AzureChinaCloud]);
-
- Assert.Equal(2, subscriptions.Count);
- Assert.Equal(2, subscriptions.Count(s => s.Account == "test"));
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId)));
- Assert.Equal(1, subscriptions.First(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId)).GetPropertyAsArray(AzureSubscription.Property.SupportedModes).Count());
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(rdfeSubscription2.SubscriptionId)));
- }
-
- [Fact]
- public void RefreshSubscriptionsListsAllSubscriptions()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1, csmSubscription1withDuplicateId }.ToList());
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
-
- var subscriptions = client.RefreshSubscriptions(azureEnvironment);
-
- Assert.Equal(4, subscriptions.Count);
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(rdfeSubscription1.SubscriptionId)));
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(rdfeSubscription2.SubscriptionId)));
- Assert.Equal(1, subscriptions.Count(s => s.Id == new Guid(csmSubscription1.SubscriptionId)));
- Assert.True(subscriptions.All(s => s.Environment == "Test"));
- Assert.True(subscriptions.All(s => s.Account == "test"));
- }
-
- [Fact]
- public void GetAzureSubscriptionByNameChecksAndReturnsOnlyLocal()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1, csmSubscription1withDuplicateId }.ToList());
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.AddOrSetSubscription(azureSubscription2);
-
- var subscriptions = client.GetSubscription(azureSubscription1.Name);
-
- Assert.Equal(azureSubscription1.Id, subscriptions.Id);
- Assert.Throws(() => client.GetSubscription(new Guid()));
- }
-
- [Fact]
- public void GetAzureSubscriptionByIdChecksAndReturnsOnlyLocal()
- {
- SetMocks(new[] { rdfeSubscription1, rdfeSubscription2 }.ToList(), new[] { csmSubscription1, csmSubscription1withDuplicateId }.ToList());
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.AddOrSetSubscription(azureSubscription2);
-
- var subscriptions = client.GetSubscription(azureSubscription1.Id);
-
- Assert.Equal(azureSubscription1.Id, subscriptions.Id);
- Assert.Throws(() => client.GetSubscription(new Guid()));
- }
-
- [Fact]
- public void SetAzureSubscriptionAsDefaultSetsDefaultAndCurrent()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription2);
-
- Assert.Null(client.Profile.DefaultSubscription);
-
- client.SetSubscriptionAsDefault(azureSubscription2.Name, azureSubscription2.Account);
-
- Assert.Equal(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
- Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id);
- Assert.Throws(() => client.SetSubscriptionAsDefault("bad", null));
- Assert.Throws(() => client.SetSubscriptionAsDefault(null, null));
- }
-
- [Fact]
- public void ClearDefaultAzureSubscriptionClearsDefault()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription2);
-
- Assert.Null(client.Profile.DefaultSubscription);
- client.SetSubscriptionAsDefault(azureSubscription2.Name, azureSubscription2.Account);
- Assert.Equal(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
-
- client.ClearDefaultSubscription();
-
- Assert.Null(client.Profile.DefaultSubscription);
- }
-
- [Fact]
- public void SetAzureSubscriptionAsCurrentSetsCurrent()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.AddOrSetSubscription(azureSubscription2);
-
- Assert.Null(AzureSession.CurrentContext.Subscription);
-
- client.SetSubscriptionAsCurrent(azureSubscription2.Name, azureSubscription2.Account);
-
- Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id);
- Assert.Throws(() => client.SetSubscriptionAsCurrent("bad", null));
- Assert.Throws(() => client.SetSubscriptionAsCurrent(null, null));
- }
-
- [Fact]
- public void ImportPublishSettingsLoadsAndReturnsSubscriptions()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfile);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", azureEnvironment.Name);
- var account = client.Profile.Accounts.Values.First();
-
- Assert.True(subscriptions.All(s => s.Account == account.Id));
- Assert.Equal(6, subscriptions.Count);
- Assert.Equal(6, client.Profile.Subscriptions.Count);
- }
-
- [Fact]
- public void ImportPublishSettingsDefaultsToAzureCloudEnvironmentWithManagementUrl()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.SetSubscriptionAsDefault(azureSubscription1.Name, azureAccount.Id);
- client.Profile.Save();
-
- client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfile);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", null);
-
- Assert.True(subscriptions.All(s => s.Environment == EnvironmentName.AzureCloud));
- Assert.Equal(6, subscriptions.Count);
- Assert.Equal(7, client.Profile.Subscriptions.Count);
- }
-
- [Fact]
- public void ImportPublishSettingsUsesProperEnvironmentWithManagementUrl()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetAccount(azureAccount);
- azureEnvironment.Endpoints[AzureEnvironment.Endpoint.ServiceManagement] = "https://newmanagement.core.windows.net/";
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.SetSubscriptionAsDefault(azureSubscription1.Name, azureAccount.Id);
- client.Profile.Save();
-
- client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfile3);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", null);
-
- Assert.True(subscriptions.All(s => s.Environment == azureEnvironment.Name));
- Assert.Equal(6, subscriptions.Count);
- Assert.Equal(7, client.Profile.Subscriptions.Count);
- }
-
- [Fact]
- public void ImportPublishSettingsUsesProperEnvironmentWithChinaManagementUrl()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfileChina);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", null);
-
- Assert.True(subscriptions.All(s => s.Environment == EnvironmentName.AzureChinaCloud));
- Assert.Equal(6, subscriptions.Count);
- Assert.Equal(6, client.Profile.Subscriptions.Count);
- }
-
- [Fact]
- public void ImportPublishSettingsUsesProperEnvironmentWithChinaManagementUrlOld()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfileChinaOld);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", null);
-
- Assert.True(subscriptions.All(s => s.Environment == EnvironmentName.AzureChinaCloud));
- Assert.Equal(1, subscriptions.Count);
- Assert.Equal(1, client.Profile.Subscriptions.Count);
- }
-
- [Fact]
- public void ImportPublishSettingsDefaultsToAzureCloudWithIncorrectManagementUrl()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.SetSubscriptionAsDefault(azureSubscription1.Name, azureAccount.Id);
- client.Profile.Save();
-
- client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfile3);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", null);
-
- Assert.True(subscriptions.All(s => s.Environment == EnvironmentName.AzureCloud));
- Assert.Equal(6, subscriptions.Count);
- Assert.Equal(7, client.Profile.Subscriptions.Count);
- }
-
- [Fact]
- public void ImportPublishSettingsUsesPassedInEnvironment()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetEnvironment(azureEnvironment);
- client.AddOrSetSubscription(azureSubscription1);
- client.SetSubscriptionAsDefault(azureSubscription1.Name, azureAccount.Id);
- client.Profile.Save();
-
- client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfile3);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", azureEnvironment.Name);
-
- Assert.True(subscriptions.All(s => s.Environment == azureEnvironment.Name));
- Assert.Equal(6, subscriptions.Count);
- Assert.Equal(7, client.Profile.Subscriptions.Count);
- }
-
- [Fact]
- public void SelectAzureSubscriptionByIdWorks()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
-
- var tempSubscriptions = new List
- {
- new AzureSubscription
- {
- Id = new Guid("11111111-1383-4740-8A69-748C5B63ADBA"),
- Name = "Same Name Subscription",
- Environment = azureEnvironment.Name,
- Account = azureAccount.Id,
- Properties = new Dictionary
- {
- { AzureSubscription.Property.Default, "True" }
- }
- },
-
- new AzureSubscription
- {
- Id = new Guid("22222222-1383-4740-8A69-748C5B63ADBA"),
- Name = "Same Name Subscription",
- Environment = azureEnvironment.Name,
- Account = azureAccount.Id,
- Properties = new Dictionary()
- },
-
- new AzureSubscription
- {
- Id = new Guid("33333333-1383-4740-8A69-748C5B63ADBA"),
- Name = "Same Name Subscription",
- Environment = azureEnvironment.Name,
- Account = azureAccount.Id,
- Properties = new Dictionary()
- }
- };
-
- client.Profile.Accounts[azureAccount.Id] = azureAccount;
- client.AddOrSetEnvironment(azureEnvironment);
-
- foreach (var s in tempSubscriptions)
- {
- client.AddOrSetSubscription(s);
- }
-
- client.SetSubscriptionAsCurrent(tempSubscriptions[0].Name, tempSubscriptions[0].Account);
- client.Profile.Save();
-
- Assert.Equal(tempSubscriptions[0].Id, AzureSession.CurrentContext.Subscription.Id);
-
- var cmdlt = new SelectAzureSubscriptionCommand();
-
- cmdlt.CommandRuntime = new MockCommandRuntime();
- cmdlt.SubscriptionId = tempSubscriptions[2].Id.ToString();
- cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
-
- // Act
- cmdlt.InvokeBeginProcessing();
- cmdlt.ExecuteCmdlet();
- cmdlt.InvokeEndProcessing();
-
- Assert.Equal(tempSubscriptions[2].Id, AzureSession.CurrentContext.Subscription.Id);
- }
-
- [Fact]
- public void ImportPublishSettingsAddsSecondCertificate()
- {
- MockDataStore dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
- ProfileClient client = new ProfileClient();
- var newSubscription = new AzureSubscription
- {
- Id = new Guid("f62b1e05-af8f-4203-8f97-421089adc053"),
- Name = "Microsoft Azure Sandbox 9-220",
- Environment = EnvironmentName.AzureCloud,
- Account = azureAccount.Id
- };
- azureAccount.SetProperty(AzureAccount.Property.Subscriptions, newSubscription.Id.ToString());
- client.AddOrSetAccount(azureAccount);
- client.AddOrSetSubscription(newSubscription);
- client.Profile.Save();
-
- client = new ProfileClient();
-
- dataStore.WriteFile("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings",
- Properties.Resources.ValidProfile);
-
- client.AddOrSetEnvironment(azureEnvironment);
- var subscriptions = client.ImportPublishSettings("ImportPublishSettingsLoadsAndReturnsSubscriptions.publishsettings", azureEnvironment.Name);
-
- Assert.Equal(2, client.Profile.Accounts.Count());
- var certAccount = client.Profile.Accounts.Values.First(a => a.Type == AzureAccount.AccountType.Certificate);
- var userAccount = client.Profile.Accounts.Values.First(a => a.Type == AzureAccount.AccountType.User);
-
- Assert.True(subscriptions.All(s => s.Account == certAccount.Id));
- Assert.Equal(azureAccount.Id, client.Profile.Subscriptions.Values.First(s => s.Id == newSubscription.Id).Account);
-
- Assert.True(userAccount.GetPropertyAsArray(AzureAccount.Property.Subscriptions).Contains(newSubscription.Id.ToString()));
- Assert.True(certAccount.GetPropertyAsArray(AzureAccount.Property.Subscriptions).Contains(newSubscription.Id.ToString()));
-
- Assert.Equal(6, subscriptions.Count);
- Assert.Equal(6, client.Profile.Subscriptions.Count);
- }
-
- private void SetMocks(List rdfeSubscriptions,
- List csmSubscriptions,
- List tenants = null,
- Func tokenProvider = null)
- {
- ClientMocks clientMocks = new ClientMocks(new Guid(defaultSubscription));
-
- clientMocks.LoadRdfeSubscriptions(rdfeSubscriptions);
- clientMocks.LoadCsmSubscriptions(csmSubscriptions);
- clientMocks.LoadTenants(tenants);
-
- AzureSession.ClientFactory = new MockClientFactory(new object[] { clientMocks.RdfeSubscriptionClientMock.Object,
- clientMocks.CsmSubscriptionClientMock.Object });
-
- var mockFactory = new MockTokenAuthenticationFactory();
- if (tokenProvider != null)
- {
- mockFactory.TokenProvider = tokenProvider;
- }
-
- AzureSession.AuthenticationFactory = mockFactory;
- }
-
- private void SetMockData()
- {
- commonTenant = new TenantIdDescription
- {
- Id = "Common",
- TenantId = "Common"
- };
- guestTenant = new TenantIdDescription
- {
- Id = "Guest",
- TenantId = "Guest"
- };
- rdfeSubscription1 = new Subscriptions.Models.SubscriptionListOperationResponse.Subscription
- {
- SubscriptionId = "16E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
- SubscriptionName = "RdfeSub1",
- SubscriptionStatus = Subscriptions.Models.SubscriptionStatus.Active,
- ActiveDirectoryTenantId = "Common"
- };
- rdfeSubscription2 = new Subscriptions.Models.SubscriptionListOperationResponse.Subscription
- {
- SubscriptionId = "26E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
- SubscriptionName = "RdfeSub2",
- SubscriptionStatus = Subscriptions.Models.SubscriptionStatus.Active,
- ActiveDirectoryTenantId = "Common"
- };
- guestRdfeSubscription = new Subscriptions.Models.SubscriptionListOperationResponse.Subscription
- {
- SubscriptionId = "26E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1C",
- SubscriptionName = "RdfeSub2",
- SubscriptionStatus = Subscriptions.Models.SubscriptionStatus.Active,
- ActiveDirectoryTenantId = "Guest"
- };
- csmSubscription1 = new Azure.Subscriptions.Models.Subscription
- {
- Id = "Subscriptions/36E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
- DisplayName = "CsmSub1",
- State = "Active",
- SubscriptionId = "36E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"
- };
- csmSubscription1withDuplicateId = new Azure.Subscriptions.Models.Subscription
- {
- Id = "Subscriptions/16E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
- DisplayName = "RdfeSub1",
- State = "Active",
- SubscriptionId = "16E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"
- };
- csmSubscription2 = new Azure.Subscriptions.Models.Subscription
- {
- Id = "Subscriptions/46E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E",
- DisplayName = "CsmSub2",
- State = "Active",
- SubscriptionId = "46E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"
- };
- guestCsmSubscription = new Azure.Subscriptions.Models.Subscription
- {
- Id = "Subscriptions/76E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1D",
- DisplayName = "CsmGuestSub",
- State = "Active",
- SubscriptionId = "76E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1D"
- };
- azureSubscription1 = new AzureSubscription
- {
- Id = new Guid("56E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"),
- Name = "LocalSub1",
- Environment = "Test",
- Account = "test",
- Properties = new Dictionary
- {
- { AzureSubscription.Property.Default, "True" }
- }
- };
- azureSubscription2 = new AzureSubscription
- {
- Id = new Guid("66E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"),
- Name = "LocalSub2",
- Environment = "Test",
- Account = "test"
- };
- azureSubscription3withoutUser = new AzureSubscription
- {
- Id = new Guid("76E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"),
- Name = "LocalSub3",
- Environment = "Test",
- };
- azureEnvironment = new AzureEnvironment
- {
- Name = "Test",
- Endpoints = new Dictionary
- {
- { AzureEnvironment.Endpoint.ServiceManagement, "https://umapi.rdfetest.dnsdemo4.com:8443/" },
- { AzureEnvironment.Endpoint.ManagementPortalUrl, "https://windows.azure-test.net" },
- { AzureEnvironment.Endpoint.AdTenant, "https://login.windows-ppe.net/" },
- { AzureEnvironment.Endpoint.ActiveDirectory, "https://login.windows-ppe.net/" },
- { AzureEnvironment.Endpoint.Gallery, "https://current.gallery.azure-test.net" },
- { AzureEnvironment.Endpoint.ResourceManager, "https://api-current.resources.windows-int.net/" },
- { AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix, "vault-int.azure-int.net"},
- { AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId, "https://vault-int.azure-int.net/"}
- }
- };
- azureAccount = new AzureAccount
- {
- Id = "test",
- Type = AzureAccount.AccountType.User,
- Properties = new Dictionary
- {
- { AzureAccount.Property.Subscriptions, azureSubscription1.Id + "," + azureSubscription2.Id }
- }
- };
- newProfileDataPath = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.ProfileFile);
- oldProfileDataPath = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.OldProfileFile);
- oldProfileDataPathError = System.IO.Path.Combine(AzurePowerShell.ProfileDirectory, AzurePowerShell.OldProfileFileBackup);
- oldProfileData = @"
-
- AzureCloud
-
-
- https://management.core.windows.net/
- https://login.windows-ppe.net/
- Common
- https://current.gallery.azure-test.net
- http://go.microsoft.com/fwlink/?LinkId=254433
- Current
- d:\Code\azure.publishsettings
- https://api-current.resources.windows-int.net/
- https://umapi.rdfetest.dnsdemo4.com:8443/
- .database.windows.net
-
- trafficmanager.net
-
-
- https://management.core.windows.net/
- https://login.windows-ppe.net/
- Common
- https://df.gallery.azure-test.net
- https://windows.azure-test.net
- Dogfood
- https://auxnext.windows.azure-test.net/publishsettings/index
- https://api-dogfood.resources.windows-int.net
- https://management-preview.core.windows-int.net/
- .database.windows.net
-
- trafficmanager.net
-
-
-
-
-
-
-
-
-
-
- true
-
-
- https://management.core.windows.net/
- Test
-
-
- .database.windows.net
- 06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E
- trafficmanager.net
-
-
-
-
- 123
- test@mail.com
-
-
- true
-
-
- https://management-preview.core.windows-int.net/
- Test 2
-
-
- .database.windows.net
- 06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F
- trafficmanager.net
-
-
- https://login.windows.net/
- https://management.core.windows.net/
- 72f988bf-86f1-41af-91ab-2d7cd011db47
- test@mail.com
-
-
- false
-
- 3AF24D48B97730E5C4C9CCB12397B5E046F79E09
- https://management.core.windows.net/
- Test 3
-
-
- .database.windows.net
- d1e52cbc-b073-42e2-a0a0-c2f547118a6f
- trafficmanager.net
-
-
-
-
-
-
-
-
- false
-
- 3AF24D48B97730E5C4C9CCB12397B5E046F79E09
- https://management.core.chinacloudapi.cn/
- Mooncake Test
-
-
- .database.windows.net
- c14d7dc5-ed4d-4346-a02f-9f1bcf78fb66
- trafficmanager.net
-
-
- ";
-
- oldProfileDataBadSubscription = @"
-
- AzureCloud
-
-
-
-
-
-
-
-
-
-
- true
-
-
- https://management.core.windows.net/
- Test Nill ID
-
-
- .database.windows.net
-
- trafficmanager.net
-
-
-
-
-
- test@mail.com
-
-
- true
-
-
- Bad Data
- Test Bad Management Endpoint
-
-
- .database.windows.net
- 06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F
- trafficmanager.net
-
-
-
-
-
- test@mail.com
-
-
- true
-
-
-
- Test Null Management Endpoint
-
-
- .database.windows.net
- 06E3F6FD-A3AA-439A-8FC4-1F5C41D2ADFF
- trafficmanager.net
-
-
- https://login.windows.net/
- https://management.core.windows.net/
- 72f988bf-86f1-41af-91ab-2d7cd011db47
- test@mail.com
-
-
- false
-
- 3AF24D48B97730E5C4C9CCB12397B5E046F79E99
- https://management.core.windows.net/
- Test Bad Cert
-
-
- .database.windows.net
- d1e52cbc-b073-42e2-a0a0-c2f547118a6f
- trafficmanager.net
-
-
- ";
-
- oldProfileDataCorruptedFile = @"
-
- AzureCloud
-
-
- https://management.core.windows.net/
- https://login.windows-ppe.net/
- Common
- https://current.gallery.azure-test.net
- http://go.microsoft.com/fwlink/?LinkId=254433
- Current
- d:\Code\azure.publishsettings
- https://api-current.resources.windows-int.net/
- https://umapi.rdfetest.dnsdemo4.com:8443/
- .database.windows.net
-
- trafficmanager.net
-
-
-
- ";
-
- jsonProfileWithoutAccount = @"{
- ""Environments"": [],
- ""Subscriptions"": [
- {
- ""Id"": ""7e11f45f-70e6-430a-a4fc-af338aa22c11"",
- ""Name"": ""Test"",
- ""Environment"": ""AzureCloud"",
- ""Account"": ""test@mail.com"",
- ""Properties"": {
- ""SupportedModes"": ""AzureServiceManagement"",
- ""Default"": ""True"",
- ""StorageAccount"": ""rjfmmanagement""
- }
- }
- ],
- ""Accounts"": []
- }";
-
- jsonProfileWithBadData = @"{
- ""Environments"": [],
- ""Subscriptions"": {
- {
- ""Id"": ""7e11f45f-70e6-430a-a4fc-af338aa22c11"",
- ""Name"": ""Test"",
- ""Environment"": ""AzureCloud"",
- ""Account"": ""test@mail.com"",
- ""Properties"": {
- ""SupportedModes"": ""AzureServiceManagement"",
- ""Default"": ""True"",
- ""StorageAccount"": ""rjfmmanagement""
- }
- }
- ],
- ""Accounts"": []
- }";
- }
- }
-}
diff --git a/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs b/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs
index b72bb2c66b66..c0a1396f60bb 100644
--- a/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs
+++ b/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs
@@ -12,24 +12,20 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
+using Microsoft.IdentityModel.Clients.ActiveDirectory;
+using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
+using Microsoft.WindowsAzure.Commands.Profile;
+using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Management.Automation;
-using System.Management.Automation.Language;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
-using System.Text;
-using Microsoft.IdentityModel.Clients.ActiveDirectory;
-using Microsoft.Azure.Common.Extensions.Models;
-using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
-using Microsoft.WindowsAzure.Commands.Profile;
-using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions.Authentication;
-using Moq;
using Xunit;
-using Microsoft.Azure.Common.Extensions;
namespace Microsoft.WindowsAzure.Commands.Common.Test.Common
{
@@ -46,10 +42,9 @@ public class ProfileCmdltsTests
public ProfileCmdltsTests() : base()
{
dataStore = new MockDataStore();
- ProfileClient.DataStore = dataStore;
+ AzureSession.DataStore = dataStore;
commandRuntimeMock = new MockCommandRuntime();
SetMockData();
- AzureSession.SetCurrentContext(null, null, null);
}
[Fact]
@@ -57,7 +52,7 @@ public void ClearAzureProfileClearsDefaultProfile()
{
ClearAzureProfileCommand cmdlt = new ClearAzureProfileCommand();
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetAccount(azureAccount);
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetSubscription(azureSubscription1);
@@ -72,7 +67,7 @@ public void ClearAzureProfileClearsDefaultProfile()
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
Assert.Equal(0, client.Profile.Subscriptions.Count);
Assert.Equal(0, client.Profile.Accounts.Count);
Assert.Equal(2, client.Profile.Environments.Count); //only default environments
@@ -85,7 +80,7 @@ public void ClearAzureProfileClearsCustomProfile()
ClearAzureProfileCommand cmdlt = new ClearAzureProfileCommand();
// Setup
- ProfileClient client = new ProfileClient(subscriptionDataFile);
+ ProfileClient client = new ProfileClient(new AzureProfile(subscriptionDataFile));
client.AddOrSetAccount(azureAccount);
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetSubscription(azureSubscription1);
@@ -93,7 +88,7 @@ public void ClearAzureProfileClearsCustomProfile()
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.Force = new SwitchParameter(true);
- cmdlt.SubscriptionDataFile = subscriptionDataFile;
+ cmdlt.Profile = new AzureProfile(subscriptionDataFile);
// Act
cmdlt.InvokeBeginProcessing();
@@ -101,7 +96,7 @@ public void ClearAzureProfileClearsCustomProfile()
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient(subscriptionDataFile);
+ client = new ProfileClient(new AzureProfile(subscriptionDataFile));
Assert.Equal(0, client.Profile.Subscriptions.Count);
Assert.Equal(0, client.Profile.Accounts.Count);
Assert.Equal(2, client.Profile.Environments.Count); //only default environments
@@ -155,13 +150,13 @@ public void DeleteCorruptedTokenCache()
{
//setup
string testFileName = @"c:\foobar\TokenCache.dat";
- ProfileClient.DataStore.WriteFile(testFileName, new byte[] { 0, 1 });
+ AzureSession.DataStore.WriteFile(testFileName, new byte[] { 0, 1 });
//Act
ProtectedFileTokenCache tokenCache = new ProtectedFileTokenCache(testFileName);
//Assert
- Assert.False(ProfileClient.DataStore.FileExists(testFileName));
+ Assert.False(AzureSession.DataStore.FileExists(testFileName));
}
[Fact]
@@ -181,7 +176,7 @@ public void SetAzureSubscriptionAddsSubscriptionWithCertificate()
cmdlt.InvokeEndProcessing();
// Verify
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var newSubscription = client.Profile.Subscriptions[new Guid(cmdlt.SubscriptionId)];
var newAccount = client.Profile.Accounts[SampleCertificate.Thumbprint];
Assert.Equal(cmdlt.SubscriptionName, newSubscription.Name);
@@ -197,11 +192,11 @@ public void SetAzureSubscriptionAddsSubscriptionWithCertificate()
[Fact]
public void SetAzureSubscriptionDerivesEnvironmentFromEnvironmentParameterOnAdd()
{
- SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetEnvironment(azureEnvironment);
client.Profile.Save();
+ SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SubscriptionId = Guid.NewGuid().ToString();
@@ -216,7 +211,7 @@ public void SetAzureSubscriptionDerivesEnvironmentFromEnvironmentParameterOnAdd(
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var newSubscription = client.Profile.Subscriptions[new Guid(cmdlt.SubscriptionId)];
Assert.Equal(cmdlt.SubscriptionName, newSubscription.Name);
Assert.Equal(cmdlt.Environment, newSubscription.Environment);
@@ -228,7 +223,7 @@ public void SetAzureSubscriptionThrowsExceptionWithoutCertificateOnAdd()
{
SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetEnvironment(azureEnvironment);
client.Profile.Save();
@@ -246,13 +241,13 @@ public void SetAzureSubscriptionThrowsExceptionWithoutCertificateOnAdd()
[Fact]
public void SetAzureSubscriptionDerivesEnvironmentFromEnvironmentParameterOnSet()
{
- SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetAccount(azureAccount);
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetSubscription(azureSubscription1);
client.Profile.Save();
+ SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SubscriptionId = azureSubscription1.Id.ToString();
@@ -265,7 +260,7 @@ public void SetAzureSubscriptionDerivesEnvironmentFromEnvironmentParameterOnSet(
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var newSubscription = client.Profile.Subscriptions[new Guid(cmdlt.SubscriptionId)];
Assert.Equal(cmdlt.Environment, newSubscription.Environment);
Assert.Equal(cmdlt.CurrentStorageAccountName, newSubscription.GetProperty(AzureSubscription.Property.StorageAccount));
@@ -274,13 +269,13 @@ public void SetAzureSubscriptionDerivesEnvironmentFromEnvironmentParameterOnSet(
[Fact]
public void SetAzureSubscriptionDerivesEnvironmentFromServiceEndpointParameterOnSet()
{
- SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetAccount(azureAccount);
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetSubscription(azureSubscription1);
client.Profile.Save();
+ SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SubscriptionId = azureSubscription1.Id.ToString();
@@ -293,7 +288,7 @@ public void SetAzureSubscriptionDerivesEnvironmentFromServiceEndpointParameterOn
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var newSubscription = client.Profile.Subscriptions[new Guid(cmdlt.SubscriptionId)];
Assert.Equal(cmdlt.Environment, newSubscription.Environment);
Assert.Equal(cmdlt.CurrentStorageAccountName,
@@ -303,13 +298,13 @@ public void SetAzureSubscriptionDerivesEnvironmentFromServiceEndpointParameterOn
[Fact]
public void SetAzureSubscriptionDerivesEnvironmentFromResourcesEndpointParameterOnSet()
{
- SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetAccount(azureAccount);
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetSubscription(azureSubscription1);
client.Profile.Save();
+ SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SubscriptionId = azureSubscription1.Id.ToString();
@@ -322,7 +317,7 @@ public void SetAzureSubscriptionDerivesEnvironmentFromResourcesEndpointParameter
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var newSubscription = client.Profile.Subscriptions[new Guid(cmdlt.SubscriptionId)];
Assert.Equal(cmdlt.Environment, newSubscription.Environment);
Assert.Equal(cmdlt.CurrentStorageAccountName, newSubscription.GetProperty(AzureSubscription.Property.StorageAccount));
@@ -331,14 +326,15 @@ public void SetAzureSubscriptionDerivesEnvironmentFromResourcesEndpointParameter
[Fact]
public void SetAzureSubscriptionDerivesEnvironmentFromBothEndpointParameters()
{
- SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetAccount(azureAccount);
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetSubscription(azureSubscription1);
client.Profile.Save();
+ SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
+
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SubscriptionId = azureSubscription1.Id.ToString();
cmdlt.CurrentStorageAccountName = "NewCloudStorage";
@@ -351,7 +347,7 @@ public void SetAzureSubscriptionDerivesEnvironmentFromBothEndpointParameters()
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var newSubscription = client.Profile.Subscriptions[new Guid(cmdlt.SubscriptionId)];
Assert.Equal(cmdlt.Environment, newSubscription.Environment);
Assert.Equal(cmdlt.CurrentStorageAccountName, newSubscription.GetProperty(AzureSubscription.Property.StorageAccount));
@@ -360,15 +356,15 @@ public void SetAzureSubscriptionDerivesEnvironmentFromBothEndpointParameters()
[Fact]
public void SetAzureSubscriptionUpdatesSubscriptionWithCertificate()
{
- SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
-
// Setup
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetAccount(azureAccount);
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetSubscription(azureSubscription1);
client.Profile.Save();
+ SetAzureSubscriptionCommand cmdlt = new SetAzureSubscriptionCommand();
+
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SubscriptionId = azureSubscription1.Id.ToString();
cmdlt.CurrentStorageAccountName = "NewCloudStorage";
@@ -380,7 +376,7 @@ public void SetAzureSubscriptionUpdatesSubscriptionWithCertificate()
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var newSubscription = client.Profile.Subscriptions[new Guid(cmdlt.SubscriptionId)];
var newAccount = client.Profile.Accounts[SampleCertificate.Thumbprint];
var existingAccount = client.Profile.Accounts[azureAccount.Id];
@@ -403,16 +399,16 @@ public void ImportPublishSettingsFileSelectsCorrectEnvironment()
ImportAzurePublishSettingsCommand cmdlt = new ImportAzurePublishSettingsCommand();
// Setup
- ProfileClient.DataStore.WriteFile("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings",
+ AzureSession.DataStore.WriteFile("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings",
Properties.Resources.ValidProfileChina);
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var oldDataStore = FileUtilities.DataStore;
- FileUtilities.DataStore = ProfileClient.DataStore;
+ FileUtilities.DataStore = AzureSession.DataStore;
var expectedEnv = "AzureChinaCloud";
var expected = client.ImportPublishSettings("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings", null);
cmdlt.CommandRuntime = commandRuntimeMock;
- cmdlt.ProfileClient = new ProfileClient();
+ cmdlt.ProfileClient = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
cmdlt.PublishSettingsFile = "ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings";
try
@@ -442,16 +438,16 @@ public void ImportPublishSettingsFileOverwritesEnvironment()
ImportAzurePublishSettingsCommand cmdlt = new ImportAzurePublishSettingsCommand();
// Setup
- ProfileClient.DataStore.WriteFile("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings",
+ AzureSession.DataStore.WriteFile("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings",
Properties.Resources.ValidProfileChina);
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
var oldDataStore = FileUtilities.DataStore;
- FileUtilities.DataStore = ProfileClient.DataStore;
+ FileUtilities.DataStore = AzureSession.DataStore;
var expectedEnv = "AzureCloud";
var expected = client.ImportPublishSettings("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings", expectedEnv);
cmdlt.CommandRuntime = commandRuntimeMock;
- cmdlt.ProfileClient = new ProfileClient();
+ cmdlt.ProfileClient = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
cmdlt.PublishSettingsFile = "ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings";
cmdlt.Environment = expectedEnv;
@@ -479,8 +475,8 @@ public void ImportPublishSettingsFileOverwritesEnvironment()
[Fact]
public void SelectDefaultAzureSubscriptionByNameUpdatesProfile()
{
- SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
var client = SetupDefaultProfile();
+ SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
@@ -495,7 +491,7 @@ public void SelectDefaultAzureSubscriptionByNameUpdatesProfile()
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
Assert.NotNull(client.Profile.DefaultSubscription);
Assert.Equal(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
}
@@ -503,36 +499,34 @@ public void SelectDefaultAzureSubscriptionByNameUpdatesProfile()
[Fact]
public void SelectAzureSubscriptionByNameUpdatesProfile()
{
- SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
SetupDefaultProfile();
+ SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet");
cmdlt.SubscriptionName = azureSubscription2.Name;
- Assert.Null(AzureSession.CurrentContext.Subscription);
// Act
cmdlt.InvokeBeginProcessing();
cmdlt.ExecuteCmdlet();
cmdlt.InvokeEndProcessing();
-
+
// Verify
- Assert.NotNull(AzureSession.CurrentContext.Subscription);
- Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id);
+ Assert.NotNull(cmdlt.Profile.Context.Subscription);
+ Assert.Equal(azureSubscription2.Id, cmdlt.Profile.Context.Subscription.Id);
}
[Fact]
public void SelectAzureSubscriptionWithoutPassthroughDoesNotPrint()
{
- SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
SetupDefaultProfile();
+ SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet");
cmdlt.SubscriptionName = azureSubscription2.Name;
- Assert.Null(AzureSession.CurrentContext.Subscription);
// Act
cmdlt.InvokeBeginProcessing();
@@ -546,15 +540,14 @@ public void SelectAzureSubscriptionWithoutPassthroughDoesNotPrint()
[Fact]
public void SelectAzureSubscriptionWithPassthroughPrintsSubscription()
{
- SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
SetupDefaultProfile();
+ SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet");
cmdlt.SubscriptionName = azureSubscription2.Name;
cmdlt.PassThru = new SwitchParameter(true);
- Assert.Null(AzureSession.CurrentContext.Subscription);
// Act
cmdlt.InvokeBeginProcessing();
@@ -569,8 +562,8 @@ public void SelectAzureSubscriptionWithPassthroughPrintsSubscription()
[Fact]
public void SelectDefaultAzureSubscriptionByIdAndNoDefaultUpdatesProfile()
{
- SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
var client = SetupDefaultProfile();
+ SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
@@ -585,7 +578,7 @@ public void SelectDefaultAzureSubscriptionByIdAndNoDefaultUpdatesProfile()
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
Assert.NotNull(client.Profile.DefaultSubscription);
Assert.Equal(azureSubscription2.Id, client.Profile.DefaultSubscription.Id);
@@ -602,59 +595,21 @@ public void SelectDefaultAzureSubscriptionByIdAndNoDefaultUpdatesProfile()
cmdlt.InvokeEndProcessing();
// Verify
- client = new ProfileClient();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
Assert.Null(client.Profile.DefaultSubscription);
}
- [Fact]
- public void SelectAzureSubscriptionByIdAndNoCurrentUpdatesProfile()
- {
- SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
- SetupDefaultProfile();
-
- // Setup
- cmdlt.CommandRuntime = commandRuntimeMock;
- cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
- cmdlt.SubscriptionId = azureSubscription2.Id.ToString();
- Assert.Null(AzureSession.CurrentContext.Subscription);
-
- // Act
- cmdlt.InvokeBeginProcessing();
- cmdlt.ExecuteCmdlet();
- cmdlt.InvokeEndProcessing();
-
- // Verify
- Assert.NotNull(AzureSession.CurrentContext.Subscription);
- Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id);
-
- cmdlt = new SelectAzureSubscriptionCommand();
-
- // Setup
- cmdlt.CommandRuntime = commandRuntimeMock;
- cmdlt.SetParameterSet("NoCurrentSubscriptionParameterSet");
- cmdlt.NoCurrent = new SwitchParameter(true);
-
- // Act
- cmdlt.InvokeBeginProcessing();
- cmdlt.ExecuteCmdlet();
- cmdlt.InvokeEndProcessing();
-
- // Verify
- Assert.Null(AzureSession.CurrentContext.Subscription);
- }
-
[Fact]
public void SelectAzureSubscriptionByInvalidIdThrowsException()
{
- SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
SetupDefaultProfile();
+ SelectAzureSubscriptionCommand cmdlt = new SelectAzureSubscriptionCommand();
// Setup
cmdlt.CommandRuntime = commandRuntimeMock;
cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
string invalidGuid = Guid.NewGuid().ToString();
cmdlt.SubscriptionId = invalidGuid;
- Assert.Null(AzureSession.CurrentContext.Subscription);
// Act
cmdlt.InvokeBeginProcessing();
@@ -665,7 +620,7 @@ public void SelectAzureSubscriptionByInvalidIdThrowsException()
}
catch (ArgumentException ex)
{
- Assert.Contains(string.Format(Microsoft.WindowsAzure.Commands.Common.Properties.Resources.InvalidSubscriptionId, invalidGuid), ex.Message);
+ Assert.Contains(string.Format("The subscription id {0} doesn't exist.\r\nParameter name: id", invalidGuid), ex.Message);
}
}
@@ -680,7 +635,6 @@ public void SelectAzureSubscriptionByInvalidGuidThrowsException()
cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet");
string invalidGuid = "foo";
cmdlt.SubscriptionId = invalidGuid;
- Assert.Null(AzureSession.CurrentContext.Subscription);
// Act
cmdlt.InvokeBeginProcessing();
@@ -697,7 +651,7 @@ public void SelectAzureSubscriptionByInvalidGuidThrowsException()
private ProfileClient SetupDefaultProfile()
{
- ProfileClient client = new ProfileClient();
+ ProfileClient client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
client.AddOrSetEnvironment(azureEnvironment);
client.AddOrSetAccount(azureAccount);
client.AddOrSetSubscription(azureSubscription1);
diff --git a/src/Common/Commands.Common.Test/Common/RemoveAzurePublishSettings.cs b/src/Common/Commands.Common.Test/Common/RemoveAzurePublishSettings.cs
index 6c5fa8acfa92..aea3d567dfd0 100644
--- a/src/Common/Commands.Common.Test/Common/RemoveAzurePublishSettings.cs
+++ b/src/Common/Commands.Common.Test/Common/RemoveAzurePublishSettings.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Common;
namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
@@ -21,7 +21,7 @@ public class RemoveAzurePublishSettingsCommand
{
public void RemovePublishSettingsProcess(string azureSdkDirPath)
{
- ProfileClient.DataStore.EmptyDirectory(azureSdkDirPath);
+ AzureSession.DataStore.EmptyDirectory(azureSdkDirPath);
}
}
}
\ No newline at end of file
diff --git a/src/Common/Commands.Common.Test/Common/ServicePrincipalStoreTests.cs b/src/Common/Commands.Common.Test/Common/ServicePrincipalStoreTests.cs
index 727260cdbf2a..9e14767655db 100644
--- a/src/Common/Commands.Common.Test/Common/ServicePrincipalStoreTests.cs
+++ b/src/Common/Commands.Common.Test/Common/ServicePrincipalStoreTests.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions.Authentication;
+using Microsoft.Azure.Common.Authentication;
using System;
using System.Runtime.InteropServices;
using System.Security;
diff --git a/src/Common/Commands.Common.Test/Common/TestBase.cs b/src/Common/Commands.Common.Test/Common/TestBase.cs
index 9e36cc6c2c61..eab7d2c7dfbf 100644
--- a/src/Common/Commands.Common.Test/Common/TestBase.cs
+++ b/src/Common/Commands.Common.Test/Common/TestBase.cs
@@ -16,10 +16,10 @@
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
{
@@ -28,6 +28,8 @@ namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
///
public abstract class TestBase
{
+ protected AzureProfile currentProfile;
+
public TestBase()
{
BaseSetup();
@@ -39,17 +41,17 @@ public TestBase()
[TestInitialize]
public void BaseSetup()
{
- if (ProfileClient.DataStore != null && !(ProfileClient.DataStore is MockDataStore))
+ if (AzureSession.DataStore != null && !(AzureSession.DataStore is MockDataStore))
{
- ProfileClient.DataStore = new MockDataStore();
+ AzureSession.DataStore = new MockDataStore();
}
- if (AzureSession.CurrentContext.Subscription == null)
+ currentProfile = new AzureProfile();
+
+ if (currentProfile.Context.Subscription == null)
{
var newGuid = Guid.NewGuid();
- AzureSession.SetCurrentContext(
- new AzureSubscription { Id = newGuid, Name = "test", Environment = EnvironmentName.AzureCloud, Account = "test" },
- null,
- new AzureAccount
+ currentProfile.Subscriptions[newGuid] = new AzureSubscription { Id = newGuid, Name = "test", Environment = EnvironmentName.AzureCloud, Account = "test" };
+ currentProfile.Accounts["test"] = new AzureAccount
{
Id = "test",
Type = AzureAccount.AccountType.User,
@@ -57,7 +59,8 @@ public void BaseSetup()
{
{AzureAccount.Property.Subscriptions, newGuid.ToString()}
}
- });
+ };
+ currentProfile.DefaultSubscription = currentProfile.Subscriptions[newGuid];
}
AzureSession.AuthenticationFactory = new MockTokenAuthenticationFactory();
}
diff --git a/src/Common/Commands.Common.Test/Common/Testing.cs b/src/Common/Commands.Common.Test/Common/Testing.cs
index 0e546b0aff7a..aa441770f3d4 100644
--- a/src/Common/Commands.Common.Test/Common/Testing.cs
+++ b/src/Common/Commands.Common.Test/Common/Testing.cs
@@ -75,7 +75,7 @@ public static void AssertThrows(Action action, string expectedMessage)
catch (Exception ex)
{
Assert.IsInstanceOfType(ex, typeof(T));
- Assert.AreEqual(expectedMessage, ex.Message);
+ Assert.AreEqual(expectedMessage, ex.Message, ex.ToString());
}
}
diff --git a/src/Common/Commands.Common.Test/Mocks/MockAccessToken.cs b/src/Common/Commands.Common.Test/Mocks/MockAccessToken.cs
index 72037f0e2809..4acccb09d00f 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockAccessToken.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockAccessToken.cs
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------------
using System;
-using Microsoft.Azure.Common.Extensions.Authentication;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
{
diff --git a/src/Common/Commands.Common.Test/Mocks/MockAccessTokenProvider.cs b/src/Common/Commands.Common.Test/Mocks/MockAccessTokenProvider.cs
index 34bfe4adb8d6..8b14461bc714 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockAccessTokenProvider.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockAccessTokenProvider.cs
@@ -13,9 +13,9 @@
// ----------------------------------------------------------------------------------
using System.Security;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
-using Microsoft.Azure.Common.Extensions.Authentication;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
{
diff --git a/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs
index 03b03e09fa52..65328c311d27 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs
@@ -13,9 +13,8 @@
// ----------------------------------------------------------------------------------
using Microsoft.Azure;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Authentication;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using System.Security;
using System.Security.Cryptography.X509Certificates;
diff --git a/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs
index f6f5cdbbb5fa..0d4dd8a15061 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs
@@ -22,10 +22,11 @@
using Hyak.Common;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Azure.Common;
-using Microsoft.Azure.Common.Extensions.Factories;
-using Microsoft.Azure.Common.Extensions.Models;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication.Factories;
+using Microsoft.Azure.Common.Authentication.Models;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure;
+using System.IO;
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
{
@@ -52,23 +53,37 @@ public TClient CreateClient(AzureContext context, AzureEnvironment.Endp
return client;
}
- public TClient CreateClient(AzureSubscription subscription, AzureEnvironment.Endpoint endpoint) where TClient : ServiceClient
+ public TClient CreateClient(AzureProfile profile, AzureEnvironment.Endpoint endpoint) where TClient : ServiceClient
{
+ throw new NotImplementedException();
+ }
+
+ public TClient CreateClient(AzureProfile profile, AzureSubscription subscription, AzureEnvironment.Endpoint endpoint) where TClient : ServiceClient
+ {
+ if (subscription == null)
+ {
+ throw new ArgumentException(Commands.Common.Properties.Resources.InvalidDefaultSubscription);
+ }
+
+ if (profile == null)
+ {
+ profile = new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile));
+ }
+
SubscriptionCloudCredentials creds = new TokenCloudCredentials(subscription.Id.ToString(), "fake_token");
if (HttpMockServer.GetCurrentMode() != HttpRecorderMode.Playback)
{
- ProfileClient profileClient = new ProfileClient();
- AzureContext context = new AzureContext()
- {
- Account = profileClient.GetAccount(subscription.Account),
- Environment = profileClient.GetEnvironmentOrDefault(subscription.Environment),
- Subscription = subscription
- };
+ ProfileClient profileClient = new ProfileClient(profile);
+ AzureContext context = new AzureContext(
+ subscription,
+ profileClient.GetAccount(subscription.Account),
+ profileClient.GetEnvironmentOrDefault(subscription.Environment)
+ );
creds = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(context);
}
- Uri endpointUri = (new ProfileClient()).Profile.Environments[subscription.Environment].GetEndpointAsUri(endpoint);
+ Uri endpointUri = profile.Environments[subscription.Environment].GetEndpointAsUri(endpoint);
return CreateCustomClient(creds, endpointUri);
}
diff --git a/src/Common/Commands.Common.Test/Mocks/MockDataStore.cs b/src/Common/Commands.Common.Test/Mocks/MockDataStore.cs
index 55b2f053632b..a6f72ecd94f2 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockDataStore.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockDataStore.cs
@@ -19,7 +19,7 @@
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
-using Microsoft.Azure.Common.Extensions.Interfaces;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
{
diff --git a/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs
index a6d4523c4fe9..b53006e3abbe 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs
@@ -13,9 +13,8 @@
// ----------------------------------------------------------------------------------
using Microsoft.Azure;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Authentication;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using System;
using System.Security;
@@ -62,7 +61,19 @@ public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environm
account.Id = "test";
}
- return TokenProvider(account, environment, tenant);
+ if (TokenProvider == null)
+ {
+ return new MockAccessToken()
+ {
+ AccessToken = account.Id,
+ LoginType = LoginType.OrgId,
+ UserId = account.Id
+ };
+ }
+ else
+ {
+ return TokenProvider(account, environment, tenant);
+ }
}
public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context)
diff --git a/src/Common/Commands.Common.Test/packages.config b/src/Common/Commands.Common.Test/packages.config
index 017a7b8159e3..79a7459dd7e9 100644
--- a/src/Common/Commands.Common.Test/packages.config
+++ b/src/Common/Commands.Common.Test/packages.config
@@ -1,18 +1,18 @@
-
-
+
+
-
+
-
+
-
+
diff --git a/src/Common/Commands.Common/AzurePSCmdlet.cs b/src/Common/Commands.Common/AzurePSCmdlet.cs
index abf5f1496930..a4ec8b56d41e 100644
--- a/src/Common/Commands.Common/AzurePSCmdlet.cs
+++ b/src/Common/Commands.Common/AzurePSCmdlet.cs
@@ -12,19 +12,23 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using System;
using System.Diagnostics;
+using System.IO;
using System.Management.Automation;
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
{
public abstract class AzurePSCmdlet : PSCmdlet
{
- private readonly RecordingTracingInterceptor httpTracingInterceptor = new RecordingTracingInterceptor();
+ private readonly RecordingTracingInterceptor _httpTracingInterceptor = new RecordingTracingInterceptor();
+
+ [Parameter(Mandatory = false, HelpMessage = "In-memory profile.")]
+ public AzureProfile Profile { get; set; }
static AzurePSCmdlet()
{
@@ -36,40 +40,66 @@ static AzurePSCmdlet()
AzureSession.ClientFactory.UserAgents.Add(AzurePowerShell.UserAgentValue);
}
- public AzurePSCmdlet()
+ ///
+ /// Cmdlet begin process. Write to logs, setup Http Tracing and initialize profile
+ ///
+ protected override void BeginProcessing()
{
- DefaultProfileClient = new ProfileClient();
+ InitializeProfile();
- if (AzureSession.CurrentContext.Subscription == null &&
- DefaultProfileClient.Profile.DefaultSubscription != null)
+ if (string.IsNullOrEmpty(ParameterSetName))
{
- try
- {
- AzureSession.SetCurrentContext(
- DefaultProfileClient.Profile.DefaultSubscription,
- DefaultProfileClient.GetEnvironmentOrDefault(
- DefaultProfileClient.Profile.DefaultSubscription.Environment),
- DefaultProfileClient.GetAccountOrNull(DefaultProfileClient.Profile.DefaultSubscription.Account));
- }
- catch
- {
- // Ignore anything at this point
- }
+ WriteDebugWithTimestamp(string.Format(Resources.BeginProcessingWithoutParameterSetLog, this.GetType().Name));
+ }
+ else
+ {
+ WriteDebugWithTimestamp(string.Format(Resources.BeginProcessingWithParameterSetLog, this.GetType().Name, ParameterSetName));
+ }
+
+ if (Profile.Context != null && Profile.Context.Account != null && Profile.Context.Account.Id != null)
+ {
+ WriteDebugWithTimestamp(string.Format("using account id '{0}'...", Profile.Context.Account.Id));
}
+ RecordingTracingInterceptor.AddToContext(_httpTracingInterceptor);
+
+ base.BeginProcessing();
}
- public AzureContext CurrentContext
+ private void InitializeProfile()
{
- get { return AzureSession.CurrentContext; }
+ // Load profile from disk
+ var profileFromDisk = new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile));
+ if (Profile == null ||
+ Profile.ProfilePath == profileFromDisk.ProfilePath)
+ {
+ Profile = profileFromDisk;
+ }
}
- public bool HasCurrentSubscription
+ ///
+ /// End processing. Flush messages in tracing interceptor and save profile.
+ ///
+ protected override void EndProcessing()
{
- get { return AzureSession.CurrentContext.Subscription != null; }
+ string message = string.Format(Resources.EndProcessingLog, this.GetType().Name);
+ WriteDebugWithTimestamp(message);
+
+ RecordingTracingInterceptor.RemoveFromContext(_httpTracingInterceptor);
+ FlushMessagesFromTracingInterceptor();
+
+ base.EndProcessing();
}
- public ProfileClient DefaultProfileClient { get; private set; }
+ /*public AzureContext Profile.Context
+ {
+ get { return Profile.Context; }
+ }*/
+
+ public bool HasCurrentSubscription
+ {
+ get { return Profile.Context.Subscription != null; }
+ }
protected string CurrentPath()
{
@@ -207,53 +237,15 @@ protected override void ProcessRecord()
}
}
- ///
- /// Cmdlet begin process
- ///
- protected override void BeginProcessing()
- {
- if (string.IsNullOrEmpty(ParameterSetName))
- {
- WriteDebugWithTimestamp(string.Format(Resources.BeginProcessingWithoutParameterSetLog, this.GetType().Name));
- }
- else
- {
- WriteDebugWithTimestamp(string.Format(Resources.BeginProcessingWithParameterSetLog, this.GetType().Name, ParameterSetName));
- }
-
- if (CurrentContext != null && CurrentContext.Account != null && CurrentContext.Account.Id != null)
- {
- WriteDebugWithTimestamp(string.Format("using account id '{0}'...", CurrentContext.Account.Id));
- }
-
- RecordingTracingInterceptor.AddToContext(httpTracingInterceptor);
-
- base.BeginProcessing();
- }
-
private void FlushMessagesFromTracingInterceptor()
{
string message;
- while (httpTracingInterceptor.MessageQueue.TryDequeue(out message))
+ while (_httpTracingInterceptor.MessageQueue.TryDequeue(out message))
{
base.WriteDebug(message);
}
}
- ///
- /// End processing
- ///
- protected override void EndProcessing()
- {
- string message = string.Format(Resources.EndProcessingLog, this.GetType().Name);
- WriteDebugWithTimestamp(message);
-
- RecordingTracingInterceptor.RemoveFromContext(httpTracingInterceptor);
- FlushMessagesFromTracingInterceptor();
-
- base.EndProcessing();
- }
-
///
/// Asks for confirmation before executing the action.
///
diff --git a/src/Common/Commands.Common/AzurePowerShell.cs b/src/Common/Commands.Common/AzurePowerShell.cs
index 89eb873f080a..63648b9f3f0d 100644
--- a/src/Common/Commands.Common/AzurePowerShell.cs
+++ b/src/Common/Commands.Common/AzurePowerShell.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions.Properties;
+using Microsoft.Azure.Common.Authentication.Properties;
using System;
using System.IO;
using System.Net.Http.Headers;
diff --git a/src/Common/Commands.Common/CloudBaseCmdlet.cs b/src/Common/Commands.Common/CloudBaseCmdlet.cs
index b8a8ee7a4412..9d9463a3e207 100644
--- a/src/Common/Commands.Common/CloudBaseCmdlet.cs
+++ b/src/Common/Commands.Common/CloudBaseCmdlet.cs
@@ -12,8 +12,8 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using System;
@@ -81,14 +81,14 @@ protected virtual void InitChannelCurrentSubscription(bool force)
protected void DoInitChannelCurrentSubscription(bool force)
{
- if (CurrentContext.Subscription == null)
+ if (Profile.Context.Subscription == null)
{
- throw new ArgumentException(Resources.InvalidCurrentSubscription);
+ throw new ArgumentException(Resources.InvalidDefaultSubscription);
}
- if (CurrentContext.Account == null)
+ if (Profile.Context.Account == null)
{
- throw new ArgumentException(Resources.InvalidCurrentSuscriptionCertificate);
+ throw new ArgumentException(Resources.AccountNeedsToBeSpecified);
}
if (Channel == null || force)
@@ -127,19 +127,19 @@ protected virtual T CreateChannel()
return Channel;
}
- string certificateThumbprint = CurrentContext.Account.Id;
- Debug.Assert(DefaultProfileClient.Profile.Accounts[certificateThumbprint].Type == AzureAccount.AccountType.Certificate);
+ string certificateThumbprint = Profile.Context.Account.Id;
+ Debug.Assert(Profile.Accounts[certificateThumbprint].Type == AzureAccount.AccountType.Certificate);
return ChannelHelper.CreateServiceManagementChannel(
ServiceBinding,
- CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement),
- ProfileClient.DataStore.GetCertificate(certificateThumbprint),
+ Profile.Context.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement),
+ AzureSession.DataStore.GetCertificate(certificateThumbprint),
new HttpRestMessageInspector(WriteDebug));
}
protected void RetryCall(Action call)
{
- RetryCall(CurrentContext.Subscription.Id, call);
+ RetryCall(Profile.Context.Subscription.Id, call);
}
protected void RetryCall(Guid subsId, Action call)
@@ -172,7 +172,7 @@ protected void RetryCall(Guid subsId, Action call)
protected TResult RetryCall(Func call)
{
- return RetryCall(CurrentContext.Subscription.Id, call);
+ return RetryCall(Profile.Context.Subscription.Id, call);
}
protected TResult RetryCall(Guid subsId, Func call)
diff --git a/src/Common/Commands.Common/CmdletExtensions.cs b/src/Common/Commands.Common/CmdletExtensions.cs
index c1cb970e42a3..9942a85f769a 100644
--- a/src/Common/Commands.Common/CmdletExtensions.cs
+++ b/src/Common/Commands.Common/CmdletExtensions.cs
@@ -123,6 +123,13 @@ public static void InvokeEndProcessing(this PSCmdlet cmdlt)
MethodInfo dynMethod = (typeof(PSCmdlet)).GetMethod("EndProcessing", BindingFlags.NonPublic | BindingFlags.Instance);
dynMethod.Invoke(cmdlt, null);
}
+ public static void ExecuteWithProcessing(this AzurePSCmdlet cmdlt)
+ {
+ cmdlt.InvokeBeginProcessing();
+ cmdlt.ExecuteCmdlet();
+ cmdlt.InvokeEndProcessing();
+
+ }
#endregion
}
diff --git a/src/Common/Commands.Common/Commands.Common.csproj b/src/Common/Commands.Common/Commands.Common.csproj
index 3a8653344463..6e4638bd7127 100644
--- a/src/Common/Commands.Common/Commands.Common.csproj
+++ b/src/Common/Commands.Common/Commands.Common.csproj
@@ -52,19 +52,19 @@
False
- ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
False
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
False
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -79,13 +79,13 @@
..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/Common/Commands.Common/GeneralUtilities.cs b/src/Common/Commands.Common/GeneralUtilities.cs
index 776b11817439..787b18fe10a5 100644
--- a/src/Common/Commands.Common/GeneralUtilities.cs
+++ b/src/Common/Commands.Common/GeneralUtilities.cs
@@ -13,8 +13,7 @@
// ----------------------------------------------------------------------------------
using Hyak.Common;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Properties;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Common;
using System;
using System.Collections.Generic;
@@ -52,7 +51,9 @@ private static bool TryFindCertificatesInStore(string thumbprint,
public static string GetNodeModulesPath()
{
- return Path.Combine(FileUtilities.GetAssemblyDirectory(), Resources.NodeModulesPath);
+ return Path.Combine(
+ FileUtilities.GetAssemblyDirectory(),
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.NodeModulesPath);
}
[PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")]
@@ -72,7 +73,9 @@ public static X509Certificate2 GetCertificateFromStore(string thumbprint)
}
else
{
- throw new ArgumentException(string.Format(Resources.CertificateNotFoundInStore, thumbprint));
+ throw new ArgumentException(string.Format(
+ Microsoft.Azure.Common.Authentication.Properties.Resources.CertificateNotFoundInStore,
+ thumbprint));
}
}
diff --git a/src/Common/Commands.Common/HttpClientExtensions.cs b/src/Common/Commands.Common/HttpClientExtensions.cs
index 1571324e132f..5f7e313644d2 100644
--- a/src/Common/Commands.Common/HttpClientExtensions.cs
+++ b/src/Common/Commands.Common/HttpClientExtensions.cs
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Common;
using Newtonsoft.Json;
using System;
diff --git a/src/Common/Commands.Common/PSAzureAccount.cs b/src/Common/Commands.Common/PSAzureAccount.cs
index f39fcd405d0c..c01ef746316f 100644
--- a/src/Common/Commands.Common/PSAzureAccount.cs
+++ b/src/Common/Commands.Common/PSAzureAccount.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-namespace Microsoft.Azure.Common.Extensions.Models
+namespace Microsoft.Azure.Common.Authentication.Models
{
public class PSAzureAccount
{
diff --git a/src/Common/Commands.Common/ProfileClientExtensions.cs b/src/Common/Commands.Common/ProfileClientExtensions.cs
index 5a14b5d566c7..20b734ed808f 100644
--- a/src/Common/Commands.Common/ProfileClientExtensions.cs
+++ b/src/Common/Commands.Common/ProfileClientExtensions.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
namespace Microsoft.WindowsAzure.Commands.Common
{
diff --git a/src/Common/Commands.Common/Properties/Resources.Designer.cs b/src/Common/Commands.Common/Properties/Resources.Designer.cs
index d3fef027128f..1fceef514540 100644
--- a/src/Common/Commands.Common/Properties/Resources.Designer.cs
+++ b/src/Common/Commands.Common/Properties/Resources.Designer.cs
@@ -8,10 +8,10 @@
//
//------------------------------------------------------------------------------
-namespace Microsoft.WindowsAzure.Commands.Common.Properties
-{
-
-
+namespace Microsoft.WindowsAzure.Commands.Common.Properties {
+ using System;
+
+
///
/// A strongly-typed resource class, for looking up localized strings, etc.
///
@@ -78,6 +78,15 @@ public static string AccountIdDoesntMatchSubscription {
}
}
+ ///
+ /// Looks up a localized string similar to Account needs to be specified.
+ ///
+ public static string AccountNeedsToBeSpecified {
+ get {
+ return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Account "{0}" has been added..
///
@@ -240,15 +249,6 @@ public static string AzureDirectory {
}
}
- ///
- /// Looks up a localized string similar to Windows Azure Powershell.
- ///
- public static string AzureDirectoryName {
- get {
- return ResourceManager.GetString("AzureDirectoryName", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to https://manage.windowsazure.com.
///
@@ -447,24 +447,6 @@ public static string CertificateImportedMessage {
}
}
- ///
- /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}.
- ///
- public static string CertificateNotFoundInStore {
- get {
- return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}.
- ///
- public static string CertificateNotFoundInStore1 {
- get {
- return ResourceManager.GetString("CertificateNotFoundInStore1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}.
///
@@ -510,15 +492,6 @@ public static string ChangeSettingsElementMessage {
}
}
- ///
- /// Looks up a localized string similar to Changing public environment is not supported..
- ///
- public static string ChangingDefaultEnvironmentNotSupported {
- get {
- return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Choose which publish settings file to use:.
///
@@ -591,15 +564,6 @@ public static string CompleteMessage {
}
}
- ///
- /// Looks up a localized string similar to Complete.
- ///
- public static string CompleteMessage1 {
- get {
- return ResourceManager.GetString("CompleteMessage1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to config.json.
///
@@ -627,15 +591,6 @@ public static string CreateWebsiteFailed {
}
}
- ///
- /// Looks up a localized string similar to -Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account..
- ///
- public static string CredentialOrganizationIdMessage {
- get {
- return ResourceManager.GetString("CredentialOrganizationIdMessage", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core.
///
@@ -852,15 +807,6 @@ public static string EnvironmentNameDoesntMatchSubscription {
}
}
- ///
- /// Looks up a localized string similar to The environment name '{0}' is not found..
- ///
- public static string EnvironmentNotFound {
- get {
- return ResourceManager.GetString("EnvironmentNotFound", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to environments.xml.
///
@@ -897,15 +843,6 @@ public static string ErrorUpdatingVirtualMachine {
}
}
- ///
- /// Looks up a localized string similar to Your Microsoft Azure credential in the Windows PowerShell session has expired. Please use Add-AzureAccount to login again..
- ///
- public static string ExpiredRefreshToken {
- get {
- return ResourceManager.GetString("ExpiredRefreshToken", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}.
///
@@ -987,15 +924,6 @@ public static string GlobalSettingsManager_Load_PublishSettingsNotFound {
}
}
- ///
- /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile..
- ///
- public static string GlobalSettingsManager_Load_PublishSettingsNotFound1 {
- get {
- return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to iisnode.dll.
///
@@ -1041,24 +969,6 @@ public static string IISNodeVersionWarningText {
}
}
- ///
- /// Looks up a localized string similar to Illegal characters in path..
- ///
- public static string IllegalPath {
- get {
- return ResourceManager.GetString("IllegalPath", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Illegal characters in path..
- ///
- public static string IllegalPath1 {
- get {
- return ResourceManager.GetString("IllegalPath1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Internal Server Error.
///
@@ -1077,24 +987,6 @@ public static string InvalidCacheRoleName {
}
}
- ///
- /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings.
- ///
- public static string InvalidCertificate {
- get {
- return ResourceManager.GetString("InvalidCertificate", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings.
- ///
- public static string InvalidCertificate1 {
- get {
- return ResourceManager.GetString("InvalidCertificate1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Invalid certificate format..
///
@@ -1122,42 +1014,6 @@ public static string InvalidCountryNameMessage {
}
}
- ///
- /// Looks up a localized string similar to Credential type invalid, only handles '{0}'.
- ///
- public static string InvalidCredentialType {
- get {
- return ResourceManager.GetString("InvalidCredentialType", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to No current subscription has been designated. Use Select-AzureSubscription -Current <subscriptionName> to set the current subscription..
- ///
- public static string InvalidCurrentSubscription {
- get {
- return ResourceManager.GetString("InvalidCurrentSubscription", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The ID of the current subscription is invalid. Use Set-AzureSubscription to fix the subscription ID or use Select-AzureSubscription to use a different subscription..
- ///
- public static string InvalidCurrentSubscriptionId {
- get {
- return ResourceManager.GetString("InvalidCurrentSubscriptionId", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The management certificate of the current subscription is invalid. Use Set-AzureSubscription to fix the management certificate or use Select-AzureSubscription to use a different subscription..
- ///
- public static string InvalidCurrentSuscriptionCertificate {
- get {
- return ResourceManager.GetString("InvalidCurrentSuscriptionCertificate", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription..
///
@@ -1185,15 +1041,6 @@ public static string InvalidDeploymentSlot {
}
}
- ///
- /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}.
- ///
- public static string InvalidDnsName {
- get {
- return ResourceManager.GetString("InvalidDnsName", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Invalid service endpoint..
///
@@ -1203,15 +1050,6 @@ public static string InvalidEndpoint {
}
}
- ///
- /// Looks up a localized string similar to The provided file in {0} must be have {1} extension.
- ///
- public static string InvalidFileExtension {
- get {
- return ResourceManager.GetString("InvalidFileExtension", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to File {0} has invalid characters.
///
@@ -1271,15 +1109,6 @@ public static string InvalidJobFile {
}
}
- ///
- /// Looks up a localized string similar to Cannot create instance of management client type {0}. It does not have the expected constructor..
- ///
- public static string InvalidManagementClientType {
- get {
- return ResourceManager.GetString("InvalidManagementClientType", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again..
///
@@ -1316,15 +1145,6 @@ public static string InvalidNullArgument {
}
}
- ///
- /// Looks up a localized string similar to {0} is invalid or empty.
- ///
- public static string InvalidOrEmptyArgumentMessage {
- get {
- return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to The provided package path is invalid or doesn't exist.
///
@@ -1370,15 +1190,6 @@ public static string InvalidPublishSettingsSchema {
}
}
- ///
- /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile.
- ///
- public static string InvalidPublishSettingsSchema1 {
- get {
- return ResourceManager.GetString("InvalidPublishSettingsSchema1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to The provided role name "{0}" has invalid characters.
///
@@ -1451,15 +1262,6 @@ public static string InvalidServiceSettingElement {
}
}
- ///
- /// Looks up a localized string similar to You must provide valid value for {0}.
- ///
- public static string InvalidServiceSettingElement1 {
- get {
- return ResourceManager.GetString("InvalidServiceSettingElement1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to settings.json is invalid or doesn't exist.
///
@@ -1487,15 +1289,6 @@ public static string InvalidSubscriptionId {
}
}
- ///
- /// Looks up a localized string similar to Must specify a non-null subscription name..
- ///
- public static string InvalidSubscriptionName {
- get {
- return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet.
///
@@ -1514,15 +1307,6 @@ public static string InvalidSubscriptionsDataSchema {
}
}
- ///
- /// Looks up a localized string similar to Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials..
- ///
- public static string InvalidSubscriptionState {
- get {
- return ResourceManager.GetString("InvalidSubscriptionState", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge..
///
@@ -1925,24 +1709,6 @@ public static string NoHint {
}
}
- ///
- /// Looks up a localized string similar to Please connect to internet before executing this cmdlet.
- ///
- public static string NoInternetConnection {
- get {
- return ResourceManager.GetString("NoInternetConnection", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Please connect to internet before executing this cmdlet.
- ///
- public static string NoInternetConnection1 {
- get {
- return ResourceManager.GetString("NoInternetConnection1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to <NONE>.
///
@@ -2101,24 +1867,6 @@ public static string PackageJsonFileName {
}
}
- ///
- /// Looks up a localized string similar to Path {0} doesn't exist..
- ///
- public static string PathDoesNotExist {
- get {
- return ResourceManager.GetString("PathDoesNotExist", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Path for {0} doesn't exist in {1}..
- ///
- public static string PathDoesNotExistForElement {
- get {
- return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to A value for the Peer Asn has to be provided..
///
@@ -2377,15 +2125,6 @@ public static string PublishSettingsFileName {
}
}
- ///
- /// Looks up a localized string similar to &whr={0}.
- ///
- public static string PublishSettingsFileRealmFormat {
- get {
- return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Publish settings imported.
///
@@ -2629,24 +2368,6 @@ public static string RemoveAzureServiceWaitMessage {
}
}
- ///
- /// Looks up a localized string similar to The current subscription is being removed. Use Select-AzureSubscription <subscriptionName> to select a new current subscription..
- ///
- public static string RemoveCurrentSubscription {
- get {
- return ResourceManager.GetString("RemoveCurrentSubscription", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription..
- ///
- public static string RemoveDefaultSubscription {
- get {
- return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Removing {0} deployment for {1} service.
///
@@ -2899,15 +2620,6 @@ public static string RemoveWebsiteWarning {
}
}
- ///
- /// Looks up a localized string similar to Removing public environment is not supported..
- ///
- public static string RemovingDefaultEnvironmentsNotSupported {
- get {
- return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Deleting namespace.
///
@@ -3196,15 +2908,6 @@ public static string ServiceDefinitionFileName {
}
}
- ///
- /// Looks up a localized string similar to ServiceDefinition.csdef.
- ///
- public static string ServiceDefinitionFileName1 {
- get {
- return ResourceManager.GetString("ServiceDefinitionFileName1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to {0}Deploy.
///
@@ -3233,16 +2936,7 @@ public static string ServiceIsInTransitionState {
}
///
- /// Looks up a localized string similar to Unable to retrieve service key for ServicePrincipal account {0}. Please run the Add-AzureAccount cmdlet to supply the credentials for this service principal..
- ///
- public static string ServiceKeyNotFound {
- get {
- return ResourceManager.GetString("ServiceKeyNotFound", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to .
+ /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.".
///
public static string ServiceManagementClientExceptionStringFormat {
get {
@@ -3250,15 +2944,6 @@ public static string ServiceManagementClientExceptionStringFormat {
}
}
- ///
- /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.".
- ///
- public static string ServiceManagementClientExceptionStringFormat1 {
- get {
- return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Begin Operation: {0}.
///
@@ -3304,24 +2989,6 @@ public static string ServiceName {
}
}
- ///
- /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name.
- ///
- public static string ServiceNameExists {
- get {
- return ResourceManager.GetString("ServiceNameExists", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name.
- ///
- public static string ServiceNameExists1 {
- get {
- return ResourceManager.GetString("ServiceNameExists1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Please provide name for the hosted service.
///
@@ -3376,24 +3043,6 @@ public static string ServiceSettings_ValidateStorageAccountName_InvalidName {
}
}
- ///
- /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only..
- ///
- public static string ServiceSettings_ValidateStorageAccountName_InvalidName1 {
- get {
- return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName1", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to service settings.
- ///
- public static string ServiceSettings1 {
- get {
- return ResourceManager.GetString("ServiceSettings1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist..
///
@@ -3485,15 +3134,6 @@ public static string SettingsFileName {
}
}
- ///
- /// Looks up a localized string similar to deploymentSettings.json.
- ///
- public static string SettingsFileName1 {
- get {
- return ResourceManager.GetString("SettingsFileName1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint..
///
@@ -3521,15 +3161,6 @@ public static string ShouldProcessCaption {
}
}
- ///
- /// Looks up a localized string similar to Confirm.
- ///
- public static string ShouldProcessCaption1 {
- get {
- return ResourceManager.GetString("ShouldProcessCaption1", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Shutdown.
///
@@ -3728,15 +3359,6 @@ public static string SubscriptionDataFileNotFound {
}
}
- ///
- /// Looks up a localized string similar to The subscription id {0} doesn't exist..
- ///
- public static string SubscriptionIdNotFoundMessage {
- get {
- return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Subscription must not be null.
///
@@ -3746,15 +3368,6 @@ public static string SubscriptionMustNotBeNull {
}
}
- ///
- /// Looks up a localized string similar to The subscription name {0} doesn't exist..
- ///
- public static string SubscriptionNameNotFoundMessage {
- get {
- return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Suspend.
///
@@ -3809,24 +3422,6 @@ public static string UnableToDecodeBase64String {
}
}
- ///
- /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}..
- ///
- public static string UnableToPatchJson {
- get {
- return ResourceManager.GetString("UnableToPatchJson", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Illegal credential type.
- ///
- public static string UnknownCredentialType {
- get {
- return ResourceManager.GetString("UnknownCredentialType", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to The provider {0} is unknown..
///
@@ -4016,15 +3611,6 @@ public static string WorkerRoleTemplateFileName {
}
}
- ///
- /// Looks up a localized string similar to (x86).
- ///
- public static string x86InProgramFiles {
- get {
- return ResourceManager.GetString("x86InProgramFiles", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Yes.
///
diff --git a/src/Common/Commands.Common/Properties/Resources.resx b/src/Common/Commands.Common/Properties/Resources.resx
index 8374c78d8185..12709dd8a7ca 100644
--- a/src/Common/Commands.Common/Properties/Resources.resx
+++ b/src/Common/Commands.Common/Properties/Resources.resx
@@ -168,9 +168,6 @@
Windows Azure Powershell\
-
- Windows Azure Powershell
-
https://manage.windowsazure.com
@@ -238,12 +235,6 @@
Certificate imported into CurrentUser\My\{0}
-
- No certificate was found in the certificate store with thumbprint {0}
-
-
- No certificate was found in the certificate store with thumbprint {0}
-
Your account does not have access to the private key for certificate {0}
@@ -283,9 +274,6 @@
Complete
-
- Complete
-
config.json
@@ -366,9 +354,6 @@
The environment '{0}' already exists.
-
- The environment name '{0}' is not found.
-
environments.xml
@@ -383,9 +368,6 @@
Error updating VirtualMachine
WAPackIaaS
-
- Your Microsoft Azure credential in the Windows PowerShell session has expired. Please use Add-AzureAccount to login again.
-
Job Id {0} failed. Error: {1}, ExceptionDetails: {2}
WAPackIaaS
@@ -414,9 +396,6 @@
Could not find publish settings. Please run Import-AzurePublishSettingsFile.
-
- Could not find publish settings. Please run Import-AzurePublishSettingsFile.
-
iisnode.dll
@@ -432,24 +411,12 @@
Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2})
-
- Illegal characters in path.
-
-
- Illegal characters in path.
-
Internal Server Error
Cannot enable memcach protocol on a cache worker role {0}.
-
- Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings
-
-
- Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings
-
Invalid certificate format.
@@ -459,33 +426,15 @@
The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.
-
- No current subscription has been designated. Use Select-AzureSubscription -Current <subscriptionName> to set the current subscription.
-
-
- The ID of the current subscription is invalid. Use Set-AzureSubscription to fix the subscription ID or use Select-AzureSubscription to use a different subscription.
-
-
- The management certificate of the current subscription is invalid. Use Set-AzureSubscription to fix the management certificate or use Select-AzureSubscription to use a different subscription.
-
-
- No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.
-
Deployment with {0} does not exist
The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".
-
- "{0}" is an invalid DNS name for {1}
-
Invalid service endpoint.
-
- The provided file in {0} must be have {1} extension
-
File {0} has invalid characters
@@ -509,9 +458,6 @@ Please follow these steps in the portal:
There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.
-
- Cannot create instance of management client type {0}. It does not have the expected constructor.
-
Could not download a valid runtime manifest, Please check your internet connection and try again.
@@ -524,9 +470,6 @@ Please follow these steps in the portal:
Value cannot be null. Parameter name: '{0}'
-
- {0} is invalid or empty
-
The provided package path is invalid or doesn't exist
@@ -542,9 +485,6 @@ Please follow these steps in the portal:
The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile
-
- The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile
-
The provided role name "{0}" has invalid characters
@@ -569,9 +509,6 @@ Please follow these steps in the portal:
You must provide valid value for {0}
-
- You must provide valid value for {0}
-
settings.json is invalid or doesn't exist
@@ -581,18 +518,12 @@ Please follow these steps in the portal:
The provided subscription id {0} is not valid
-
- Must specify a non-null subscription name.
-
A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet
The provided subscriptions file {0} has invalid content.
-
- Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials.
-
Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.
@@ -733,12 +664,6 @@ use and privacy statement at {0} and (c) agree to sharing my contact information
No, I do not agree
-
- Please connect to internet before executing this cmdlet
-
-
- Please connect to internet before executing this cmdlet
-
No publish settings files with extension *.publishsettings are found in the directory "{0}".
@@ -797,12 +722,6 @@ use and privacy statement at {0} and (c) agree to sharing my contact information
package.json
-
- Path {0} doesn't exist.
-
-
- Path for {0} doesn't exist in {1}.
-
A value for the Peer Asn has to be provided.
@@ -893,9 +812,6 @@ Please follow these steps in the portal:
publishSettings.xml
-
- &whr={0}
-
Publish settings imported
@@ -977,12 +893,6 @@ Please follow these steps in the portal:
Removing cloud service {0}...
-
- The current subscription is being removed. Use Select-AzureSubscription <subscriptionName> to select a new current subscription.
-
-
- The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.
-
Removing {0} deployment for {1} service
@@ -1142,9 +1052,6 @@ Please follow these steps in the portal:
ServiceDefinition.csdef
-
- ServiceDefinition.csdef
-
{0}Deploy
@@ -1169,12 +1076,6 @@ Please follow these steps in the portal:
service name
-
- The provided service name {0} already exists, please pick another name
-
-
- The provided service name {0} already exists, please pick another name
-
Please provide name for the hosted service
@@ -1193,12 +1094,6 @@ Please follow these steps in the portal:
The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-
- The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-
-
- service settings
-
The {0} slot for cloud service {1} doesn't exist.
@@ -1233,15 +1128,9 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
deploymentSettings.json
-
- deploymentSettings.json
-
Confirm
-
- Confirm
-
Shutdown
WAPackIaaS
@@ -1308,12 +1197,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
The subscription data file {0} does not exist.
-
- The subscription id {0} doesn't exist.
-
-
- The subscription name {0} doesn't exist.
-
Subscription must not be null
WAPackIaaS
@@ -1334,9 +1217,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
Make sure you have Python 2.7 installed along with Django installed to site-packages.
-
- Unable to update mismatching Json structured: {0} {1}.
-
The provider {0} is unknown.
@@ -1401,9 +1281,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
WorkerRole.xml
-
- (x86)
-
Yes
@@ -1438,9 +1315,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
<NONE>
-
-
-
"An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}."
{0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID.
@@ -1448,9 +1322,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.
{0} is the string that is not in a valid base 64 format.
-
- -Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account.
-
Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".
@@ -1460,18 +1331,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
Removing environment
-
- Removing public environment is not supported.
-
-
- Changing public environment is not supported.
-
-
- Credential type invalid, only handles '{0}'
-
-
- Illegal credential type
-
There is no subscription associated with account {0}.
@@ -1481,9 +1340,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
Environment name doesn't match one in subscription.
-
- Unable to retrieve service key for ServicePrincipal account {0}. Please run the Add-AzureAccount cmdlet to supply the credentials for this service principal.
-
Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?
@@ -1493,4 +1349,10 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf
The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.
+
+ Account needs to be specified
+
+
+ No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.
+
\ No newline at end of file
diff --git a/src/Common/Commands.Common/RecordingTracingInterceptor.cs b/src/Common/Commands.Common/RecordingTracingInterceptor.cs
index 6fed19616660..b0364c18a29b 100644
--- a/src/Common/Commands.Common/RecordingTracingInterceptor.cs
+++ b/src/Common/Commands.Common/RecordingTracingInterceptor.cs
@@ -20,7 +20,7 @@
using System.Collections.Generic;
using System.Net.Http;
-namespace Microsoft.Azure.Common.Extensions.Models
+namespace Microsoft.Azure.Common.Authentication.Models
{
public class RecordingTracingInterceptor : Hyak.Common.ICloudTracingInterceptor
{
diff --git a/src/Common/Commands.Common/SubscriptionCmdletBase.cs b/src/Common/Commands.Common/SubscriptionCmdletBase.cs
index 91031a45c851..53c8f04ca45b 100644
--- a/src/Common/Commands.Common/SubscriptionCmdletBase.cs
+++ b/src/Common/Commands.Common/SubscriptionCmdletBase.cs
@@ -12,10 +12,8 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.WindowsAzure.Commands.Common.Properties;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using System.Management.Automation;
namespace Microsoft.WindowsAzure.Commands.Utilities.Profile
{
@@ -26,39 +24,32 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Profile
///
public abstract class SubscriptionCmdletBase : AzurePSCmdlet
{
- [Parameter(Mandatory = false, HelpMessage = "[Deprecated]: File storing subscription data, if not set uses default.")]
- public string SubscriptionDataFile { get; set; }
-
private readonly bool _saveProfile;
- protected SubscriptionCmdletBase(bool saveProfile)
+ protected SubscriptionCmdletBase(bool saveProfile)
{
- this._saveProfile = saveProfile;
+ _saveProfile = saveProfile;
}
protected override void BeginProcessing()
{
- if (!string.IsNullOrEmpty(SubscriptionDataFile))
- {
- ProfileClient = new ProfileClient(SubscriptionDataFile);
- WriteWarning(Resources.SubscriptionDataFileDeprecated);
- }
- else
- {
- ProfileClient = new ProfileClient();
- }
+ base.BeginProcessing();
+
+ ProfileClient = new ProfileClient(Profile);
ProfileClient.WarningLog = WriteWarning;
ProfileClient.DebugLog = WriteDebug;
}
-
protected override void EndProcessing()
{
+
if (_saveProfile)
{
- ProfileClient.Profile.Save();
+ Profile.Save();
}
- }
+ base.EndProcessing();
+ }
public ProfileClient ProfileClient { get; set; }
+
}
}
\ No newline at end of file
diff --git a/src/Common/Commands.Common/packages.config b/src/Common/Commands.Common/packages.config
index 0b62e49baae0..250c461362d8 100644
--- a/src/Common/Commands.Common/packages.config
+++ b/src/Common/Commands.Common/packages.config
@@ -1,10 +1,10 @@
-
+
-
+
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/src/Common/Commands.Profile/Account/AddAzureAccount.cs b/src/Common/Commands.Profile/Account/AddAzureAccount.cs
index d6793e6522d9..d2efb315a0d1 100644
--- a/src/Common/Commands.Profile/Account/AddAzureAccount.cs
+++ b/src/Common/Commands.Profile/Account/AddAzureAccount.cs
@@ -15,9 +15,8 @@
using System.Management.Automation;
using System.Security;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
-using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
namespace Microsoft.WindowsAzure.Commands.Profile
diff --git a/src/Common/Commands.Profile/Account/GetAzureAccount.cs b/src/Common/Commands.Profile/Account/GetAzureAccount.cs
index ad63b8dc70ee..d088ebddc317 100644
--- a/src/Common/Commands.Profile/Account/GetAzureAccount.cs
+++ b/src/Common/Commands.Profile/Account/GetAzureAccount.cs
@@ -12,9 +12,10 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
+using System.Linq;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
using System.Collections.Generic;
@@ -37,7 +38,7 @@ public GetAzureAccount() : base(false)
public override void ExecuteCmdlet()
{
- IEnumerable accounts = DefaultProfileClient.ListAccounts(Name);
+ IEnumerable accounts = Profile.Accounts.Values.Where(a => Name == null || a.Id == Name);
List output = new List();
foreach (AzureAccount account in accounts) {
output.Add(account.ToPSAzureAccount());
diff --git a/src/Common/Commands.Profile/Account/RemoveAzureAccount.cs b/src/Common/Commands.Profile/Account/RemoveAzureAccount.cs
index 5e16e019cf35..7cf8484c336e 100644
--- a/src/Common/Commands.Profile/Account/RemoveAzureAccount.cs
+++ b/src/Common/Commands.Profile/Account/RemoveAzureAccount.cs
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------------
using System.Management.Automation;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
diff --git a/src/Common/Commands.Profile/Commands.Profile.csproj b/src/Common/Commands.Profile/Commands.Profile.csproj
index a24af090e1af..6e47c3b69b3e 100644
--- a/src/Common/Commands.Profile/Commands.Profile.csproj
+++ b/src/Common/Commands.Profile/Commands.Profile.csproj
@@ -48,30 +48,30 @@
- ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
@@ -129,7 +129,8 @@
-
+
+
diff --git a/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs b/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs
index 1af9a1b1ff14..0ae5955a60c4 100644
--- a/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs
+++ b/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs
@@ -14,7 +14,7 @@
using System.Management.Automation;
using System.Security.Permissions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
using System.Collections.Generic;
using System;
diff --git a/src/Common/Commands.Profile/Environment/GetAzureEnvironment.cs b/src/Common/Commands.Profile/Environment/GetAzureEnvironment.cs
index d57fb27a1379..8411f45464b6 100644
--- a/src/Common/Commands.Profile/Environment/GetAzureEnvironment.cs
+++ b/src/Common/Commands.Profile/Environment/GetAzureEnvironment.cs
@@ -15,7 +15,7 @@
using System.Collections.Generic;
using System.Management.Automation;
using System.Security.Permissions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
using System;
diff --git a/src/Common/Commands.Profile/Environment/RemoveAzureEnvironment.cs b/src/Common/Commands.Profile/Environment/RemoveAzureEnvironment.cs
index 941b0724c871..05d3c700c464 100644
--- a/src/Common/Commands.Profile/Environment/RemoveAzureEnvironment.cs
+++ b/src/Common/Commands.Profile/Environment/RemoveAzureEnvironment.cs
@@ -14,7 +14,7 @@
using System.Management.Automation;
using System.Security.Permissions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
diff --git a/src/Common/Commands.Profile/Environment/SetAzureEnvironment.cs b/src/Common/Commands.Profile/Environment/SetAzureEnvironment.cs
index f8f7743450fa..e43d3d7e3bba 100644
--- a/src/Common/Commands.Profile/Environment/SetAzureEnvironment.cs
+++ b/src/Common/Commands.Profile/Environment/SetAzureEnvironment.cs
@@ -14,7 +14,7 @@
using System.Management.Automation;
using System.Security.Permissions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
namespace Microsoft.WindowsAzure.Commands.Profile
diff --git a/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.format.ps1xml b/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.format.ps1xml
index 3e2281e8506c..b34dcf874e8b 100644
--- a/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.format.ps1xml
+++ b/src/Common/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.format.ps1xml
@@ -2,9 +2,9 @@
- Microsoft.Azure.Common.Extensions.Models.PSAzureAccount
+ Microsoft.Azure.Common.Authentication.Models.PSAzureAccount
- Microsoft.Azure.Common.Extensions.Models.PSAzureAccount
+ Microsoft.Azure.Common.Authentication.Models.PSAzureAccount
diff --git a/src/Common/Commands.Profile/Models/PsAzureSubscription.cs b/src/Common/Commands.Profile/Models/PsAzureSubscription.cs
index 9a549b133113..8e1e6846086e 100644
--- a/src/Common/Commands.Profile/Models/PsAzureSubscription.cs
+++ b/src/Common/Commands.Profile/Models/PsAzureSubscription.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
namespace Microsoft.WindowsAzure.Commands.Profile.Models
{
diff --git a/src/Common/Commands.Profile/Models/PsAzureSubscriptionExtended.cs b/src/Common/Commands.Profile/Models/PsAzureSubscriptionExtended.cs
index c4894d9e73b9..763647ff2b26 100644
--- a/src/Common/Commands.Profile/Models/PsAzureSubscriptionExtended.cs
+++ b/src/Common/Commands.Profile/Models/PsAzureSubscriptionExtended.cs
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------------
using System.Security.Cryptography.X509Certificates;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
namespace Microsoft.WindowsAzure.Commands.Profile.Models
{
diff --git a/src/Common/Commands.Profile/ProfileDoctor/ClearAzureProfile.cs b/src/Common/Commands.Profile/Profile/ClearAzureProfile.cs
similarity index 97%
rename from src/Common/Commands.Profile/ProfileDoctor/ClearAzureProfile.cs
rename to src/Common/Commands.Profile/Profile/ClearAzureProfile.cs
index a60306b008f7..076f3cf2799a 100644
--- a/src/Common/Commands.Profile/ProfileDoctor/ClearAzureProfile.cs
+++ b/src/Common/Commands.Profile/Profile/ClearAzureProfile.cs
@@ -14,7 +14,7 @@
using System.Management.Automation;
using System.Security.Permissions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
diff --git a/src/Common/Commands.Profile/Profile/NewAzureProfile.cs b/src/Common/Commands.Profile/Profile/NewAzureProfile.cs
new file mode 100644
index 000000000000..158c5aafb757
--- /dev/null
+++ b/src/Common/Commands.Profile/Profile/NewAzureProfile.cs
@@ -0,0 +1,121 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+using System;
+using System.Security.Cryptography.X509Certificates;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
+using Microsoft.WindowsAzure.Commands.Utilities.Common;
+using System.Management.Automation;
+using System.Security.Permissions;
+
+namespace Microsoft.WindowsAzure.Commands.Profile
+{
+ ///
+ /// Creates new Microsoft Azure profile.
+ ///
+ [Cmdlet(VerbsCommon.New, "AzureProfile"), OutputType(typeof(AzureProfile))]
+ public class NewAzureProfileCommand : AzurePSCmdlet
+ {
+ private const string CertificateParameterSet = "Certificate";
+ private const string CredentialsParameterSet = "Credentials";
+ private const string ServicePrincipalParameterSet = "ServicePrincipal";
+ private const string AccessTokenParameterSet = "Token";
+ private const string FileParameterSet = "File";
+
+ [Parameter(Mandatory = false, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)]
+ [Parameter(Mandatory = false, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = ServicePrincipalParameterSet)]
+ [Parameter(Mandatory = false, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = AccessTokenParameterSet)]
+ [Parameter(Mandatory = false, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = CredentialsParameterSet)]
+ public AzureEnvironment Environment { get; set; }
+
+ [Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)]
+ [Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = ServicePrincipalParameterSet)]
+ [Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = AccessTokenParameterSet)]
+ [Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true, ParameterSetName = CredentialsParameterSet)]
+ public string SubscriptionId { get; set; }
+
+ [Parameter(Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)]
+ [Parameter(Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = ServicePrincipalParameterSet)]
+ [Parameter(Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = AccessTokenParameterSet)]
+ [Parameter(Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = CredentialsParameterSet)]
+ public string StorageAccount { get; set; }
+
+ [Parameter(Mandatory = true, Position = 3, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)]
+ public X509Certificate2 Certificate { get; set; }
+
+ [Parameter(Mandatory = true, Position = 3, ValueFromPipelineByPropertyName = true, ParameterSetName = CredentialsParameterSet)]
+ [Parameter(Mandatory = true, Position = 3, ValueFromPipelineByPropertyName = true, ParameterSetName = ServicePrincipalParameterSet)]
+ public PSCredential Credential { get; set; }
+
+ [Parameter(Mandatory = true, Position = 4, ValueFromPipelineByPropertyName = true, ParameterSetName = CredentialsParameterSet)]
+ [Parameter(Mandatory = true, Position = 4, ValueFromPipelineByPropertyName = true, ParameterSetName = ServicePrincipalParameterSet)]
+ public string Tenant { get; set; }
+
+ [Parameter(Mandatory = true, Position = 5, ValueFromPipelineByPropertyName = true, ParameterSetName = ServicePrincipalParameterSet)]
+ public SwitchParameter ServicePrincipal { get; set; }
+
+ [Parameter(Mandatory = true, Position = 3, ValueFromPipelineByPropertyName = true, ParameterSetName = AccessTokenParameterSet)]
+ public string AccessToken { get; set; }
+
+ [Parameter(Mandatory = true, Position = 4, ValueFromPipelineByPropertyName = true, ParameterSetName = AccessTokenParameterSet)]
+ public string AccountId { get; set; }
+
+ [Parameter(Mandatory = true, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = FileParameterSet)]
+ public string Path { get; set; }
+
+ [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
+ public override void ExecuteCmdlet()
+ {
+ AzureProfile azureProfile = new AzureProfile();
+ ProfileClient profileClient = new ProfileClient(azureProfile);
+ if (Environment == null)
+ {
+ Environment = AzureEnvironment.PublicEnvironments["AzureCloud"];
+ }
+
+ switch (ParameterSetName)
+ {
+ case CertificateParameterSet:
+ profileClient.InitializeProfile(Environment, new Guid(SubscriptionId), Certificate,
+ StorageAccount);
+ break;
+ case CredentialsParameterSet:
+ AzureAccount userAccount = new AzureAccount
+ {
+ Id = Credential.UserName,
+ Type = AzureAccount.AccountType.User
+ };
+ profileClient.InitializeProfile(Environment, new Guid(SubscriptionId), userAccount,
+ Credential.Password, StorageAccount);
+ break;
+ case AccessTokenParameterSet:
+ profileClient.InitializeProfile(Environment, new Guid(SubscriptionId), AccessToken,
+ AccountId, StorageAccount);
+ break;
+ case ServicePrincipalParameterSet:
+ AzureAccount servicePrincipalAccount = new AzureAccount
+ {
+ Id = Credential.UserName,
+ Type = AzureAccount.AccountType.ServicePrincipal
+ };
+ profileClient.InitializeProfile(Environment, new Guid(SubscriptionId), servicePrincipalAccount,
+ Credential.Password, StorageAccount);
+ break;
+ }
+
+ WriteObject(azureProfile);
+ }
+ }
+}
diff --git a/src/Common/Commands.Profile/Subscription/GetAzurePublishSettingsFile.cs b/src/Common/Commands.Profile/Subscription/GetAzurePublishSettingsFile.cs
index 4cea0c630855..3cb69cddae84 100644
--- a/src/Common/Commands.Profile/Subscription/GetAzurePublishSettingsFile.cs
+++ b/src/Common/Commands.Profile/Subscription/GetAzurePublishSettingsFile.cs
@@ -14,7 +14,7 @@
using System.Management.Automation;
using System.Security.Permissions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
diff --git a/src/Common/Commands.Profile/Subscription/GetAzureSubscription.cs b/src/Common/Commands.Profile/Subscription/GetAzureSubscription.cs
index 39670163cf34..f5824b361792 100644
--- a/src/Common/Commands.Profile/Subscription/GetAzureSubscription.cs
+++ b/src/Common/Commands.Profile/Subscription/GetAzureSubscription.cs
@@ -17,13 +17,13 @@
using System.Linq;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Profile.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
using Microsoft.WindowsAzure.Management;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Profile
{
@@ -64,7 +64,7 @@ public override void ExecuteCmdlet()
switch (ParameterSetName)
{
case "ByName":
- WriteSubscriptions(ProfileClient.RefreshSubscriptions(AzureSession.CurrentContext.Environment)
+ WriteSubscriptions(ProfileClient.RefreshSubscriptions(Profile.Context.Environment)
.Where(s => SubscriptionName == null || s.Name.Equals(SubscriptionName, StringComparison.InvariantCultureIgnoreCase)));
break;
case "ById":
@@ -103,7 +103,7 @@ public void GetCurrent()
// since current is strictly in-memory and we want the real
// current subscription.
//
- if (AzureSession.CurrentContext.Subscription == null)
+ if (Profile.Context.Subscription == null)
{
WriteError(new ErrorRecord(
new InvalidOperationException(Resources.InvalidSelectedSubscription),
@@ -112,7 +112,7 @@ public void GetCurrent()
}
else
{
- WriteSubscriptions(AzureSession.CurrentContext.Subscription);
+ WriteSubscriptions(Profile.Context.Subscription);
}
}
@@ -148,7 +148,7 @@ private PSAzureSubscription ConstructPsAzureSubscription(AzureSubscription subsc
psObject.DefaultAccount = subscription.Account;
psObject.Accounts = ProfileClient.Profile.Accounts.Values.Where(a => a.HasSubscription(subscription.Id)).ToArray();
psObject.IsDefault = subscription.IsPropertySet(AzureSubscription.Property.Default);
- psObject.IsCurrent = AzureSession.CurrentContext.Subscription != null && AzureSession.CurrentContext.Subscription.Id == subscription.Id;
+ psObject.IsCurrent = Profile.Context.Subscription != null && Profile.Context.Subscription.Id == subscription.Id;
psObject.CurrentStorageAccountName = subscription.GetProperty(AzureSubscription.Property.StorageAccount);
psObject.TenantId = subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants).FirstOrDefault();
return psObject;
@@ -156,11 +156,11 @@ private PSAzureSubscription ConstructPsAzureSubscription(AzureSubscription subsc
private PSAzureSubscriptionExtended ConstructPsAzureSubscriptionExtended(AzureSubscription subscription, IClientFactory clientFactory)
{
- using (var client = clientFactory.CreateClient(subscription, AzureEnvironment.Endpoint.ServiceManagement))
+ using (var client = clientFactory.CreateClient(Profile, subscription, AzureEnvironment.Endpoint.ServiceManagement))
{
var response = client.Subscriptions.Get();
var environment = ProfileClient.GetEnvironmentOrDefault(subscription.Environment);
- var account = DefaultProfileClient.Profile.Accounts[subscription.Account];
+ var account = ProfileClient.Profile.Accounts[subscription.Account];
bool isCert = account.Type == AzureAccount.AccountType.Certificate;
PSAzureSubscriptionExtended result = new PSAzureSubscriptionExtended(ConstructPsAzureSubscription(subscription))
@@ -186,7 +186,7 @@ private PSAzureSubscriptionExtended ConstructPsAzureSubscriptionExtended(AzureSu
ResourceManagerEndpoint = environment.GetEndpoint(AzureEnvironment.Endpoint.ResourceManager),
IsDefault = subscription.GetProperty(AzureSubscription.Property.Default) != null,
Account = account,
- Certificate = isCert ? ProfileClient.DataStore.GetCertificate(subscription.Account) : null,
+ Certificate = isCert ? AzureSession.DataStore.GetCertificate(subscription.Account) : null,
CurrentStorageAccountName = subscription.GetProperty(AzureSubscription.Property.StorageAccount)
};
diff --git a/src/Common/Commands.Profile/Subscription/ImportAzurePublishSettings.cs b/src/Common/Commands.Profile/Subscription/ImportAzurePublishSettings.cs
index 1e0c6ca498b4..8b47e0c1832b 100644
--- a/src/Common/Commands.Profile/Subscription/ImportAzurePublishSettings.cs
+++ b/src/Common/Commands.Profile/Subscription/ImportAzurePublishSettings.cs
@@ -17,13 +17,13 @@
using System.Linq;
using System.Management.Automation;
using System.Security.Permissions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
using Microsoft.WindowsAzure.Commands.Common;
using System.Diagnostics;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Profile
{
@@ -54,14 +54,7 @@ public override void ExecuteCmdlet()
}
AzureSubscription defaultSubscription = ProfileClient.Profile.DefaultSubscription;
- Debug.Assert(AzureSession.CurrentContext != null);
- if (defaultSubscription != null && AzureSession.CurrentContext.Subscription == null)
- {
- AzureSession.SetCurrentContext(
- defaultSubscription,
- ProfileClient.Profile.Environments[defaultSubscription.Environment],
- ProfileClient.Profile.Accounts[defaultSubscription.Account]);
- }
+ Debug.Assert(Profile.Context != null);
}
private bool IsDirectory()
diff --git a/src/Common/Commands.Profile/Subscription/RemoveAzureSubscription.cs b/src/Common/Commands.Profile/Subscription/RemoveAzureSubscription.cs
index e12a652d4ca1..fb4b83cd8729 100644
--- a/src/Common/Commands.Profile/Subscription/RemoveAzureSubscription.cs
+++ b/src/Common/Commands.Profile/Subscription/RemoveAzureSubscription.cs
@@ -14,7 +14,7 @@
using System;
using System.Management.Automation;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
diff --git a/src/Common/Commands.Profile/Subscription/SelectAzureSubscription.cs b/src/Common/Commands.Profile/Subscription/SelectAzureSubscription.cs
index 51b5adf693b8..36305d783b2d 100644
--- a/src/Common/Commands.Profile/Subscription/SelectAzureSubscription.cs
+++ b/src/Common/Commands.Profile/Subscription/SelectAzureSubscription.cs
@@ -15,10 +15,10 @@
using System;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Profile
{
@@ -94,23 +94,25 @@ public override void ExecuteCmdlet()
switch (ParameterSetName)
{
case SelectSubscriptionByNameParameterSet:
- azureSubscription = ProfileClient.SetSubscriptionAsCurrent(SubscriptionName, Account);
+ azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionName, Account);
break;
case SelectSubscriptionByIdParameterSet:
- azureSubscription = ProfileClient.SetSubscriptionAsCurrent(SubscriptionIdAsGuid(), Account);
+ azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionIdAsGuid(), Account);
break;
case SelectDefaultSubscriptionByNameParameterSet:
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionName, Account);
+ WriteWarning("Current and Default parameters have been deprecated. Select-AzureSubscription will always update the Default Subscription.");
break;
case SelectDefaultSubscriptionByIdParameterSet:
azureSubscription = ProfileClient.SetSubscriptionAsDefault(SubscriptionIdAsGuid(), Account);
+ WriteWarning("Current and Default parameters have been deprecated. Select-AzureSubscription will always update the Default Subscription.");
break;
case NoCurrentSubscriptionParameterSet:
- AzureSession.SetCurrentContext(null, null, null);
+ WriteWarning("Current parameter set has been deprecated. Use Select-AzureSubscription -NoDefault instead.");
break;
case NoDefaultSubscriptionParameterSet:
diff --git a/src/Common/Commands.Profile/Subscription/SetAzureSubscription.cs b/src/Common/Commands.Profile/Subscription/SetAzureSubscription.cs
index 52a97162a980..52545c5afa31 100644
--- a/src/Common/Commands.Profile/Subscription/SetAzureSubscription.cs
+++ b/src/Common/Commands.Profile/Subscription/SetAzureSubscription.cs
@@ -16,7 +16,8 @@
using System.Linq;
using System.Management.Automation;
using System.Security.Cryptography.X509Certificates;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Profile;
@@ -106,7 +107,8 @@ public override void ExecuteCmdlet()
AzureEnvironment environment = ProfileClient.GetEnvironment(Environment, ServiceEndpoint, ResourceManagerEndpoint);
if (environment == null)
{
- environment = DefaultProfileClient.GetEnvironment(Environment, ServiceEndpoint, ResourceManagerEndpoint);
+ var profileClient = new ProfileClient(Profile);
+ environment = profileClient.GetEnvironment(Environment, ServiceEndpoint, ResourceManagerEndpoint);
}
if (environment == null)
diff --git a/src/Common/Commands.Profile/SwitchAzureMode.cs b/src/Common/Commands.Profile/SwitchAzureMode.cs
index 7d9ad67780f8..10e8392fb452 100644
--- a/src/Common/Commands.Profile/SwitchAzureMode.cs
+++ b/src/Common/Commands.Profile/SwitchAzureMode.cs
@@ -15,7 +15,7 @@
using System;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.Profile
{
diff --git a/src/Common/Commands.Profile/packages.config b/src/Common/Commands.Profile/packages.config
index 0f2b1ec77c46..64ab34241859 100644
--- a/src/Common/Commands.Profile/packages.config
+++ b/src/Common/Commands.Profile/packages.config
@@ -1,14 +1,14 @@
-
-
+
+
-
+
-
+
diff --git a/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs b/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs
index 12f15d9dd2c2..53491d71cb96 100644
--- a/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs
+++ b/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs
@@ -19,7 +19,7 @@
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Test;
using Xunit;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest
{
diff --git a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj
index 7580a909c892..980bcb3b17c7 100644
--- a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj
+++ b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj
@@ -39,26 +39,26 @@
- ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
- ..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
- ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll
@@ -69,13 +69,13 @@
..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/Common/Commands.ScenarioTest/Common/PowerShellTest.cs b/src/Common/Commands.ScenarioTest/Common/PowerShellTest.cs
index 27dc682af445..d6be6a7f8e02 100644
--- a/src/Common/Commands.ScenarioTest/Common/PowerShellTest.cs
+++ b/src/Common/Commands.ScenarioTest/Common/PowerShellTest.cs
@@ -20,7 +20,7 @@
using Microsoft.WindowsAzure.Commands.Common.Test.Common;
using Microsoft.WindowsAzure.Commands.ScenarioTest.Resources;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common
{
diff --git a/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs b/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs
index 6b9faa273a0e..914cefc0ccb6 100644
--- a/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs
+++ b/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs
@@ -21,8 +21,8 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.XmlSchema;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.XmlSchema;
using Hyak.Common;
using Microsoft.Azure;
diff --git a/src/Common/Commands.ScenarioTest/Common/WindowsAzurePowerShellCertificateTest.cs b/src/Common/Commands.ScenarioTest/Common/WindowsAzurePowerShellCertificateTest.cs
index a8786a3ad86c..476681ca1132 100644
--- a/src/Common/Commands.ScenarioTest/Common/WindowsAzurePowerShellCertificateTest.cs
+++ b/src/Common/Commands.ScenarioTest/Common/WindowsAzurePowerShellCertificateTest.cs
@@ -22,8 +22,8 @@
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Test;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common
{
@@ -55,7 +55,7 @@ public AzurePowerShellCertificateTest(params string[] modules)
string dummyCredentialFile = Path.Combine(Environment.CurrentDirectory, TestCredentialHelper.DefaultCredentialFile);
if (!File.Exists(dummyCredentialFile))
{
- ProfileClient.DataStore.WriteFile(dummyCredentialFile, Properties.Resources.RdfeTestDummy);
+ AzureSession.DataStore.WriteFile(dummyCredentialFile, Properties.Resources.RdfeTestDummy);
}
this.credentialFile = dummyCredentialFile;
}
@@ -65,7 +65,7 @@ public AzurePowerShellCertificateTest(params string[] modules)
this.credentialFile = TestCredentialHelper.DefaultCredentialFile;
this.profileFile = TestCredentialHelper.WindowsAzureProfileFile;
}
- ProfileClient.DataStore = new MockDataStore();
+ AzureSession.DataStore = new MockDataStore();
if (Environment.GetEnvironmentVariable(outputDirKey) != null)
{
diff --git a/src/Common/Commands.ScenarioTest/CredentialTests/AddAccountForArmTests.cs b/src/Common/Commands.ScenarioTest/CredentialTests/AddAccountForArmTests.cs
index c29a3c4f28ad..4bbe3c544681 100644
--- a/src/Common/Commands.ScenarioTest/CredentialTests/AddAccountForArmTests.cs
+++ b/src/Common/Commands.ScenarioTest/CredentialTests/AddAccountForArmTests.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Xunit;
using Xunit.Extensions;
diff --git a/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestBase.cs b/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestBase.cs
index 5a6c8dd425c0..d731e743012f 100644
--- a/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestBase.cs
+++ b/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestBase.cs
@@ -16,7 +16,7 @@
using System.Linq;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.CredentialTests
{
diff --git a/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestHelper.cs b/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestHelper.cs
index a764f52988d6..7b103d5bf913 100644
--- a/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestHelper.cs
+++ b/src/Common/Commands.ScenarioTest/CredentialTests/CredentialTestHelper.cs
@@ -19,7 +19,7 @@
using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.CredentialTests
{
@@ -29,7 +29,7 @@ internal class CredentialTestHelper
public CredentialTestHelper()
{
- ProfileClient.DataStore = new MockDataStore();
+ AzureSession.DataStore = new MockDataStore();
// Ignore SSL errors
System.Net.ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => true;
}
diff --git a/src/Common/Commands.ScenarioTest/Scheduler/SchedulerTests.cs b/src/Common/Commands.ScenarioTest/Scheduler/SchedulerTests.cs
index c60721acf51f..16308717cf74 100644
--- a/src/Common/Commands.ScenarioTest/Scheduler/SchedulerTests.cs
+++ b/src/Common/Commands.ScenarioTest/Scheduler/SchedulerTests.cs
@@ -20,7 +20,7 @@
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Test;
using Xunit;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest
{
diff --git a/src/Common/Commands.ScenarioTest/TrafficManagerTests/TrafficManagerTests.cs b/src/Common/Commands.ScenarioTest/TrafficManagerTests/TrafficManagerTests.cs
index 5ffbb328c31a..6dc3045cebc5 100644
--- a/src/Common/Commands.ScenarioTest/TrafficManagerTests/TrafficManagerTests.cs
+++ b/src/Common/Commands.ScenarioTest/TrafficManagerTests/TrafficManagerTests.cs
@@ -20,7 +20,7 @@
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Test;
using Xunit;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest
{
diff --git a/src/Common/Commands.ScenarioTest/WebsitesTests/WebsitesTestsBase.cs b/src/Common/Commands.ScenarioTest/WebsitesTests/WebsitesTestsBase.cs
index 940ae28da5e3..0b4aa74d80f2 100644
--- a/src/Common/Commands.ScenarioTest/WebsitesTests/WebsitesTestsBase.cs
+++ b/src/Common/Commands.ScenarioTest/WebsitesTests/WebsitesTestsBase.cs
@@ -20,7 +20,7 @@
using Microsoft.WindowsAzure.Management.Storage;
using Microsoft.WindowsAzure.Management.WebSites;
using Microsoft.Azure.Test;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest.WebsitesTests
{
diff --git a/src/Common/Commands.ScenarioTest/packages.config b/src/Common/Commands.ScenarioTest/packages.config
index d301118ab974..d652b31ebcad 100644
--- a/src/Common/Commands.ScenarioTest/packages.config
+++ b/src/Common/Commands.ScenarioTest/packages.config
@@ -1,19 +1,19 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
index d29351a05942..490fdb401d50 100644
--- a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
+++ b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
@@ -38,34 +38,34 @@
- ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
- ..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
- ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
-
+
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs b/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs
index 00a1a65b9cf5..3999a573e91c 100644
--- a/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs
+++ b/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs
@@ -18,14 +18,15 @@
using System.Management.Automation;
using System.Security.Cryptography.X509Certificates;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Diagnostics;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure.Test;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Azure;
+using System.IO;
namespace Microsoft.WindowsAzure.Commands.ScenarioTest
{
@@ -40,8 +41,8 @@ public class EnvironmentSetupHelper
public EnvironmentSetupHelper()
{
- ProfileClient.DataStore = new MockDataStore();
- client = new ProfileClient();
+ AzureSession.DataStore = new MockDataStore();
+ client = new ProfileClient(new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)));
// Ignore SSL errors
System.Net.ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => true;
@@ -141,7 +142,7 @@ private void SetupAzureEnvironmentFromEnvironmentVariables(AzureModule mode)
client.Profile.Subscriptions[testSubscription.Id] = testSubscription;
client.Profile.Accounts[testAccount.Id] = testAccount;
- client.SetSubscriptionAsCurrent(testSubscription.Name, testSubscription.Account);
+ client.SetSubscriptionAsDefault(testSubscription.Name, testSubscription.Account);
}
}
diff --git a/src/Common/Commands.ScenarioTests.Common/packages.config b/src/Common/Commands.ScenarioTests.Common/packages.config
index d848dcfb4bb9..49cc8a86b4e7 100644
--- a/src/Common/Commands.ScenarioTests.Common/packages.config
+++ b/src/Common/Commands.ScenarioTests.Common/packages.config
@@ -1,16 +1,16 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj
index 38901382309c..63ec4da6a237 100644
--- a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj
+++ b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj
@@ -39,17 +39,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll
@@ -64,21 +64,21 @@
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.13.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
False
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs
index fb3848dee18d..781dd59dbb30 100644
--- a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs
+++ b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure.Gallery;
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.Batch;
diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config
index 8b73ff7326f8..b9f801f1e166 100644
--- a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config
+++ b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config
@@ -1,19 +1,19 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs b/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs
index 3173556916de..65deff43bce9 100644
--- a/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs
+++ b/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs
@@ -14,8 +14,8 @@
using Hyak.Common;
using Microsoft.Azure.Commands.Batch.Properties;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Management.Batch;
using Microsoft.Azure.Management.Batch.Models;
using Microsoft.Azure.Management.Resources;
diff --git a/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs b/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs
index 9b63bdca19a8..c90a5e47d34d 100644
--- a/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs
+++ b/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------------
using Hyak.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json.Linq;
@@ -31,7 +31,7 @@ public BatchClient BatchClient
{
if (batchClient == null)
{
- batchClient = new BatchClient(CurrentContext);
+ batchClient = new BatchClient(Profile.Context);
}
return batchClient;
}
diff --git a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj
index cd547b4773cf..3fddb33df228 100644
--- a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj
+++ b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj
@@ -42,17 +42,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -62,12 +62,12 @@
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/Batch/Commands.Batch/packages.config b/src/ResourceManager/Batch/Commands.Batch/packages.config
index c29bfcff95e0..338ca9a067b7 100644
--- a/src/ResourceManager/Batch/Commands.Batch/packages.config
+++ b/src/ResourceManager/Batch/Commands.Batch/packages.config
@@ -1,15 +1,15 @@
-
-
+
+
-
+
-
+
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj
index 4fe01c6605b8..1eb7b2fd2113 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj
@@ -42,17 +42,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
- True
+
+ False
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll
@@ -68,23 +68,23 @@
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.13.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
False
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
..\..\..\packages\Microsoft.DataFactories.Runtime.0.11.1-preview\lib\net45\Microsoft.DataFactories.Runtime.dll
-
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs
index 54c1a39cfbd8..91b3ea576f94 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure.Gallery;
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.DataFactories;
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config
index cecd99ae7535..7f9108e82509 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config
@@ -1,20 +1,20 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj b/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj
index 6d1f4c548ac3..5b8fc738c026 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj
@@ -49,17 +49,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -75,12 +75,12 @@
..\..\..\packages\Microsoft.DataTransfer.Gateway.Encryption.1.2.1-preview\lib\net45\Microsoft.DataTransfer.Gateway.Encryption.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs
index 4877fdf76c36..cdb52cfc0ebd 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs
@@ -40,7 +40,7 @@ internal DataFactoryClient DataFactoryClient
{
if (this.dataFactoryClient == null)
{
- this.dataFactoryClient = new DataFactoryClient(CurrentContext);
+ this.dataFactoryClient = new DataFactoryClient(Profile.Context);
}
return this.dataFactoryClient;
}
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryCommonUtilities.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryCommonUtilities.cs
index d3916e93c8d1..a85b0fb1ab02 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryCommonUtilities.cs
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryCommonUtilities.cs
@@ -21,7 +21,7 @@
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.DataFactories
{
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.cs
index 9de6c60116c6..3b81cd161286 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.cs
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.cs
@@ -15,13 +15,13 @@
using System.IO;
using Microsoft.Azure.Management.DataFactories;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Commands.DataFactories.Properties;
using System;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage;
using System.Net;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.DataFactories
{
diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config b/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config
index 0e0d3318842b..1d479d5bf47b 100644
--- a/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config
+++ b/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config
@@ -1,9 +1,9 @@
-
-
+
+
-
+
@@ -11,7 +11,7 @@
-
+
diff --git a/src/ResourceManager/Insights/Commands.Insights.Test/Commands.Insights.Test.csproj b/src/ResourceManager/Insights/Commands.Insights.Test/Commands.Insights.Test.csproj
index 06b31f034efe..3b2da743b7da 100644
--- a/src/ResourceManager/Insights/Commands.Insights.Test/Commands.Insights.Test.csproj
+++ b/src/ResourceManager/Insights/Commands.Insights.Test/Commands.Insights.Test.csproj
@@ -45,37 +45,36 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Insights.0.7.0-preview\lib\net45\Microsoft.Azure.Insights.dll
-
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
-
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+
+ False
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
-
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+
+ False
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
@@ -89,10 +88,6 @@
False
..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll
-
- False
- ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll
-
..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll
diff --git a/src/ResourceManager/Insights/Commands.Insights.Test/packages.config b/src/ResourceManager/Insights/Commands.Insights.Test/packages.config
index 6559e76ba32e..87256352e4f3 100644
--- a/src/ResourceManager/Insights/Commands.Insights.Test/packages.config
+++ b/src/ResourceManager/Insights/Commands.Insights.Test/packages.config
@@ -1,27 +1,25 @@
-
-
+
+
+
-
-
-
-
+
+
-
+
-
+
-
\ No newline at end of file
diff --git a/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj b/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj
index 6b85adf524b3..844934c759ac 100644
--- a/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj
+++ b/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj
@@ -44,33 +44,29 @@
False
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
False
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Insights.0.7.0-preview\lib\net45\Microsoft.Azure.Insights.dll
-
- ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
-
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
-
-
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+
+ False
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
-
- ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll
+
+ False
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
..\..\..\packages\WindowsAzure.Storage.4.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll
diff --git a/src/ResourceManager/Insights/Commands.Insights/InsightsCmdletBase.cs b/src/ResourceManager/Insights/Commands.Insights/InsightsCmdletBase.cs
index 86db7690ec29..69d3c30254e6 100644
--- a/src/ResourceManager/Insights/Commands.Insights/InsightsCmdletBase.cs
+++ b/src/ResourceManager/Insights/Commands.Insights/InsightsCmdletBase.cs
@@ -13,8 +13,8 @@
// ----------------------------------------------------------------------------------
using System;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Insights;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
@@ -39,7 +39,7 @@ public IInsightsClient InsightsClient
if (this.insightsClient == null)
{
// The premise is that a command to establish a context (like Add-AzureAccount) has been called before this command in order to have a correct CurrentContext
- this.insightsClient = AzureSession.ClientFactory.CreateClient(CurrentContext, AzureEnvironment.Endpoint.ResourceManager);
+ this.insightsClient = AzureSession.ClientFactory.CreateClient(Profile.Context, AzureEnvironment.Endpoint.ResourceManager);
}
return this.insightsClient;
diff --git a/src/ResourceManager/Insights/Commands.Insights/packages.config b/src/ResourceManager/Insights/Commands.Insights/packages.config
index d0ece5276843..4e2d94e68ad0 100644
--- a/src/ResourceManager/Insights/Commands.Insights/packages.config
+++ b/src/ResourceManager/Insights/Commands.Insights/packages.config
@@ -1,20 +1,18 @@
-
-
+
+
+
-
-
-
+
-
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj
index 1e046ea14c34..c51b868f3c40 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj
@@ -49,32 +49,32 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
False
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config
index 8809447d2bc4..a0b9d60af6c9 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config
@@ -1,16 +1,16 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj
index 69e3dde3333a..c85ddb7bc60f 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj
@@ -108,17 +108,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -133,12 +133,12 @@
..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/DataServiceCredential.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/DataServiceCredential.cs
index b7da41363c81..c22fd1ef9fcd 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/DataServiceCredential.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/DataServiceCredential.cs
@@ -13,9 +13,8 @@
// ----------------------------------------------------------------------------------
using Microsoft.Azure.Commands.KeyVault.Properties;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Authentication;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using System;
using System.Linq;
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultCmdletBase.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultCmdletBase.cs
index db5d4cc5b0cb..f819deabfdda 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultCmdletBase.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultCmdletBase.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.IO;
@@ -34,7 +34,7 @@ internal IKeyVaultDataServiceClient DataServiceClient
{
this.dataServiceClient = new KeyVaultDataServiceClient(
AzureSession.AuthenticationFactory,
- AzureSession.CurrentContext,
+ Profile.Context,
new HttpClient());
}
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs
index 1b77127cc288..779a08b88575 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs
@@ -15,8 +15,8 @@
using Hyak.Common;
using Microsoft.Azure.Commands.KeyVault.Properties;
using Microsoft.Azure.Commands.KeyVault.WebKey;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure;
using System;
using System.Collections.Generic;
diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config b/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config
index 0f2b1ec77c46..64ab34241859 100644
--- a/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config
+++ b/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config
@@ -1,14 +1,14 @@
-
-
+
+
-
+
-
+
diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj
index 28d1148eb761..8cc473641972 100644
--- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj
+++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj
@@ -42,17 +42,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Management.Redis.0.14.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll
@@ -60,21 +60,21 @@
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
False
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs
index 7925889e9557..26af932e0df4 100644
--- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs
+++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs
@@ -19,7 +19,7 @@ namespace Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Test;
using Microsoft.Azure.Management.Redis;
- using Microsoft.Azure.Common.Extensions;
+ using Microsoft.Azure.Common.Authentication;
public abstract class RedisCacheTestsBase : IDisposable
{
diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config
index c1656b65270d..8e8ccf64c8e1 100644
--- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config
+++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config
@@ -1,17 +1,17 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj
index 94a9159f6c79..a21b7a2ef7d0 100644
--- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj
+++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj
@@ -47,17 +47,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -67,13 +67,13 @@
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs
index fe0241307c05..9d53a8d832cd 100644
--- a/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs
+++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs
@@ -14,8 +14,8 @@
namespace Microsoft.Azure.Commands.RedisCache
{
- using Microsoft.Azure.Common.Extensions;
- using Microsoft.Azure.Common.Extensions.Models;
+ using Microsoft.Azure.Common.Authentication;
+ using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Management.Redis;
using Microsoft.Azure.Management.Redis.Models;
using Microsoft.WindowsAzure;
diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheCmdletBase.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheCmdletBase.cs
index 1b2dadb68f9f..d9d77b7c7ea5 100644
--- a/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheCmdletBase.cs
+++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheCmdletBase.cs
@@ -29,7 +29,7 @@ public RedisCacheClient CacheClient
{
if (cacheClient == null)
{
- cacheClient = new RedisCacheClient(CurrentContext);
+ cacheClient = new RedisCacheClient(Profile.Context);
}
return cacheClient;
}
diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config
index db728279d1a6..7b83a67a57eb 100644
--- a/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config
+++ b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config
@@ -1,15 +1,15 @@
-
-
+
+
-
+
-
+
diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj
index 0325d68d6f7a..6cf00749919a 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj
@@ -45,17 +45,16 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
- False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll
@@ -72,18 +71,18 @@
..\..\..\packages\Microsoft.Azure.Management.Resources.2.13.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/Models.ResourceGroups/ResourceClientTests.cs b/src/ResourceManager/Resources/Commands.Resources.Test/Models.ResourceGroups/ResourceClientTests.cs
index 03e0f5af5044..550ea4878bfd 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/Models.ResourceGroups/ResourceClientTests.cs
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/Models.ResourceGroups/ResourceClientTests.cs
@@ -37,7 +37,7 @@
using Xunit;
using Xunit.Extensions;
using System.Diagnostics;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Hyak.Common;
namespace Microsoft.Azure.Commands.Resources.Test.Models
diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs
index d1cb7415a4f6..14e9e4a37021 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure.Gallery;
using Microsoft.Azure.Graph.RBAC;
using Microsoft.Azure.Management.Authorization;
diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/packages.config b/src/ResourceManager/Resources/Commands.Resources.Test/packages.config
index a84ae4e10d7d..fe869d752628 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/packages.config
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/packages.config
@@ -1,19 +1,19 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
index 1866b0860e5f..650b4f15884a 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
+++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
@@ -49,17 +49,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -77,13 +77,13 @@
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.13.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryBaseCmdlet.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryBaseCmdlet.cs
index d181789e1e3e..3ce8593341ae 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryBaseCmdlet.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryBaseCmdlet.cs
@@ -27,7 +27,7 @@ public ActiveDirectoryClient ActiveDirectoryClient
{
if (activeDirectoryClient == null)
{
- activeDirectoryClient = new ActiveDirectoryClient(CurrentContext);
+ activeDirectoryClient = new ActiveDirectoryClient(Profile.Context);
}
return activeDirectoryClient;
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryClient.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryClient.cs
index 17730f3f695f..979c90f584c9 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryClient.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ActiveDirectory/ActiveDirectoryClient.cs
@@ -12,13 +12,10 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Graph.RBAC;
using Microsoft.Azure.Graph.RBAC.Models;
-using Microsoft.WindowsAzure;
-using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Authentication;
-using Microsoft.Azure.Common.Extensions.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClient.cs b/src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClient.cs
index abfa4fefdb75..52058b30af38 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClient.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClient.cs
@@ -16,13 +16,13 @@
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.Authorization.Models;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using ProjectResources = Microsoft.Azure.Commands.Resources.Properties.Resources;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.Resources.Models.Authorization
{
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/GalleryTemplatesClient.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/GalleryTemplatesClient.cs
index d1946901f9b6..81d0a72094c7 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/GalleryTemplatesClient.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/GalleryTemplatesClient.cs
@@ -26,11 +26,11 @@
using Microsoft.Azure.Gallery.Models;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
using ProjectResources = Microsoft.Azure.Commands.Resources.Properties.Resources;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Hyak.Common;
using Microsoft.Azure.Common.OData;
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs
index 68228bb5b593..37fa397cb582 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs
@@ -24,7 +24,7 @@
using Microsoft.Azure.Management.Resources.Models;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
using ProjectResources = Microsoft.Azure.Commands.Resources.Properties.Resources;
@@ -32,7 +32,7 @@
using Microsoft.Azure.Management.Authorization.Models;
using Microsoft.Azure.Commands.Resources.Models.Authorization;
using System.Diagnostics;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Hyak.Common;
namespace Microsoft.Azure.Commands.Resources.Models
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs
index bed68542d78a..07585cd05981 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs
@@ -22,7 +22,7 @@
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Commands.Resources.Models;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Hyak.Common;
namespace Microsoft.Azure.Commands.Resources
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs
index f290bc29771a..9e1f3721ecc8 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesBaseCmdlet.cs
@@ -13,7 +13,10 @@
// ----------------------------------------------------------------------------------
using Microsoft.Azure.Commands.Resources.Models.Authorization;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
+using System.IO;
namespace Microsoft.Azure.Commands.Resources.Models
{
@@ -31,7 +34,7 @@ public ResourcesClient ResourcesClient
{
if (resourcesClient == null)
{
- resourcesClient = new ResourcesClient(CurrentContext)
+ resourcesClient = new ResourcesClient(Profile.Context)
{
VerboseLogger = WriteVerboseWithTimestamp,
ErrorLogger = WriteErrorWithTimestamp,
@@ -50,7 +53,12 @@ public GalleryTemplatesClient GalleryTemplatesClient
{
if (galleryTemplatesClient == null)
{
- galleryTemplatesClient = new GalleryTemplatesClient(CurrentContext);
+ if(Profile == null)
+ {
+ Profile = new AzureProfile(Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile));
+ }
+
+ galleryTemplatesClient = new GalleryTemplatesClient(Profile.Context);
}
return galleryTemplatesClient;
}
@@ -64,7 +72,7 @@ public AuthorizationClient PoliciesClient
{
if (policiesClient == null)
{
- policiesClient = new AuthorizationClient(CurrentContext);
+ policiesClient = new AuthorizationClient(Profile.Context);
}
return policiesClient;
}
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs
index 1d8f98b411f2..f93ed1a12ae2 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs
@@ -25,7 +25,7 @@
using Newtonsoft.Json;
using Microsoft.Azure.Commands.Resources.Models.Authorization;
using Microsoft.Azure.Management.Authorization.Models;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.Resources.Models
{
diff --git a/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/GetAzureRoleAssignmentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/GetAzureRoleAssignmentCommand.cs
index 89285126a0f3..32b776dcc361 100644
--- a/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/GetAzureRoleAssignmentCommand.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/GetAzureRoleAssignmentCommand.cs
@@ -210,7 +210,7 @@ public override void ExecuteCmdlet()
ResourceGroupName = ResourceGroupName,
ResourceName = ResourceName,
ResourceType = ResourceType,
- Subscription = string.IsNullOrEmpty(ResourceGroupName) ? null : CurrentContext.Subscription.Id.ToString()
+ Subscription = string.IsNullOrEmpty(ResourceGroupName) ? null : Profile.Context.Subscription.Id.ToString()
}
};
diff --git a/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs
index ebceb5d7a2f0..6621b8aa3ca2 100644
--- a/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs
@@ -159,7 +159,7 @@ public override void ExecuteCmdlet()
ResourceGroupName = ResourceGroupName,
ResourceName = ResourceName,
ResourceType = ResourceType,
- Subscription = CurrentContext.Subscription.Id.ToString(),
+ Subscription = Profile.Context.Subscription.Id.ToString(),
}
};
diff --git a/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/RemoveAzureRoleAssignmentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/RemoveAzureRoleAssignmentCommand.cs
index 4bd28130aec6..4b74ca69472b 100644
--- a/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/RemoveAzureRoleAssignmentCommand.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/RoleAssignments/RemoveAzureRoleAssignmentCommand.cs
@@ -168,7 +168,7 @@ public override void ExecuteCmdlet()
ResourceGroupName = ResourceGroupName,
ResourceName = ResourceName,
ResourceType = ResourceType,
- Subscription = CurrentContext.Subscription.Id.ToString()
+ Subscription = Profile.Context.Subscription.Id.ToString()
}
};
diff --git a/src/ResourceManager/Resources/Commands.Resources/packages.config b/src/ResourceManager/Resources/Commands.Resources/packages.config
index ce2dd4e792fd..870aabcd7aa2 100644
--- a/src/ResourceManager/Resources/Commands.Resources/packages.config
+++ b/src/ResourceManager/Resources/Commands.Resources/packages.config
@@ -1,9 +1,9 @@
-
-
+
+
-
+
@@ -11,7 +11,7 @@
-
+
diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj b/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj
index 7df915826240..41bd49f76a47 100644
--- a/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj
+++ b/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj
@@ -43,17 +43,16 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
- True
+
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll
@@ -65,18 +64,18 @@
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SqlTestsBase.cs b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SqlTestsBase.cs
index f36e67e07d08..82e03b9b72cd 100644
--- a/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SqlTestsBase.cs
+++ b/src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SqlTestsBase.cs
@@ -18,7 +18,7 @@
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Management.Storage;
using Microsoft.Azure.Test;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.ScenarioTest.SqlTests
{
diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/packages.config b/src/ResourceManager/Sql/Commands.Sql.Test/packages.config
index 9b6a2f4216c5..09999bb53849 100644
--- a/src/ResourceManager/Sql/Commands.Sql.Test/packages.config
+++ b/src/ResourceManager/Sql/Commands.Sql.Test/packages.config
@@ -1,18 +1,18 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj
index 9d6cbc5a9735..1ee2c2fa5f66 100644
--- a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj
+++ b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj
@@ -89,19 +89,19 @@
False
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
False
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
False
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -120,12 +120,12 @@
..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/SqlDatabaseSecurityCmdletBase.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/SqlDatabaseSecurityCmdletBase.cs
index e4e0314b69c8..0a627ad138bc 100644
--- a/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/SqlDatabaseSecurityCmdletBase.cs
+++ b/src/ResourceManager/Sql/Commands.Sql/Security/Cmdlet/SqlDatabaseSecurityCmdletBase.cs
@@ -73,7 +73,7 @@ protected virtual void SendPolicy(AuditingPolicy policy) { }
///
public override void ExecuteCmdlet()
{
- PolicyHandler = new SqlClient(CurrentContext.Subscription);
+ PolicyHandler = new SqlClient(Profile, Profile.Context.Subscription);
AuditingPolicy policy = this.GetPolicy();
this.UpdatePolicy(policy);
this.SendPolicy(policy);
diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Services/EndpointsCommunicator.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Services/EndpointsCommunicator.cs
index cfd90d3c7c12..7dc75c742c2b 100644
--- a/src/ResourceManager/Sql/Commands.Sql/Security/Services/EndpointsCommunicator.cs
+++ b/src/ResourceManager/Sql/Commands.Sql/Security/Services/EndpointsCommunicator.cs
@@ -14,8 +14,8 @@
using Microsoft.Azure.Commands.Sql.Security.Model;
using Microsoft.Azure.Commands.Sql.Services;
-using Microsoft.Azure.Common.Extensions;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Management.Resources;
using Microsoft.Azure.Management.Resources.Models;
using Microsoft.Azure.Management.Sql;
@@ -45,9 +45,12 @@ public class EndpointsCommunicator
private static AzureSubscription Subscription {get ; set; }
private static ResourceManagementClient ResourcesClient { get; set; }
+
+ private AzureProfile Profile { get; set; }
- public EndpointsCommunicator(AzureSubscription subscription)
+ public EndpointsCommunicator(AzureProfile profile, AzureSubscription subscription)
{
+ Profile = profile;
if (subscription != Subscription)
{
Subscription = subscription;
@@ -149,7 +152,7 @@ public void SetServerSecurityPolicy(string resourceGroupName, string serverName,
public string GetStorageResourceGroup(string storageAccountName)
{
- ResourceManagementClient resourcesClient = GetCurrentResourcesClient();
+ ResourceManagementClient resourcesClient = GetCurrentResourcesClient(Profile);
ResourceListResult res = resourcesClient.Resources.List(new ResourceListParameters
{
@@ -181,11 +184,11 @@ public string GetStorageResourceGroup(string storageAccountName)
///
/// Gets the storage table endpoint the given storage account
///
- public string GetStorageTableEndpoint(string storageAccountName)
+ public string GetStorageTableEndpoint(AzureProfile profile, string storageAccountName)
{
try
{
- List endpoints = new List(GetCurrentStorageClient().StorageAccounts.Get(storageAccountName).StorageAccount.Properties.Endpoints);
+ List endpoints = new List(GetCurrentStorageClient(profile).StorageAccounts.Get(storageAccountName).StorageAccount.Properties.Endpoints);
return endpoints.Find(u => u.AbsoluteUri.Contains(".table.")).AbsoluteUri;
}
catch
@@ -194,17 +197,17 @@ public string GetStorageTableEndpoint(string storageAccountName)
}
}
- private StorageManagementClient GetCurrentStorageClient()
+ private StorageManagementClient GetCurrentStorageClient(AzureProfile profile)
{
if(StorageClient == null)
- StorageClient = AzureSession.ClientFactory.CreateClient(Subscription, AzureEnvironment.Endpoint.ServiceManagement);
+ StorageClient = AzureSession.ClientFactory.CreateClient(profile, Subscription, AzureEnvironment.Endpoint.ServiceManagement);
return StorageClient;
}
- private ResourceManagementClient GetCurrentResourcesClient()
+ private ResourceManagementClient GetCurrentResourcesClient(AzureProfile profile)
{
if (ResourcesClient == null)
- ResourcesClient = AzureSession.ClientFactory.CreateClient(Subscription, AzureEnvironment.Endpoint.ResourceManager);
+ ResourcesClient = AzureSession.ClientFactory.CreateClient(profile, Subscription, AzureEnvironment.Endpoint.ResourceManager);
return ResourcesClient;
}
@@ -218,7 +221,7 @@ private SqlManagementClient GetCurrentSqlClient(String clientRequestId)
// Get the SQL management client for the current subscription
if (SqlClient == null)
{
- SqlClient = AzureSession.ClientFactory.CreateClient(Subscription, AzureEnvironment.Endpoint.ResourceManager);
+ SqlClient = AzureSession.ClientFactory.CreateClient(Profile, Subscription, AzureEnvironment.Endpoint.ResourceManager);
SqlClient.HttpClient.DefaultRequestHeaders.Add(Constants.ClientSessionIdHeaderName, Util.GenerateTracingId());
}
SqlClient.HttpClient.DefaultRequestHeaders.Remove(Constants.ClientRequestIdHeaderName);
diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs
index 377978ed9ed3..65a4575a4e47 100644
--- a/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs
+++ b/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------------
using Microsoft.Azure.Commands.Sql.Security.Model;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Management.Sql.Models;
using System;
using System.Collections.Generic;
@@ -23,7 +23,7 @@
namespace Microsoft.Azure.Commands.Sql.Security.Services
{
///
- /// The SqlClient class is resposible for the mapping of data between two models:
+ /// The SqlClient class is responsible for the mapping of data between two models:
/// The communication model as defined by the endpoint APIs and the cmdlet model that is defined by the
/// AuditingPolicy class. This class knows how to wrap a policy in its communication model and return
/// a policy in its cmdlet model and vice versa (i.e., unwrapping).
@@ -32,28 +32,31 @@ public class SqlClient
{
private AzureSubscription Subscription { get; set; }
+ private AzureProfile Profile { get; set; }
+
private EndpointsCommunicator Communicator { get; set; }
- // cacheing the fetched properties to prevent constly network interaction in cases it is not needed
+ // Caching the fetched properties to prevent costly network interaction in cases it is not needed
private DatabaseSecurityPolicyProperties FetchedProperties;
// In cases when storage is not needed and not provided, theres's no need to perform storage related network interaction that may fail
public bool IgnoreStorage { get; set; }
- public SqlClient(AzureSubscription subscription)
+ public SqlClient(AzureProfile profile, AzureSubscription subscription)
{
+ Profile = profile;
Subscription = subscription;
- Communicator = new EndpointsCommunicator(subscription);
+ Communicator = new EndpointsCommunicator(profile, subscription);
IgnoreStorage = false;
}
///
/// Returns the storage account name of the given database server
///
- /// The name of the resouce group to which the server belongs
+ /// The name of the resource group to which the server belongs
/// The server's name
/// The Id to use in the request
- /// The name of the storage accunt, null if it doesn't exist
+ /// The name of the storage account, null if it doesn't exist
public string GetServerStorageAccount(string resourceGroupName, string serverName, string requestId)
{
return Communicator.GetServerSecurityPolicy(resourceGroupName, serverName, requestId).Properties.StorageAccountName;
@@ -258,7 +261,7 @@ private void UpdateStorage(AuditingPolicy policy, DatabaseSecurityPolicyProperti
throw new Exception(string.Format(Microsoft.Azure.Commands.Sql.Properties.Resources.NoStorageAccountWhenConfiguringAuditingPolicy));
}
- // no need to do time consuming http inteaction to fetch these properties if the storage account was not changed
+ // no need to do time consuming http interaction to fetch these properties if the storage account was not changed
if (properties.StorageAccountName == this.FetchedProperties.StorageAccountName)
{
properties.StorageAccountResourceGroupName = this.FetchedProperties.StorageAccountResourceGroupName;
@@ -269,7 +272,7 @@ private void UpdateStorage(AuditingPolicy policy, DatabaseSecurityPolicyProperti
{
properties.StorageAccountSubscriptionId = Subscription.Id.ToString();
properties.StorageAccountResourceGroupName = Communicator.GetStorageResourceGroup(properties.StorageAccountName);
- properties.StorageTableEndpoint = Communicator.GetStorageTableEndpoint(properties.StorageAccountName);
+ properties.StorageTableEndpoint = Communicator.GetStorageTableEndpoint(Profile, properties.StorageAccountName);
}
if (!IgnoreStorage)
diff --git a/src/ResourceManager/Sql/Commands.Sql/packages.config b/src/ResourceManager/Sql/Commands.Sql/packages.config
index 09e3bde991b1..2ac915e7ced2 100644
--- a/src/ResourceManager/Sql/Commands.Sql/packages.config
+++ b/src/ResourceManager/Sql/Commands.Sql/packages.config
@@ -1,9 +1,9 @@
-
-
+
+
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Commands.StreamAnalytics.Test.csproj b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Commands.StreamAnalytics.Test.csproj
index 0c2cde5eb67f..6c1ebb26c3b4 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Commands.StreamAnalytics.Test.csproj
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Commands.StreamAnalytics.Test.csproj
@@ -40,17 +40,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll
@@ -66,20 +66,20 @@
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.13.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
+ ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll
False
- ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
+ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5513.27084-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll
-
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/ScenarioTests/StreamAnalyticsScenarioTestsBase.cs b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/ScenarioTests/StreamAnalyticsScenarioTestsBase.cs
index e2f357412b54..4ec03b1c5c87 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/ScenarioTests/StreamAnalyticsScenarioTestsBase.cs
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/ScenarioTests/StreamAnalyticsScenarioTestsBase.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure.Gallery;
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.Resources;
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/packages.config b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/packages.config
index 2f6bd6e78138..1f9142b689ef 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/packages.config
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/packages.config
@@ -1,19 +1,19 @@
-
-
+
+
-
+
-
-
+
+
-
+
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj
index 09e55466fb89..ecaa12c30168 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj
@@ -49,17 +49,17 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -69,12 +69,12 @@
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Models/StreamAnalyticsClient.cs b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Models/StreamAnalyticsClient.cs
index 8861ac9e5909..045121b801f7 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Models/StreamAnalyticsClient.cs
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Models/StreamAnalyticsClient.cs
@@ -15,8 +15,8 @@
using System.IO;
using Microsoft.Azure.Management.StreamAnalytics;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication.Models;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.StreamAnalytics.Models
{
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsBaseCmdlet.cs b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsBaseCmdlet.cs
index d120a9543c23..0fd25ac2e2ca 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsBaseCmdlet.cs
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsBaseCmdlet.cs
@@ -35,7 +35,7 @@ internal StreamAnalyticsClient StreamAnalyticsClient
{
if (this.streamAnalyticsClient == null)
{
- this.streamAnalyticsClient = new StreamAnalyticsClient(CurrentContext);
+ this.streamAnalyticsClient = new StreamAnalyticsClient(Profile.Context);
}
return this.streamAnalyticsClient;
}
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsCommonUtilities.cs b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsCommonUtilities.cs
index c95d5349aaa7..df745c2a5e7d 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsCommonUtilities.cs
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/StreamAnalyticsCommonUtilities.cs
@@ -20,7 +20,7 @@
using Microsoft.Azure.Commands.StreamAnalytics.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.StreamAnalytics
{
diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/packages.config b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/packages.config
index fc1aec7e7eec..489c8750fc44 100644
--- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/packages.config
+++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/packages.config
@@ -1,15 +1,15 @@
-
-
+
+
-
+
-
+
diff --git a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj
index 61c82ffd2c07..6b83a0361b05 100644
--- a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj
+++ b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj
@@ -49,29 +49,29 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ResourceManager/Tags/Commands.Tags/Model/TagBaseCmdlet.cs b/src/ResourceManager/Tags/Commands.Tags/Model/TagBaseCmdlet.cs
index 87adae564266..c5311c1b5b17 100644
--- a/src/ResourceManager/Tags/Commands.Tags/Model/TagBaseCmdlet.cs
+++ b/src/ResourceManager/Tags/Commands.Tags/Model/TagBaseCmdlet.cs
@@ -26,7 +26,7 @@ public TagsClient TagsClient
{
if (tagsClient == null)
{
- tagsClient = new TagsClient(CurrentContext.Subscription)
+ tagsClient = new TagsClient(Profile, Profile.Context.Subscription)
{
VerboseLogger = WriteVerboseWithTimestamp,
ErrorLogger = WriteErrorWithTimestamp
diff --git a/src/ResourceManager/Tags/Commands.Tags/Model/TagsClient.cs b/src/ResourceManager/Tags/Commands.Tags/Model/TagsClient.cs
index 135981ca718b..5a9dd56d3c6b 100644
--- a/src/ResourceManager/Tags/Commands.Tags/Model/TagsClient.cs
+++ b/src/ResourceManager/Tags/Commands.Tags/Model/TagsClient.cs
@@ -19,9 +19,9 @@
using Microsoft.Azure.Management.Resources;
using Microsoft.Azure.Management.Resources.Models;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.Azure.Commands.Tags.Model
{
@@ -39,8 +39,8 @@ public class TagsClient
/// Creates new TagsClient
///
/// Subscription containing resources to manipulate
- public TagsClient(AzureSubscription subscription)
- : this(AzureSession.ClientFactory.CreateClient(subscription, AzureEnvironment.Endpoint.ResourceManager))
+ public TagsClient(AzureProfile profile, AzureSubscription subscription)
+ : this(AzureSession.ClientFactory.CreateClient(profile, subscription, AzureEnvironment.Endpoint.ResourceManager))
{
}
diff --git a/src/ResourceManager/Tags/Commands.Tags/packages.config b/src/ResourceManager/Tags/Commands.Tags/packages.config
index 0f2b1ec77c46..64ab34241859 100644
--- a/src/ResourceManager/Tags/Commands.Tags/packages.config
+++ b/src/ResourceManager/Tags/Commands.Tags/packages.config
@@ -1,14 +1,14 @@
-
-
+
+
-
+
-
+
diff --git a/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj b/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj
index f837e2b26dec..8401a9954755 100644
--- a/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj
+++ b/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj
@@ -48,27 +48,27 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config b/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config
index 8416e5600f21..0616e5657ee9 100644
--- a/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config
+++ b/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config
@@ -1,14 +1,14 @@
-
-
+
+
-
+
-
+
diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/AzureAutomationBaseCmdlet.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/AzureAutomationBaseCmdlet.cs
index 8c188f0e8abd..da8907bcf105 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/AzureAutomationBaseCmdlet.cs
+++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/AzureAutomationBaseCmdlet.cs
@@ -47,7 +47,7 @@ public IAutomationClient AutomationClient
{
get
{
- return this.automationClient = this.automationClient ?? new AutomationClient(CurrentContext.Subscription);
+ return this.automationClient = this.automationClient ?? new AutomationClient(Profile, Profile.Context.Subscription);
}
set
diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationAccount.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationAccount.cs
index b66f5b301398..729c932b33e5 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationAccount.cs
+++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/GetAzureAutomationAccount.cs
@@ -40,7 +40,7 @@ public IAutomationClient AutomationClient
{
get
{
- return this.automationClient = this.automationClient ?? new AutomationClient(CurrentContext.Subscription);
+ return this.automationClient = this.automationClient ?? new AutomationClient(Profile, Profile.Context.Subscription);
}
set
diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationAccount.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationAccount.cs
index 613f7006d92d..21b4f00f8705 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationAccount.cs
+++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/NewAzureAutomationAccount.cs
@@ -40,7 +40,8 @@ public IAutomationClient AutomationClient
{
get
{
- return this.automationClient = this.automationClient ?? new AutomationClient(CurrentContext.Subscription);
+ return this.automationClient = this.automationClient ?? new AutomationClient(Profile,
+ Profile.Context.Subscription);
}
set
diff --git a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/RemoveAzureAutomationAccount.cs b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/RemoveAzureAutomationAccount.cs
index 6d6007b56e64..4d63614e3f99 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/RemoveAzureAutomationAccount.cs
+++ b/src/ServiceManagement/Automation/Commands.Automation/Cmdlet/RemoveAzureAutomationAccount.cs
@@ -42,7 +42,8 @@ public IAutomationClient AutomationClient
{
get
{
- return this.automationClient = this.automationClient ?? new AutomationClient(CurrentContext.Subscription);
+ return this.automationClient = this.automationClient ?? new AutomationClient(Profile,
+ Profile.Context.Subscription);
}
set
diff --git a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj
index 2c50e5a289f4..d20f67aedfea 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj
+++ b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj
@@ -53,28 +53,28 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs b/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs
index 587497bfb501..d54234fadff1 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs
+++ b/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs
@@ -26,6 +26,7 @@
using Microsoft.WindowsAzure.Management.Automation;
using Microsoft.WindowsAzure.Management.Automation.Models;
using Microsoft.WindowsAzure.Commands.Common;
+using Microsoft.Azure.Common.Authentication.Models;
using Newtonsoft.Json;
using Runbook = Microsoft.Azure.Commands.Automation.Model.Runbook;
@@ -42,8 +43,7 @@
namespace Microsoft.Azure.Commands.Automation.Common
{
using AutomationManagement = WindowsAzure.Management.Automation;
- using Microsoft.Azure.Common.Extensions.Models;
- using Microsoft.Azure.Common.Extensions;
+ using Microsoft.Azure.Common.Authentication;
using Hyak.Common;
@@ -56,10 +56,9 @@ public AutomationClient()
{
}
- public AutomationClient(AzureSubscription subscription)
+ public AutomationClient(AzureProfile profile, AzureSubscription subscription)
: this(subscription,
- AzureSession.ClientFactory.CreateClient(subscription,
- AzureEnvironment.Endpoint.ServiceManagement))
+ AzureSession.ClientFactory.CreateClient(profile, subscription, AzureEnvironment.Endpoint.ServiceManagement))
{
}
diff --git a/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs b/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs
index 6f36e485a121..0ae57197d827 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs
+++ b/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs
@@ -17,7 +17,7 @@
using System.Collections.Generic;
using System.Security;
using Microsoft.Azure.Commands.Automation.Model;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
namespace Microsoft.Azure.Commands.Automation.Common
{
diff --git a/src/ServiceManagement/Automation/Commands.Automation/packages.config b/src/ServiceManagement/Automation/Commands.Automation/packages.config
index a87b8713c6d8..2d4d87a3acfd 100644
--- a/src/ServiceManagement/Automation/Commands.Automation/packages.config
+++ b/src/ServiceManagement/Automation/Commands.Automation/packages.config
@@ -1,15 +1,15 @@
-
-
+
+
-
+
-
+
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj
index 7e801c7579b8..8727aabef743 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj
@@ -41,26 +41,27 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+
+ False
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/packages.config
index 0f2b1ec77c46..64ab34241859 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/packages.config
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/packages.config
@@ -1,14 +1,14 @@
-
-
+
+
-
+
-
+
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj
index 15f23db23c94..1acccd22f8bd 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj
@@ -60,17 +60,17 @@
..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -85,12 +85,12 @@
..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config
index 7d44e82372d2..bc73c7ceb4eb 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config
@@ -1,10 +1,10 @@
-
-
+
+
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj
index 44294d00057c..45e0d2d39af5 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj
@@ -60,17 +60,17 @@
..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -85,12 +85,12 @@
..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config
index 52c05c11e685..f7728287df79 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config
@@ -1,10 +1,10 @@
-
-
+
+
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj
index 2d2f7b7010f9..c062815f6df4 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj
@@ -54,16 +54,17 @@
..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+
+ False
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
@@ -77,13 +78,13 @@
..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdSASUriTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdSASUriTest.cs
index 729b780d0aa6..e7b98b52ff54 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdSASUriTest.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdSASUriTest.cs
@@ -16,7 +16,7 @@
using System.IO;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdTest.cs
index 1876fe516458..c817e930b28f 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdTest.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/AddAzureVhdTest.cs
@@ -16,7 +16,7 @@
using System.IO;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs
index f426f256652c..4914e0e25908 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs
@@ -22,7 +22,7 @@
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests.ConfigDataInfo;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests.ExtensionTests
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs
index a65632d78d6d..1ce5f524ca9f 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/FunctionalTest.cs
@@ -25,7 +25,7 @@
using System.Threading;
using System.Xml;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests.ConfigDataInfo;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs
index 9915405849b8..3ea2082086b3 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs
@@ -22,7 +22,7 @@
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests.ConfigDataInfo;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/SaveAzureVhdTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/SaveAzureVhdTest.cs
index f0f5e9982c48..8f8da078a683 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/SaveAzureVhdTest.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/SaveAzureVhdTest.cs
@@ -16,7 +16,7 @@
using System.IO;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Sync.Download;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs
index 78114f61c852..d6e0f4d1bb9b 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs
@@ -28,7 +28,7 @@
using System.Xml;
using System.Xml.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests.ConfigDataInfo;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs
index d5bb969f147f..3a1be186471e 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs
@@ -22,7 +22,7 @@
using System.Security.Cryptography.X509Certificates;
using System.Xml;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Storage;
using Microsoft.WindowsAzure.Commands.Profile.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs
index ac566b598950..ade26545ec4b 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs
@@ -20,7 +20,7 @@
using System.Threading;
using System.Xml.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Profile.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.Properties;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config
index 920cfaa438d7..45b09325d3fd 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config
@@ -1,10 +1,10 @@
-
-
+
+
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj
index 7ec538ea5623..a61f90f7b3b7 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj
@@ -62,17 +62,17 @@
..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
@@ -87,12 +87,12 @@
..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/BaseAzureServiceExtensionCmdlet.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/BaseAzureServiceExtensionCmdlet.cs
index 597f18fb8096..a24bfa9c41d6 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/BaseAzureServiceExtensionCmdlet.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/BaseAzureServiceExtensionCmdlet.cs
@@ -78,7 +78,7 @@ protected void ValidateService()
{
string serviceName;
ServiceSettings settings = CommonUtilities.GetDefaultSettings(CommonUtilities.TryGetServiceRootPath(CurrentPath()),
- ServiceName, null, null, null, null, CurrentContext.Subscription.Id.ToString(), out serviceName);
+ ServiceName, null, null, null, null, Profile.Context.Subscription.Id.ToString(), out serviceName);
if (string.IsNullOrEmpty(serviceName))
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/ExtensionManager.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/ExtensionManager.cs
index 48cd05446b6a..c6dc159c042f 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/ExtensionManager.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Extensions/Common/ExtensionManager.cs
@@ -40,7 +40,7 @@ public class ExtensionManager
public ExtensionManager(ServiceManagementBaseCmdlet cmdlet, string serviceName)
{
- if (cmdlet == null || cmdlet.CurrentContext.Subscription == null)
+ if (cmdlet == null || cmdlet.Profile.Context.Subscription == null)
{
throw new ArgumentNullException("cmdlet");
}
@@ -51,7 +51,7 @@ public ExtensionManager(ServiceManagementBaseCmdlet cmdlet, string serviceName)
}
Cmdlet = cmdlet;
- SubscriptionId = cmdlet.CurrentContext.Subscription.Id.ToString();
+ SubscriptionId = cmdlet.Profile.Context.Subscription.Id.ToString();
ServiceName = serviceName;
}
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs
index 18ccb01da7e9..3d168eb176dd 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs
@@ -16,7 +16,7 @@
using System;
using System.Management.Automation;
using System.Net;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
@@ -113,7 +113,7 @@ public virtual void NewPaaSDeploymentProcess()
AssertNoPersistenVmRoleExistsInDeployment(PVM.DeploymentSlotType.Production);
AssertNoPersistenVmRoleExistsInDeployment(PVM.DeploymentSlotType.Staging);
- var storageName = CurrentContext.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ var storageName = Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
Uri packageUrl;
if (this.Package.StartsWith(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) ||
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs
index fa2b277cbc8e..7d34c6d4dee8 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs
@@ -15,7 +15,7 @@
using System;
using System.Management.Automation;
using System.Net;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
@@ -189,7 +189,7 @@ public void ExecuteCommand()
if (string.Compare(ParameterSetName, "Upgrade", StringComparison.OrdinalIgnoreCase) == 0)
{
bool removePackage = false;
- var storageName = CurrentContext.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ var storageName = Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
Uri packageUrl = null;
if (Package.StartsWith(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase) ||
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Disks/AddAzureDataDisk.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Disks/AddAzureDataDisk.cs
index 17abeb97d913..0ca4f5dc3a39 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Disks/AddAzureDataDisk.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Disks/AddAzureDataDisk.cs
@@ -19,10 +19,10 @@
using System.Linq;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS
{
@@ -166,7 +166,7 @@ protected Collection GetDataDisks()
protected void ValidateParameters()
{
- var currentSubscription = AzureSession.CurrentContext.Subscription;
+ var currentSubscription = Profile.Context.Subscription;
if ((currentSubscription == null || currentSubscription.GetProperty(AzureSubscription.Property.StorageAccount) == null) && this.MediaLocation == null && string.Compare(this.ParameterSetName, "CreateNew", StringComparison.OrdinalIgnoreCase) == 0)
{
throw new ArgumentException(Resources.MediaLocationOrDefaultStorageAccountMustBeSpecified);
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs
index 1b139bd0242f..c1689e70d382 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs
@@ -21,7 +21,7 @@
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs
index c39ca7ba484b..04945834e219 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs
@@ -16,14 +16,14 @@
using System.Linq;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Management.Storage;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions
@@ -179,7 +179,7 @@ protected override void ValidateParameters()
if (string.Equals(this.ParameterSetName, SetCustomScriptExtensionByContainerBlobsParamSetName))
{
this.StorageEndpointSuffix = string.IsNullOrEmpty(this.StorageEndpointSuffix) ?
- AzureSession.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.StorageEndpointSuffix) : this.StorageEndpointSuffix;
+ Profile.Context.Environment.GetEndpoint(AzureEnvironment.Endpoint.StorageEndpointSuffix) : this.StorageEndpointSuffix;
var sName = string.IsNullOrEmpty(this.StorageAccountName) ? GetStorageName() : this.StorageAccountName;
var sKey = string.IsNullOrEmpty(this.StorageAccountKey) ? GetStorageKey(sName) : this.StorageAccountKey;
@@ -204,7 +204,7 @@ protected override void ValidateParameters()
protected string GetStorageName()
{
- return CurrentContext.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ return Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
}
protected string GetStorageKey(string storageName)
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/VirtualMachineCustomScriptExtensionCmdletBase.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/VirtualMachineCustomScriptExtensionCmdletBase.cs
index f7af774ca2f4..19d858ccc91f 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/VirtualMachineCustomScriptExtensionCmdletBase.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/VirtualMachineCustomScriptExtensionCmdletBase.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/ServiceManagementBaseCmdletExtentions.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/ServiceManagementBaseCmdletExtentions.cs
index e79fd87c7d8f..f2f1c14da975 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/ServiceManagementBaseCmdletExtentions.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/ServiceManagementBaseCmdletExtentions.cs
@@ -15,7 +15,7 @@
using System;
using System.Globalization;
using System.Management.Automation;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.Common.Storage;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
@@ -40,7 +40,7 @@ public static StorageCredentials GetStorageCredentials(this ServiceManagementBas
}
else
{
- var storageAccountName = cmdlet.CurrentContext.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
+ var storageAccountName = cmdlet.Profile.Context.Subscription.GetProperty(AzureSubscription.Property.StorageAccount);
if (!string.IsNullOrEmpty(storageAccountName))
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/SqlServer/VirtualMachineSqlServerExtensionCmdletBase.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/SqlServer/VirtualMachineSqlServerExtensionCmdletBase.cs
index f4cdcacf6e3b..4844e883dc90 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/SqlServer/VirtualMachineSqlServerExtensionCmdletBase.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/SqlServer/VirtualMachineSqlServerExtensionCmdletBase.cs
@@ -12,7 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Network/GetAzureNetworkSecurityGroupConfig.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Network/GetAzureNetworkSecurityGroupConfig.cs
index 441282b2ab56..43173452b9df 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Network/GetAzureNetworkSecurityGroupConfig.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Network/GetAzureNetworkSecurityGroupConfig.cs
@@ -19,7 +19,7 @@
using Microsoft.Azure.Commands.Network.NetworkSecurityGroup.Model;
using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
-using Microsoft.Azure.Common.Extensions;
+using Microsoft.Azure.Common.Authentication;
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS
{
@@ -48,7 +48,7 @@ protected override void ProcessRecord()
else
{
- var networkClient = new NetworkClient(AzureSession.CurrentContext.Subscription, CommandRuntime);
+ var networkClient = new NetworkClient(Profile, Profile.Context.Subscription, CommandRuntime);
INetworkSecurityGroup networkSecurityGroup = networkClient.GetNetworkSecurityGroup(networkSecurityGroupName, Detailed);
WriteObject(networkSecurityGroup, true);
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureQuickVM.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureQuickVM.cs
index 89547a2adc39..820076ba1aef 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureQuickVM.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureQuickVM.cs
@@ -21,7 +21,7 @@
using System.Net;
using System.Security.Cryptography.X509Certificates;
using AutoMapper;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Common;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers;
using Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.Extensions;
@@ -171,11 +171,11 @@ public class NewQuickVM : IaaSDeploymentManagementCmdletBase
public void NewAzureVMProcess()
{
- AzureSubscription currentSubscription = CurrentContext.Subscription;
+ AzureSubscription currentSubscription = Profile.Context.Subscription;
CloudStorageAccount currentStorage = null;
try
{
- currentStorage = currentSubscription.GetCloudStorageAccount();
+ currentStorage = currentSubscription.GetCloudStorageAccount(Profile);
}
catch (Exception ex) // couldn't access
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVM.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVM.cs
index cea2e5f40d24..f4a4d4f297c5 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVM.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVM.cs
@@ -18,7 +18,7 @@
using System.Management.Automation;
using System.Net;
using AutoMapper;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
@@ -157,11 +157,11 @@ public string ReservedIPName
public void NewAzureVMProcess()
{
- AzureSubscription currentSubscription = CurrentContext.Subscription;
+ AzureSubscription currentSubscription = Profile.Context.Subscription;
CloudStorageAccount currentStorage = null;
try
{
- currentStorage = currentSubscription.GetCloudStorageAccount();
+ currentStorage = currentSubscription.GetCloudStorageAccount(Profile);
}
catch (Exception ex) // couldn't access
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVMConfig.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVMConfig.cs
index fb08778cb8ef..ded3f7ab2bcc 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVMConfig.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVMConfig.cs
@@ -16,7 +16,7 @@
using System;
using System.Collections.ObjectModel;
using System.Management.Automation;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
@@ -132,7 +132,7 @@ protected override void ProcessRecord()
protected void ValidateParameters()
{
- AzureSubscription currentSubscription = CurrentContext.Subscription;
+ AzureSubscription currentSubscription = Profile.Context.Subscription;
if ((currentSubscription == null || string.IsNullOrEmpty(currentSubscription.GetProperty(AzureSubscription.Property.StorageAccount))) && string.IsNullOrEmpty(MediaLocation))
{
throw new ArgumentException(Resources.MustSpecifyMediaLocationOrHaveCurrentStorageAccount);
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/UpdateAzureVM.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/UpdateAzureVM.cs
index de7a15577691..ac18a9524c38 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/UpdateAzureVM.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/UpdateAzureVM.cs
@@ -17,7 +17,7 @@
using System.Linq;
using System.Management.Automation;
using AutoMapper;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
@@ -54,7 +54,7 @@ internal void ExecuteCommandNewSM()
base.ExecuteCommand();
- AzureSubscription currentSubscription = CurrentContext.Subscription;
+ AzureSubscription currentSubscription = Profile.Context.Subscription;
if (CurrentDeploymentNewSM == null)
{
throw new ApplicationException(String.Format(Resources.CouldNotFindDeployment, ServiceName, Model.DeploymentSlotType.Production));
@@ -65,7 +65,7 @@ internal void ExecuteCommandNewSM()
{
if (datadisk.MediaLink == null && string.IsNullOrEmpty(datadisk.DiskName))
{
- CloudStorageAccount currentStorage = currentSubscription.GetCloudStorageAccount();
+ CloudStorageAccount currentStorage = currentSubscription.GetCloudStorageAccount(Profile);
if (currentStorage == null)
{
throw new ArgumentException(Resources.CurrentStorageAccountIsNotAccessible);
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/AddAzureVhdCommand.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/AddAzureVhdCommand.cs
index 959d92f44c4b..a2aa33e23440 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/AddAzureVhdCommand.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/AddAzureVhdCommand.cs
@@ -120,7 +120,7 @@ private StorageCredentialsFactory CreateStorageCredentialsFactory()
StorageCredentialsFactory storageCredentialsFactory;
if (StorageCredentialsFactory.IsChannelRequired(Destination))
{
- storageCredentialsFactory = new StorageCredentialsFactory(this.StorageClient, this.CurrentContext.Subscription);
+ storageCredentialsFactory = new StorageCredentialsFactory(this.StorageClient, this.Profile.Context.Subscription);
}
else
{
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/StorageCredentialsFactory.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/StorageCredentialsFactory.cs
index c12a470e24ab..bab5c364df06 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/StorageCredentialsFactory.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/StorageServices/StorageCredentialsFactory.cs
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------------
using System;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
using Microsoft.WindowsAzure.Commands.Sync.Download;
using Microsoft.WindowsAzure.Management.Storage;
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config
index 52c05c11e685..f7728287df79 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config
@@ -1,10 +1,10 @@
-
-
+
+
-
+
@@ -12,7 +12,7 @@
-
+
diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj
index 02b1728d8d53..00cdc00fc2af 100644
--- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj
+++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj
@@ -42,28 +42,28 @@
- ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll
+ ..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.dll
-
+
False
- ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll
+ ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.8-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll
- ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll
+ ..\..\..\packages\Microsoft.Azure.Common.2.0.2\lib\net45\Microsoft.Azure.Common.NetFramework.dll
False
..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
+
False
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll
- ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
+ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
False
diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteBaseCmdlet.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteBaseCmdlet.cs
index 362ffdf80bd5..9d2b1026ea91 100644
--- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteBaseCmdlet.cs
+++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteBaseCmdlet.cs
@@ -26,7 +26,7 @@ public ExpressRouteClient ExpressRouteClient
{
if (expressRouteClient == null)
{
- expressRouteClient = new ExpressRouteClient(CurrentContext.Subscription);
+ expressRouteClient = new ExpressRouteClient(Profile, Profile.Context.Subscription);
}
return expressRouteClient;
}
diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs
index 22a67f9b9ed4..25181cc9d77d 100644
--- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs
+++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs
@@ -14,7 +14,7 @@
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common;
-using Microsoft.Azure.Common.Extensions.Models;
+using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Common;
namespace Microsoft.WindowsAzure.Commands.ExpressRoute
@@ -25,8 +25,8 @@ namespace Microsoft.WindowsAzure.Commands.ExpressRoute
using System.Collections.Generic;
using System.Net;
using Utilities.Common;
- using Microsoft.Azure.Common.Extensions.Models;
- using Microsoft.Azure.Common.Extensions;
+ using Microsoft.Azure.Common.Authentication.Models;
+ using Microsoft.Azure.Common.Authentication;
using Hyak.Common;
@@ -34,17 +34,17 @@ public class ExpressRouteClient
{
public ExpressRouteManagementClient Client { get; internal set; }
- private static ClientType CreateClient(AzureSubscription subscription) where ClientType : ServiceClient
+ private static ClientType CreateClient(AzureProfile profile, AzureSubscription subscription) where ClientType : ServiceClient
{
- return AzureSession.ClientFactory.CreateClient(subscription, AzureEnvironment.Endpoint.ServiceManagement);
+ return AzureSession.ClientFactory.CreateClient(profile, subscription, AzureEnvironment.Endpoint.ServiceManagement);
}
///
/// Creates new ExpressRouteClient
///
/// Subscription containing websites to manipulate
- public ExpressRouteClient(AzureSubscription subscription)
- : this(CreateClient(subscription))
+ public ExpressRouteClient(AzureProfile profile, AzureSubscription subscription)
+ : this(CreateClient(profile, subscription))
{
}
diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config
index a2e0cc60e388..4b3d4742b855 100644
--- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config
+++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config
@@ -1,14 +1,14 @@
-
-
+
+
-
+
-
+
diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj
index 5eaa931db2c8..e15aa5bcbb9c 100644
--- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj
+++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj
@@ -42,17 +42,17 @@