diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index c8afbd78f388..8916d09c26a0 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -24,7 +24,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -184,7 +184,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -377,7 +377,7 @@ - + @@ -478,7 +478,7 @@ - + @@ -555,7 +555,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -734,7 +734,7 @@ - + @@ -847,7 +847,7 @@ - + @@ -1020,7 +1020,7 @@ - + @@ -1082,7 +1082,7 @@ - + @@ -1231,7 +1231,7 @@ - + @@ -1383,7 +1383,7 @@ - + @@ -1460,7 +1460,7 @@ - + @@ -1564,7 +1564,7 @@ - + @@ -2046,7 +2046,7 @@ - + @@ -2213,7 +2213,7 @@ - + @@ -2302,7 +2302,7 @@ - + @@ -2361,7 +2361,7 @@ - + diff --git a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj index 89eb2b979a81..b4cf2c5b4746 100644 --- a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj +++ b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj @@ -56,9 +56,9 @@ False ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.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..c2868687af36 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 { diff --git a/src/Common/Commands.Common.Storage/packages.config b/src/Common/Commands.Common.Storage/packages.config index e4506f130cef..52134a14e9f3 100644 --- a/src/Common/Commands.Common.Storage/packages.config +++ b/src/Common/Commands.Common.Storage/packages.config @@ -3,7 +3,7 @@ - + @@ -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 e03df699a4ab..c0be90a19b4d 100644 --- a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj +++ b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj @@ -54,9 +54,9 @@ ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.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 @@ -154,7 +154,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..36e5908e9a5d 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,10 @@ public class ProfileCmdltsTests public ProfileCmdltsTests() : base() { dataStore = new MockDataStore(); - ProfileClient.DataStore = dataStore; + AzureSession.DataStore = dataStore; commandRuntimeMock = new MockCommandRuntime(); SetMockData(); - AzureSession.SetCurrentContext(null, null, null); + AzureSession.Profile = new AzureProfile(); } [Fact] @@ -155,13 +151,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] @@ -403,11 +399,11 @@ 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(); var oldDataStore = FileUtilities.DataStore; - FileUtilities.DataStore = ProfileClient.DataStore; + FileUtilities.DataStore = AzureSession.DataStore; var expectedEnv = "AzureChinaCloud"; var expected = client.ImportPublishSettings("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings", null); @@ -442,11 +438,11 @@ 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(); var oldDataStore = FileUtilities.DataStore; - FileUtilities.DataStore = ProfileClient.DataStore; + FileUtilities.DataStore = AzureSession.DataStore; var expectedEnv = "AzureCloud"; var expected = client.ImportPublishSettings("ImportPublishSettingsFileSelectsCorrectEnvironment.publishsettings", expectedEnv); @@ -510,7 +506,7 @@ public void SelectAzureSubscriptionByNameUpdatesProfile() cmdlt.CommandRuntime = commandRuntimeMock; cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet"); cmdlt.SubscriptionName = azureSubscription2.Name; - Assert.Null(AzureSession.CurrentContext.Subscription); + Assert.Null(AzureSession.Profile.CurrentContext.Subscription); // Act cmdlt.InvokeBeginProcessing(); @@ -518,8 +514,8 @@ public void SelectAzureSubscriptionByNameUpdatesProfile() cmdlt.InvokeEndProcessing(); // Verify - Assert.NotNull(AzureSession.CurrentContext.Subscription); - Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id); + Assert.NotNull(AzureSession.Profile.CurrentContext.Subscription); + Assert.Equal(azureSubscription2.Id, AzureSession.Profile.CurrentContext.Subscription.Id); } [Fact] @@ -532,7 +528,7 @@ public void SelectAzureSubscriptionWithoutPassthroughDoesNotPrint() cmdlt.CommandRuntime = commandRuntimeMock; cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet"); cmdlt.SubscriptionName = azureSubscription2.Name; - Assert.Null(AzureSession.CurrentContext.Subscription); + Assert.Null(AzureSession.Profile.CurrentContext.Subscription); // Act cmdlt.InvokeBeginProcessing(); @@ -554,7 +550,7 @@ public void SelectAzureSubscriptionWithPassthroughPrintsSubscription() cmdlt.SetParameterSet("SelectSubscriptionByNameParameterSet"); cmdlt.SubscriptionName = azureSubscription2.Name; cmdlt.PassThru = new SwitchParameter(true); - Assert.Null(AzureSession.CurrentContext.Subscription); + Assert.Null(AzureSession.Profile.CurrentContext.Subscription); // Act cmdlt.InvokeBeginProcessing(); @@ -616,7 +612,7 @@ public void SelectAzureSubscriptionByIdAndNoCurrentUpdatesProfile() cmdlt.CommandRuntime = commandRuntimeMock; cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet"); cmdlt.SubscriptionId = azureSubscription2.Id.ToString(); - Assert.Null(AzureSession.CurrentContext.Subscription); + Assert.Null(AzureSession.Profile.CurrentContext.Subscription); // Act cmdlt.InvokeBeginProcessing(); @@ -624,8 +620,8 @@ public void SelectAzureSubscriptionByIdAndNoCurrentUpdatesProfile() cmdlt.InvokeEndProcessing(); // Verify - Assert.NotNull(AzureSession.CurrentContext.Subscription); - Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id); + Assert.NotNull(AzureSession.Profile.CurrentContext.Subscription); + Assert.Equal(azureSubscription2.Id, AzureSession.Profile.CurrentContext.Subscription.Id); cmdlt = new SelectAzureSubscriptionCommand(); @@ -640,7 +636,7 @@ public void SelectAzureSubscriptionByIdAndNoCurrentUpdatesProfile() cmdlt.InvokeEndProcessing(); // Verify - Assert.Null(AzureSession.CurrentContext.Subscription); + Assert.Null(AzureSession.Profile.CurrentContext.Subscription); } [Fact] @@ -654,7 +650,7 @@ public void SelectAzureSubscriptionByInvalidIdThrowsException() cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet"); string invalidGuid = Guid.NewGuid().ToString(); cmdlt.SubscriptionId = invalidGuid; - Assert.Null(AzureSession.CurrentContext.Subscription); + Assert.Null(AzureSession.Profile.CurrentContext.Subscription); // Act cmdlt.InvokeBeginProcessing(); @@ -680,7 +676,7 @@ public void SelectAzureSubscriptionByInvalidGuidThrowsException() cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet"); string invalidGuid = "foo"; cmdlt.SubscriptionId = invalidGuid; - Assert.Null(AzureSession.CurrentContext.Subscription); + Assert.Null(AzureSession.Profile.CurrentContext.Subscription); // Act cmdlt.InvokeBeginProcessing(); 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..79335482dc29 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 { @@ -39,17 +39,15 @@ 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) + if (AzureSession.Profile.CurrentContext.Subscription == null) { var newGuid = Guid.NewGuid(); - AzureSession.SetCurrentContext( - new AzureSubscription { Id = newGuid, Name = "test", Environment = EnvironmentName.AzureCloud, Account = "test" }, - null, - new AzureAccount + AzureSession.Profile.Subscriptions[newGuid] = new AzureSubscription { Id = newGuid, Name = "test", Environment = EnvironmentName.AzureCloud, Account = "test" }; + AzureSession.Profile.Accounts["test"] = new AzureAccount { Id = "test", Type = AzureAccount.AccountType.User, @@ -57,7 +55,8 @@ public void BaseSetup() { {AzureAccount.Property.Subscriptions, newGuid.ToString()} } - }); + }; + AzureSession.Profile.DefaultSubscription = AzureSession.Profile.Subscriptions[newGuid]; } AzureSession.AuthenticationFactory = new MockTokenAuthenticationFactory(); } 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..1c9f38eeda95 100644 --- a/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs +++ b/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs @@ -22,9 +22,9 @@ 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; namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks @@ -58,12 +58,11 @@ public TClient CreateClient(AzureSubscription subscription, AzureEnviro 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 - }; + AzureContext context = new AzureContext( + subscription, + profileClient.GetAccount(subscription.Account), + profileClient.GetEnvironmentOrDefault(subscription.Environment) + ); creds = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(context); } 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..c7b323287cfe 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; diff --git a/src/Common/Commands.Common.Test/packages.config b/src/Common/Commands.Common.Test/packages.config index 37c24bf2f41f..cc4d3898b9c7 100644 --- a/src/Common/Commands.Common.Test/packages.config +++ b/src/Common/Commands.Common.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/src/Common/Commands.Common/AzurePSCmdlet.cs b/src/Common/Commands.Common/AzurePSCmdlet.cs index abf5f1496930..1ece6a6fcd0c 100644 --- a/src/Common/Commands.Common/AzurePSCmdlet.cs +++ b/src/Common/Commands.Common/AzurePSCmdlet.cs @@ -12,12 +12,13 @@ // 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 @@ -28,6 +29,9 @@ public abstract class AzurePSCmdlet : PSCmdlet static AzurePSCmdlet() { + AzureSession.Profile = new AzureProfile( + Path.Combine(AzureSession.ProfileDirectory, AzureSession.ProfileFile)); + if (!TestMockSupport.RunningMocked) { AzureSession.ClientFactory.AddAction(new RPRegistrationAction()); @@ -38,35 +42,17 @@ static AzurePSCmdlet() public AzurePSCmdlet() { - DefaultProfileClient = new ProfileClient(); - - if (AzureSession.CurrentContext.Subscription == null && - DefaultProfileClient.Profile.DefaultSubscription != null) - { - try - { - AzureSession.SetCurrentContext( - DefaultProfileClient.Profile.DefaultSubscription, - DefaultProfileClient.GetEnvironmentOrDefault( - DefaultProfileClient.Profile.DefaultSubscription.Environment), - DefaultProfileClient.GetAccountOrNull(DefaultProfileClient.Profile.DefaultSubscription.Account)); - } - catch - { - // Ignore anything at this point - } - } - + DefaultProfileClient = new ProfileClient(AzureSession.Profile); } public AzureContext CurrentContext { - get { return AzureSession.CurrentContext; } + get { return AzureSession.Profile.CurrentContext; } } public bool HasCurrentSubscription { - get { return AzureSession.CurrentContext.Subscription != null; } + get { return AzureSession.Profile.CurrentContext.Subscription != null; } } public ProfileClient DefaultProfileClient { get; private set; } diff --git a/src/Common/Commands.Common/AzurePowerShell.cs b/src/Common/Commands.Common/AzurePowerShell.cs index 8a83a71d76c5..6d1eb06ef533 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..73da454a508c 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; @@ -83,12 +83,12 @@ protected void DoInitChannelCurrentSubscription(bool force) { if (CurrentContext.Subscription == null) { - throw new ArgumentException(Resources.InvalidCurrentSubscription); + throw new ArgumentException(Resources.InvalidDefaultSubscription); } if (CurrentContext.Account == null) { - throw new ArgumentException(Resources.InvalidCurrentSuscriptionCertificate); + throw new ArgumentException(Resources.AccountNeedsToBeSpecified); } if (Channel == null || force) @@ -133,7 +133,7 @@ protected virtual T CreateChannel() return ChannelHelper.CreateServiceManagementChannel( ServiceBinding, CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement), - ProfileClient.DataStore.GetCertificate(certificateThumbprint), + AzureSession.DataStore.GetCertificate(certificateThumbprint), new HttpRestMessageInspector(WriteDebug)); } diff --git a/src/Common/Commands.Common/Commands.Common.csproj b/src/Common/Commands.Common/Commands.Common.csproj index 3215eca634f9..78ee7d0de2f4 100644 --- a/src/Common/Commands.Common/Commands.Common.csproj +++ b/src/Common/Commands.Common/Commands.Common.csproj @@ -58,9 +58,9 @@ False ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.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..91d16ea35e4f 100644 --- a/src/Common/Commands.Common/GeneralUtilities.cs +++ b/src/Common/Commands.Common/GeneralUtilities.cs @@ -13,8 +13,8 @@ // ---------------------------------------------------------------------------------- using Hyak.Common; -using Microsoft.Azure.Common.Extensions; -using Microsoft.Azure.Common.Extensions.Properties; +using Microsoft.Azure.Common.Authentication; +using Microsoft.Azure.Common.Authentication.Properties; using Microsoft.WindowsAzure.Commands.Common; using System; using System.Collections.Generic; 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 aadcee8cea7b..ad710f9fff16 100644 --- a/src/Common/Commands.Common/Properties/Resources.Designer.cs +++ b/src/Common/Commands.Common/Properties/Resources.Designer.cs @@ -1,17 +1,17 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -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 Emulator. /// @@ -637,24 +637,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}. /// @@ -700,15 +682,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:. /// @@ -781,15 +754,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. /// @@ -817,15 +781,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. /// @@ -1042,15 +997,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. /// @@ -1087,15 +1033,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}. /// @@ -1177,15 +1114,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. /// @@ -1231,24 +1159,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. /// @@ -1267,24 +1177,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.. /// @@ -1312,42 +1204,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.. /// @@ -1375,15 +1231,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.. /// @@ -1393,15 +1240,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. /// @@ -1461,15 +1299,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.. /// @@ -1506,15 +1335,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. /// @@ -1560,15 +1380,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. /// @@ -1641,15 +1452,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. /// @@ -1677,15 +1479,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. /// @@ -1704,15 +1497,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.. /// @@ -2151,24 +1935,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>. /// @@ -2327,24 +2093,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.. /// @@ -2603,15 +2351,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. /// @@ -2855,24 +2594,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. /// @@ -3125,15 +2846,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. /// @@ -3422,15 +3134,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. /// @@ -3459,16 +3162,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 { @@ -3476,15 +3170,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}. /// @@ -3530,24 +3215,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. /// @@ -3602,24 +3269,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.. /// @@ -3711,15 +3360,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.. /// @@ -3747,15 +3387,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. /// @@ -3954,15 +3585,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. /// @@ -3972,15 +3594,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. /// @@ -4035,24 +3648,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.. /// @@ -4242,15 +3837,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 9295f82d4c57..0d10df0db2a1 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 - Emulator @@ -309,12 +306,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} @@ -354,9 +345,6 @@ Complete - - Complete - config.json @@ -437,9 +425,6 @@ The environment '{0}' already exists. - - The environment name '{0}' is not found. - environments.xml @@ -454,9 +439,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 @@ -485,9 +467,6 @@ Could not find publish settings. Please run Import-AzurePublishSettingsFile. - - Could not find publish settings. Please run Import-AzurePublishSettingsFile. - iisnode.dll @@ -503,24 +482,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. @@ -530,33 +497,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 @@ -580,9 +529,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. @@ -595,9 +541,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 @@ -613,9 +556,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 @@ -640,9 +580,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 @@ -652,18 +589,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. @@ -816,12 +747,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}". @@ -880,12 +805,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. @@ -976,9 +895,6 @@ Please follow these steps in the portal: publishSettings.xml - - &whr={0} - Publish settings imported @@ -1060,12 +976,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 @@ -1225,9 +1135,6 @@ Please follow these steps in the portal: ServiceDefinition.csdef - - ServiceDefinition.csdef - {0}Deploy @@ -1252,12 +1159,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 @@ -1276,12 +1177,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. @@ -1316,15 +1211,9 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf deploymentSettings.json - - deploymentSettings.json - Confirm - - Confirm - Shutdown WAPackIaaS @@ -1391,12 +1280,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 @@ -1417,9 +1300,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. @@ -1484,9 +1364,6 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf WorkerRole.xml - - (x86) - Yes @@ -1521,9 +1398,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. @@ -1531,9 +1405,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". @@ -1543,18 +1414,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}. @@ -1564,9 +1423,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? @@ -1576,4 +1432,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..78724e571738 100644 --- a/src/Common/Commands.Common/SubscriptionCmdletBase.cs +++ b/src/Common/Commands.Common/SubscriptionCmdletBase.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; using System.Management.Automation; diff --git a/src/Common/Commands.Common/packages.config b/src/Common/Commands.Common/packages.config index a2d042d901c1..3213cd9fd1e1 100644 --- a/src/Common/Commands.Common/packages.config +++ b/src/Common/Commands.Common/packages.config @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/src/Common/Commands.Profile/Account/AddAzureAccount.cs b/src/Common/Commands.Profile/Account/AddAzureAccount.cs index d6793e6522d9..db7cc6697a4e 100644 --- a/src/Common/Commands.Profile/Account/AddAzureAccount.cs +++ b/src/Common/Commands.Profile/Account/AddAzureAccount.cs @@ -15,7 +15,7 @@ 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; diff --git a/src/Common/Commands.Profile/Account/GetAzureAccount.cs b/src/Common/Commands.Profile/Account/GetAzureAccount.cs index ad63b8dc70ee..39044de505f7 100644 --- a/src/Common/Commands.Profile/Account/GetAzureAccount.cs +++ b/src/Common/Commands.Profile/Account/GetAzureAccount.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.WindowsAzure.Commands.Utilities.Profile; using System.Collections.Generic; 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 42fa311e25ad..607af65564e7 100644 --- a/src/Common/Commands.Profile/Commands.Profile.csproj +++ b/src/Common/Commands.Profile/Commands.Profile.csproj @@ -53,9 +53,9 @@ ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -65,13 +65,13 @@ - + 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 @@ -128,7 +128,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..152c2b606a9b --- /dev/null +++ b/src/Common/Commands.Profile/Profile/NewAzureProfile.cs @@ -0,0 +1,61 @@ +// ---------------------------------------------------------------------------------- +// +// 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 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 FileParameterSet = "File"; + + [Parameter(Mandatory = false, Position = 0, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)] + [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 = CredentialsParameterSet)] + public string SubscriptionId { get; set; } + + [Parameter(Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)] + [Parameter(Mandatory = false, Position = 2, ValueFromPipelineByPropertyName = true, ParameterSetName = CredentialsParameterSet)] + public string StorageAccount { get; set; } + + [Parameter(Mandatory = true, Position = 3, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)] + public string Certificate { get; set; } + + [Parameter(Mandatory = true, Position = 3, ValueFromPipelineByPropertyName = true, ParameterSetName = CredentialsParameterSet)] + public PSCredential Credential { get; set; } + + [Parameter(Mandatory = true, Position = 4, ValueFromPipelineByPropertyName = true, ParameterSetName = CertificateParameterSet)] + public string Tenant { 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() + { + } + } +} 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..522f7a7dd686 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(AzureSession.Profile.CurrentContext.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 (AzureSession.Profile.CurrentContext.Subscription == null) { WriteError(new ErrorRecord( new InvalidOperationException(Resources.InvalidSelectedSubscription), @@ -112,7 +112,7 @@ public void GetCurrent() } else { - WriteSubscriptions(AzureSession.CurrentContext.Subscription); + WriteSubscriptions(AzureSession.Profile.CurrentContext.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 = AzureSession.Profile.CurrentContext.Subscription != null && AzureSession.Profile.CurrentContext.Subscription.Id == subscription.Id; psObject.CurrentStorageAccountName = subscription.GetProperty(AzureSubscription.Property.StorageAccount); psObject.TenantId = subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants).FirstOrDefault(); return psObject; @@ -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..91e3ab826627 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(AzureSession.Profile.CurrentContext != 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..853af3211163 100644 --- a/src/Common/Commands.Profile/Subscription/SetAzureSubscription.cs +++ b/src/Common/Commands.Profile/Subscription/SetAzureSubscription.cs @@ -16,7 +16,7 @@ using System.Linq; using System.Management.Automation; using System.Security.Cryptography.X509Certificates; -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/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 bdde83a6dc79..8ee5a3bea881 100644 --- a/src/Common/Commands.Profile/packages.config +++ b/src/Common/Commands.Profile/packages.config @@ -3,12 +3,12 @@ - + - + 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 2e72218aa9cd..7b7d64d51eae 100644 --- a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj +++ b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj @@ -44,9 +44,9 @@ ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.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 366cc8d0a73a..4693432a86d4 100644 --- a/src/Common/Commands.ScenarioTest/packages.config +++ b/src/Common/Commands.ScenarioTest/packages.config @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj index 9822e8b9c83f..5d3c8255a4a7 100644 --- a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj +++ b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj @@ -43,9 +43,9 @@ ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -59,13 +59,13 @@ ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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..dad5dc607273 100644 --- a/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs +++ b/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs @@ -18,11 +18,11 @@ 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; @@ -40,7 +40,7 @@ public class EnvironmentSetupHelper public EnvironmentSetupHelper() { - ProfileClient.DataStore = new MockDataStore(); + AzureSession.DataStore = new MockDataStore(); client = new ProfileClient(); // Ignore SSL errors @@ -141,7 +141,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 924f1c43ed10..5bc385c29e1c 100644 --- a/src/Common/Commands.ScenarioTests.Common/packages.config +++ b/src/Common/Commands.ScenarioTests.Common/packages.config @@ -3,14 +3,14 @@ - + - + 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 0bd45295165d..7a3d064577b2 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj +++ b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj @@ -44,9 +44,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -72,13 +72,13 @@ False ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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 ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll 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 285d8e0d9c83..fa77f6a7811f 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + 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..9c61be34f770 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; diff --git a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj index 77a2bc161da2..63a1a68f471d 100644 --- a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj +++ b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj @@ -47,9 +47,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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 cc8fad4873ab..8989889a8717 100644 --- a/src/ResourceManager/Batch/Commands.Batch/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch/packages.config @@ -3,13 +3,13 @@ - + - + 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 87fa552c585c..ac9aba11f4e4 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj @@ -47,9 +47,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -79,12 +79,12 @@ ..\..\..\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 b0cac354a853..3c1518859eb2 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj b/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj index 7dea4b49cd3e..fc55723884a7 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj @@ -54,9 +54,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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/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 b8e25f318f05..ffbffb33eb54 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj b/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj index f28e29f7a6c6..d5438ef9d57b 100644 --- a/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj +++ b/src/ResourceManager/Insights/Commands.Insights/Commands.Insights.csproj @@ -55,9 +55,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll diff --git a/src/ResourceManager/Insights/Commands.Insights/InsightsCmdletBase.cs b/src/ResourceManager/Insights/Commands.Insights/InsightsCmdletBase.cs index 1aed53affe21..d71ce5b79081 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; 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 9f1989140747..2ebff082a914 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj +++ b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj @@ -54,9 +54,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -74,7 +74,7 @@ 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 bea4bcaf95a9..5394b05a0ca8 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config +++ b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config @@ -3,14 +3,14 @@ - + - + diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj index d005382341c3..194f9207ac7e 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj @@ -113,9 +113,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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..5fdf071b4230 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, + AzureSession.Profile.CurrentContext, 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 bdde83a6dc79..8ee5a3bea881 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config @@ -3,12 +3,12 @@ - + - + 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 81c12f4c1222..ef8a52134224 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj @@ -47,9 +47,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -68,13 +68,13 @@ False ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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 6a593376f14f..ba6e47c68c76 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj index e754d5f89adc..674bd6e1dd73 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj @@ -52,9 +52,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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/packages.config b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config index 7020401c726a..3c070dd7a58e 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config @@ -3,13 +3,13 @@ - + - + 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 019b4386cb1e..06380eb25ea6 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj +++ b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj @@ -50,8 +50,8 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -76,13 +76,13 @@ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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 02dff238b83b..d6cbfdbdadcc 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/packages.config +++ b/src/ResourceManager/Resources/Commands.Resources.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj index 1830573d5bee..7a1378d3e2b0 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj @@ -54,9 +54,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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/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/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/packages.config b/src/ResourceManager/Resources/Commands.Resources/packages.config index e83739fca74e..5ab6811cc001 100644 --- a/src/ResourceManager/Resources/Commands.Resources/packages.config +++ b/src/ResourceManager/Resources/Commands.Resources/packages.config @@ -3,7 +3,7 @@ - + @@ -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 dfda4645758f..55556133374b 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj +++ b/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj @@ -48,8 +48,8 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -69,13 +69,13 @@ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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 42d2cb91ae76..12546370cbcb 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/packages.config +++ b/src/ResourceManager/Sql/Commands.Sql.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj index ee3d99a36601..4f102e6e0302 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj +++ b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj @@ -95,9 +95,9 @@ False ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.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/Services/EndpointsCommunicator.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Services/EndpointsCommunicator.cs index cfd90d3c7c12..e97103bee6dc 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; diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs index 377978ed9ed3..992d98d4fb06 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; diff --git a/src/ResourceManager/Sql/Commands.Sql/packages.config b/src/ResourceManager/Sql/Commands.Sql/packages.config index 2f6f80a9e08f..a1f39893a99e 100644 --- a/src/ResourceManager/Sql/Commands.Sql/packages.config +++ b/src/ResourceManager/Sql/Commands.Sql/packages.config @@ -3,7 +3,7 @@ - + @@ -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 4f88c9b53c09..409a30e3af1f 100644 --- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Commands.StreamAnalytics.Test.csproj +++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/Commands.StreamAnalytics.Test.csproj @@ -45,9 +45,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -74,12 +74,12 @@ False ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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 0d3ed97e342a..f0cd0b2eec8d 100644 --- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/packages.config +++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj index ad7ec1ae6c11..77a700f96362 100644 --- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj +++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/Commands.StreamAnalytics.csproj @@ -54,9 +54,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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/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 85d8cae6409d..a02e836c9c32 100644 --- a/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/packages.config +++ b/src/ResourceManager/StreamAnalytics/Commands.StreamAnalytics/packages.config @@ -3,13 +3,13 @@ - + - + diff --git a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj index 9706839753af..af66ce7ce398 100644 --- a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj +++ b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj @@ -54,9 +54,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -65,13 +65,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/Tags/Commands.Tags/Model/TagsClient.cs b/src/ResourceManager/Tags/Commands.Tags/Model/TagsClient.cs index 135981ca718b..8e1fbc18614c 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 { diff --git a/src/ResourceManager/Tags/Commands.Tags/packages.config b/src/ResourceManager/Tags/Commands.Tags/packages.config index bdde83a6dc79..8ee5a3bea881 100644 --- a/src/ResourceManager/Tags/Commands.Tags/packages.config +++ b/src/ResourceManager/Tags/Commands.Tags/packages.config @@ -3,12 +3,12 @@ - + - + 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 4451ed842965..48dc39f966fd 100644 --- a/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj +++ b/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj @@ -53,9 +53,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -63,12 +63,12 @@ ..\..\..\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 1f37d4eeeaf3..c081eb1ac23d 100644 --- a/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config +++ b/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config @@ -3,12 +3,12 @@ - + - + diff --git a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj index 5f098d827134..fbca92edb634 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj +++ b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj @@ -58,9 +58,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -73,12 +73,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/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs b/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs index ef1d5de7d28e..0a00aea3d466 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Common/AutomationClient.cs @@ -23,13 +23,13 @@ using Microsoft.Azure.Commands.Automation.Properties; using Microsoft.Azure.Management.Automation; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Newtonsoft.Json; namespace Microsoft.Azure.Commands.Automation.Common { using AutomationManagement = Management.Automation; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; public class AutomationClient : IAutomationClient { diff --git a/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs b/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs index cc001f934108..157f29d3fca2 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs +++ b/src/ServiceManagement/Automation/Commands.Automation/Common/IAutomationClient.cs @@ -16,7 +16,7 @@ using System.Collections; using System.Collections.Generic; 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 8b59dcb543a7..26493ec3dea1 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/packages.config +++ b/src/ServiceManagement/Automation/Commands.Automation/packages.config @@ -3,13 +3,13 @@ - + - + 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 46dd90cd9d83..bc3f0bd0fd47 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 @@ -43,9 +43,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -53,12 +53,12 @@ ..\..\..\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 bdde83a6dc79..8ee5a3bea881 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/packages.config @@ -3,12 +3,12 @@ - + - + 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 e0f0df052783..3228c54d9940 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj @@ -65,9 +65,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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 2e1cd5f32f8f..c73ed249945e 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config @@ -4,7 +4,7 @@ - + @@ -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 2a595f90105a..2ddac3386aff 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj @@ -65,9 +65,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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 ce92088d8fe7..0499fc38439a 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config @@ -4,7 +4,7 @@ - + @@ -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 a48a495776f8..ee542b7fca61 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj @@ -59,9 +59,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -78,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 970c46469ae6..92b10b22866b 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs @@ -27,7 +27,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 5ba5432bbbf1..2fe692b93c53 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 a7b8f0f1819b..ebef70f40944 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config @@ -4,7 +4,7 @@ - + @@ -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 edf24aebccc9..d07589b42d6d 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj @@ -67,9 +67,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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/HostedServices/NewAzureDeployment.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/NewAzureDeployment.cs index 9dce70e2c3ac..bc8433a68a2e 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; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/HostedServices/SetAzureDeployment.cs index fa2b277cbc8e..dc950e493f00 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; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Disks/AddAzureDataDisk.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Disks/AddAzureDataDisk.cs index 17abeb97d913..5ee3ac9dd02c 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 = AzureSession.Profile.CurrentContext.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..e44e441303ac 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; + AzureSession.Profile.CurrentContext.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; 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..5c8cec55de91 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; 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..1c8dbf6a7fb8 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(AzureSession.Profile.CurrentContext.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..f125b87e9884 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; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVM.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVM.cs index cea2e5f40d24..4b042c7d393c 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; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVMConfig.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/NewAzureVMConfig.cs index fb08778cb8ef..f5e2ca5798f6 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; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/UpdateAzureVM.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/UpdateAzureVM.cs index de7a15577691..147142fa565a 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; 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 ce92088d8fe7..0499fc38439a 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config @@ -4,7 +4,7 @@ - + @@ -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 a8b0fbada5a1..0f07fe77c3ac 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj @@ -47,9 +47,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -58,12 +58,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/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs index 22a67f9b9ed4..88ee168743e8 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; diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config index d4e8dbc49ceb..d7e30a6c84df 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config @@ -3,12 +3,12 @@ - + - + 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 40d1ef4d94b0..920e44a0a6ed 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj @@ -47,9 +47,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -72,12 +72,12 @@ ..\..\..\packages\Microsoft.Hadoop.Client.1.3.3.2\lib\net40\Microsoft.HDInsight.Net.Http.Formatting.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 ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CommandTests/HDInsightGetCommandTests.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CommandTests/HDInsightGetCommandTests.cs index ff0db4f6a304..7ececed759f1 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CommandTests/HDInsightGetCommandTests.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CommandTests/HDInsightGetCommandTests.cs @@ -18,7 +18,7 @@ using Microsoft.Hadoop.Client; 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.Test.HDInsight.CmdLetTests; using Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.Utilities; using Microsoft.WindowsAzure.Management.HDInsight; @@ -26,7 +26,7 @@ using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.ServiceLocation; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.HDInsight.CommandTests { @@ -104,7 +104,7 @@ public void CanGetSubscriptionsCertificateCredentialFromCurrentSubscription() var waSubscription = GetCurrentSubscription(); ProfileClient profileClient = new ProfileClient(); - var subscriptionCreds = getClustersCommand.GetSubscriptionCredentials(waSubscription, AzureSession.CurrentContext.Environment, profileClient.Profile); + var subscriptionCreds = getClustersCommand.GetSubscriptionCredentials(waSubscription, AzureSession.Profile.CurrentContext.Environment, profileClient.Profile); Assert.IsInstanceOfType(subscriptionCreds, typeof(HDInsightCertificateCredential)); var asCertificateCreds = subscriptionCreds as HDInsightCertificateCredential; @@ -135,7 +135,7 @@ public void CanGetAccessTokenCertificateCredentialFromCurrentSubscription() profileClient.Profile.Save(); waSubscription.Account = "test"; - var accessTokenCreds = getClustersCommand.GetSubscriptionCredentials(waSubscription, AzureSession.CurrentContext.Environment, profileClient.Profile); + var accessTokenCreds = getClustersCommand.GetSubscriptionCredentials(waSubscription, AzureSession.Profile.CurrentContext.Environment, profileClient.Profile); Assert.IsInstanceOfType(accessTokenCreds, typeof(HDInsightAccessTokenCredential)); var asAccessTokenCreds = accessTokenCreds as HDInsightAccessTokenCredential; Assert.AreEqual("abc", asAccessTokenCreds.AccessToken); @@ -152,7 +152,7 @@ public void CanGetJobSubmissionCertificateCredentialFromCurrentSubscription() var subscriptionCreds = getClustersCommand.GetJobSubmissionClientCredentials( waSubscription, - AzureSession.CurrentContext.Environment, + AzureSession.Profile.CurrentContext.Environment, IntegrationTestBase.TestCredentials.WellKnownCluster.DnsName, profileClient.Profile); @@ -186,7 +186,7 @@ public void CanGetJobSubmissionAccessTokenCredentialFromCurrentSubscription() profileClient.Profile.Save(); var accessTokenCreds = getClustersCommand.GetJobSubmissionClientCredentials( waSubscription, - AzureSession.CurrentContext.Environment, + AzureSession.Profile.CurrentContext.Environment, IntegrationTestBase.TestCredentials.WellKnownCluster.DnsName, profileClient.Profile); Assert.IsInstanceOfType(accessTokenCreds, typeof(HDInsightAccessTokenCredential)); @@ -209,7 +209,7 @@ public void CanGetBasicAuthCredentialFromCredentials() var profile = new AzureProfile(); var accessTokenCreds = getClustersCommand.GetJobSubmissionClientCredentials( waSubscription, - AzureSession.CurrentContext.Environment, + AzureSession.Profile.CurrentContext.Environment, IntegrationTestBase.TestCredentials.WellKnownCluster.DnsName, profile); Assert.IsInstanceOfType(accessTokenCreds, typeof(BasicAuthCredential)); var asBasicAuthCredentials = accessTokenCreds as BasicAuthCredential; diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulator.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulator.cs index be2be604af89..3880279875d3 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulator.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulator.cs @@ -17,11 +17,11 @@ using System.Linq; 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.Test.Utilities.HDInsight.Utilities; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.Simulators { @@ -32,7 +32,7 @@ internal class AzureHDInsightSubscriptionResolverSimulator : IAzureHDInsightSubs internal AzureHDInsightSubscriptionResolverSimulator() { var certificate = new X509Certificate2(Convert.FromBase64String(IntegrationTestBase.TestCredentials.Certificate), string.Empty); - ProfileClient.DataStore.AddCertificate(certificate); + AzureSession.DataStore.AddCertificate(certificate); ProfileClient profileClient = new ProfileClient(); profileClient.Profile.Accounts[certificate.Thumbprint] = new AzureAccount { diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulatorFactory.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulatorFactory.cs index a1c485b1486c..1e00b26d1dfa 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulatorFactory.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightSubscriptionResolverSimulatorFactory.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; namespace Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.Simulators diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Utilities/IntegrationTestBase.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Utilities/IntegrationTestBase.cs index 54edc408d01c..19edb8ec3c24 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Utilities/IntegrationTestBase.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Utilities/IntegrationTestBase.cs @@ -21,7 +21,7 @@ using System.Security.Cryptography.X509Certificates; 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.Test.Utilities.HDInsight.PowerShellTestAbstraction.Concretes; using Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.PowerShellTestAbstraction.Interfaces; @@ -35,7 +35,7 @@ using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.ServiceLocation; using Microsoft.WindowsAzure.Management.HDInsight.Framework.Core; using Microsoft.WindowsAzure.Management.HDInsight.Logging; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.Utilities { @@ -184,7 +184,7 @@ public void ApplyFullMocking() var cmdletManager = ServiceLocator.Instance.Locate(); cmdletManager.MockingLevel = ServiceLocationMockingLevel.ApplyFullMocking; AzureSession.AuthenticationFactory = new MockTokenAuthenticationFactory(); - ProfileClient.DataStore = new MockDataStore(); + AzureSession.DataStore = new MockDataStore(); } public void ApplyIndividualTestMockingOnly() diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config index 91d551eb0fa6..b3d9f74d6972 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/AzureHDInsightCmdlet.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/AzureHDInsightCmdlet.cs index b5df97274f09..03977c8d19cb 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/AzureHDInsightCmdlet.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/AzureHDInsightCmdlet.cs @@ -17,14 +17,14 @@ using System.Security.Cryptography.X509Certificates; using System.Text; 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.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.Extensions; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Logging; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.ServiceLocation; using Microsoft.WindowsAzure.Management.HDInsight.Logging; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets { @@ -125,7 +125,7 @@ protected AzureSubscription GetCurrentSubscription(string Subscription, X509Cert var resolvedSubscription = subscriptionResolver.ResolveSubscription(Subscription); if (certificate.IsNotNull() && resolvedSubscription.Account != certificate.Thumbprint) { - ProfileClient.DataStore.AddCertificate(certificate); + AzureSession.DataStore.AddCertificate(certificate); } if (resolvedSubscription.IsNull()) diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj b/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj index 786ed2f06e50..d470ca4dec13 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj @@ -55,9 +55,9 @@ False ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll False @@ -82,12 +82,12 @@ ..\..\..\packages\Microsoft.Hadoop.Client.1.3.3.2\lib\net40\Microsoft.HDInsight.Net.Http.Formatting.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 ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/AddAzureHDInsightStorageCommand.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/AddAzureHDInsightStorageCommand.cs index 337e4d49d2a5..dee33062ee7a 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/AddAzureHDInsightStorageCommand.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/AddAzureHDInsightStorageCommand.cs @@ -16,7 +16,7 @@ using System.Collections.ObjectModel; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.CommandInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects; diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/UseAzureHDInsightClusterCommand.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/UseAzureHDInsightClusterCommand.cs index 8c7a3bd75978..c096c35db2be 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/UseAzureHDInsightClusterCommand.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/Commands/CommandImplementations/UseAzureHDInsightClusterCommand.cs @@ -20,7 +20,7 @@ using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.Extensions; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.CommandImplementations { diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightClusterCommandBase.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightClusterCommandBase.cs index a037f725e205..33e05260a2e6 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightClusterCommandBase.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightClusterCommandBase.cs @@ -17,7 +17,7 @@ using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.Extensions; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.ServiceLocation; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters { diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandBase.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandBase.cs index dee236bc6b37..1bad186c3b06 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandBase.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandBase.cs @@ -16,7 +16,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Framework.Core; using Microsoft.WindowsAzure.Management.HDInsight.Logging; diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandExtensions.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandExtensions.cs index c19a310bf8f2..6c07c4f171ff 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandExtensions.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightCommandExtensions.cs @@ -12,18 +12,15 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using System; -using System.Linq; -using System.Reflection; +using Microsoft.Azure.Common.Authentication; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.Hadoop.Client; -using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.CommandImplementations; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.Extensions; +using System; using System.Diagnostics; -using Microsoft.Azure.Common.Extensions.Authentication; -using Microsoft.Azure.Common.Extensions; +using System.Reflection; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters { @@ -60,7 +57,7 @@ public static IHDInsightSubscriptionCredentials GetSubscriptionCertificateCreden return new HDInsightCertificateCredential { SubscriptionId = currentSubscription.Id, - Certificate = ProfileClient.DataStore.GetCertificate(currentSubscription.Account), + Certificate = AzureSession.DataStore.GetCertificate(currentSubscription.Account), Endpoint = environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement), }; } @@ -69,12 +66,7 @@ public static IHDInsightSubscriptionCredentials GetAccessTokenCredentials(this I AzureSubscription currentSubscription, AzureAccount azureAccount, AzureEnvironment environment) { ProfileClient profileClient = new ProfileClient(); - AzureContext azureContext = new AzureContext - { - Subscription = currentSubscription, - Environment = environment, - Account = azureAccount - }; + AzureContext azureContext = new AzureContext(currentSubscription, azureAccount, environment); var cloudCredentials = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(azureContext) as AccessTokenCredential; if (cloudCredentials != null) diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightJobCommandExecutorBase.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightJobCommandExecutorBase.cs index 7d4f1c814611..809781906fd6 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightJobCommandExecutorBase.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightJobCommandExecutorBase.cs @@ -18,11 +18,11 @@ using System.Threading; using Microsoft.Hadoop.Client; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.Extensions; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.ServiceLocation; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters { diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolver.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolver.cs index e2630298b462..79321a6ecdef 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolver.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolver.cs @@ -14,7 +14,7 @@ using System; using System.Linq; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.Extensions; diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolverFactory.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolverFactory.cs index dda48854ea49..def460cba056 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolverFactory.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/AzureHDInsightSubscriptionResolverFactory.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightCommandBase.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightCommandBase.cs index 1aa735f604de..7b12055982fe 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightCommandBase.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightCommandBase.cs @@ -14,7 +14,7 @@ using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters { diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolver.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolver.cs index 7a9c3aed34cc..661b4edd8940 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolver.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolver.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces { diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolverFactory.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolverFactory.cs index 785b11d32e51..ce4baf284f24 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolverFactory.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/BaseInterfaces/IAzureHDInsightSubscriptionResolverFactory.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; namespace Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.BaseInterfaces { diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/IInvokeAzureHDInsightJobCommand.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/IInvokeAzureHDInsightJobCommand.cs index 56a779457f8b..0060f31435cc 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/IInvokeAzureHDInsightJobCommand.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/IInvokeAzureHDInsightJobCommand.cs @@ -15,7 +15,7 @@ using System.Collections.ObjectModel; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects; using Microsoft.WindowsAzure.Management.HDInsight.Logging; diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/InvokeAzureHDInsightJobCommandBase.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/InvokeAzureHDInsightJobCommandBase.cs index e0928f28f103..2edb165cc22c 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/InvokeAzureHDInsightJobCommandBase.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Model/GetAzureHDInsightClusters/InvokeAzureHDInsightJobCommandBase.cs @@ -21,7 +21,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Hadoop.Client; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.BaseCommandInterfaces; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.DataObjects; using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.GetAzureHDInsightClusters.Extensions; diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config b/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config index a59c5846574c..1dd848347762 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj index fd297a903b9c..8d5749f2fb4a 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj @@ -44,9 +44,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.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/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/ScenarioTests/ManagedCacheTestsBase.cs b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/ScenarioTests/ManagedCacheTestsBase.cs index ddeb5726923a..0e6f3d151d71 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/ScenarioTests/ManagedCacheTestsBase.cs +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/ScenarioTests/ManagedCacheTestsBase.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.Azure.Management.ManagedCache; using Microsoft.Azure.Test; using Microsoft.WindowsAzure.Commands.ScenarioTest; diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config index 7c4ab8c1b5b2..38d77db6957d 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj index 4625783942d3..5806884b347b 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj @@ -47,9 +47,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -67,12 +67,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/ManagedCache/Commands.ManagedCache/PSCacheClient.cs b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/PSCacheClient.cs index 643845b11c17..529c0ee06ed1 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/PSCacheClient.cs +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/PSCacheClient.cs @@ -24,9 +24,9 @@ using Microsoft.Azure.Management.ManagedCache.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 Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Hyak.Common; namespace Microsoft.Azure.Commands.ManagedCache diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config index ec5fcb331cb6..d1e033e143a2 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj b/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj index d15343e5befa..47aa3e434586 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj +++ b/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj @@ -44,9 +44,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.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/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkSecurityGroup/NSGScenarioTests.cs b/src/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkSecurityGroup/NSGScenarioTests.cs index e7575498cded..47bdc2d33c64 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkSecurityGroup/NSGScenarioTests.cs +++ b/src/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkSecurityGroup/NSGScenarioTests.cs @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.Network.Test.ScenarioTests using Microsoft.WindowsAzure.Commands.Utilities.Common; using Xunit; using Microsoft.WindowsAzure.Management; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; using Microsoft.Azure.Test; public class NSGScenarioTests diff --git a/src/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkTestsBase.cs b/src/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkTestsBase.cs index 0088e69a4bcc..b265fcd800fb 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkTestsBase.cs +++ b/src/ServiceManagement/Network/Commands.Network.Test/ScenarioTests/NetworkTestsBase.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Commands.Network.Test.ScenarioTests { - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; using WindowsAzure.Management.Network; public abstract class NetworkTestsBase diff --git a/src/ServiceManagement/Network/Commands.Network.Test/packages.config b/src/ServiceManagement/Network/Commands.Network.Test/packages.config index 1f76bac24a52..eeffae9b988a 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/packages.config +++ b/src/ServiceManagement/Network/Commands.Network.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj b/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj index 14dbfcbac985..892e5a9a1c2d 100644 --- a/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj +++ b/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj @@ -55,9 +55,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -66,12 +66,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 ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs b/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs index 4bcec69567c9..fa4685cb98c4 100644 --- a/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs +++ b/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs @@ -12,7 +12,6 @@ // limitations under the License. // ---------------------------------------------------------------------------------- - namespace Microsoft.Azure.Commands.Network { using System; @@ -31,8 +30,8 @@ namespace Microsoft.Azure.Commands.Network using WindowsAzure.Management.Network; using WindowsAzure.Management.Network.Models; using WindowsAzure.Storage.Auth; - 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; public class NetworkClient diff --git a/src/ServiceManagement/Network/Commands.Network/NetworkCmdletBase.cs b/src/ServiceManagement/Network/Commands.Network/NetworkCmdletBase.cs index 87c8b563ba2c..24fc41a9e61f 100644 --- a/src/ServiceManagement/Network/Commands.Network/NetworkCmdletBase.cs +++ b/src/ServiceManagement/Network/Commands.Network/NetworkCmdletBase.cs @@ -14,8 +14,8 @@ namespace Microsoft.Azure.Commands.Network { - using Microsoft.Azure.Common.Extensions; - using Microsoft.Azure.Common.Extensions.Models; + using Microsoft.Azure.Common.Authentication; + using Microsoft.Azure.Common.Authentication.Models; using WindowsAzure.Commands.Common; using WindowsAzure.Commands.Utilities.Common; using WindowsAzure.Commands.Utilities.Profile; @@ -29,7 +29,7 @@ public abstract class NetworkCmdletBase : AzurePSCmdlet protected AzureSubscription CurrentSubscription { - get { return AzureSession.CurrentContext.Subscription; } + get { return AzureSession.Profile.CurrentContext.Subscription; } } protected NetworkClient Client diff --git a/src/ServiceManagement/Network/Commands.Network/packages.config b/src/ServiceManagement/Network/Commands.Network/packages.config index 71d16b28ebd6..06e3b78b2869 100644 --- a/src/ServiceManagement/Network/Commands.Network/packages.config +++ b/src/ServiceManagement/Network/Commands.Network/packages.config @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj index 5cdf2dbce9cd..d428a87c3d70 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj @@ -42,9 +42,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -58,13 +58,13 @@ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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 ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/ScenarioTests/RecoveryServicesTestsBase.cs b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/ScenarioTests/RecoveryServicesTestsBase.cs index bc43a76c1343..a3cc139e2ef3 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/ScenarioTests/RecoveryServicesTestsBase.cs +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/ScenarioTests/RecoveryServicesTestsBase.cs @@ -27,8 +27,8 @@ using Microsoft.WindowsAzure.Management.SiteRecovery; using Microsoft.Azure.Test; 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.RecoveryServices.Test.ScenarioTests { @@ -134,7 +134,7 @@ private SiteRecoveryManagementClient GetSiteRecoveryManagementClient() asrVaultCreds.CloudServiceName, asrVaultCreds.ResourceName, (SubscriptionCloudCredentials)environment.Credentials, - AzureSession.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement)).WithHandler(HttpMockServer.CreateInstance()); + AzureSession.Profile.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement)).WithHandler(HttpMockServer.CreateInstance()); } private static bool IgnoreCertificateErrorHandler diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config index 5fadfe479b3c..d7fb750ac29e 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj index ca94ee3d9d82..f424fc40a9a0 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj @@ -49,9 +49,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -60,12 +60,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/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesClient.cs b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesClient.cs index 1e30a45dd38f..ea4845e69b5b 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesClient.cs +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesClient.cs @@ -26,14 +26,14 @@ using Microsoft.Azure.Portal.RecoveryServices.Models.Common; 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 Microsoft.WindowsAzure.Management.RecoveryServices; using Microsoft.WindowsAzure.Management.RecoveryServices.Models; using Microsoft.WindowsAzure.Management.SiteRecovery; using Microsoft.WindowsAzure.Management.SiteRecovery.Models; -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.RecoveryServices { @@ -240,7 +240,7 @@ private SiteRecoveryManagementClient GetSiteRecoveryClient() } SiteRecoveryManagementClient siteRecoveryClient = - AzureSession.ClientFactory.CreateCustomClient(asrVaultCreds.CloudServiceName, asrVaultCreds.ResourceName, recoveryServicesClient.Credentials, AzureSession.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement)); + AzureSession.ClientFactory.CreateCustomClient(asrVaultCreds.CloudServiceName, asrVaultCreds.ResourceName, recoveryServicesClient.Credentials, AzureSession.Profile.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement)); if (null == siteRecoveryClient) { diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/CreateAzureSiteRecoveryRecoveryPlan.cs b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/CreateAzureSiteRecoveryRecoveryPlan.cs index 78d95a792f0f..fd69d98d3b09 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/CreateAzureSiteRecoveryRecoveryPlan.cs +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/CreateAzureSiteRecoveryRecoveryPlan.cs @@ -20,7 +20,7 @@ using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Management.SiteRecovery.Models; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.Azure.Commands.RecoveryServices { diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config index ba43e8748074..3044a5fc902d 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config @@ -3,13 +3,13 @@ - + - + diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj b/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj index a309a0d3fc5c..333371ed1709 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj @@ -48,9 +48,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -58,12 +58,12 @@ ..\..\..\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/Services/Commands.Test.Utilities/Common/AzureAssert.cs b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/AzureAssert.cs index b7450a09710d..6668883aee64 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Common/AzureAssert.cs +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/AzureAssert.cs @@ -26,7 +26,7 @@ namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common { using ConfigConfigurationSetting = Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema.ConfigurationSetting; using DefinitionConfigurationSetting = Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema.ConfigurationSetting; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; public static class AzureAssert { diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessToken.cs b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessToken.cs index 242371ecf20d..d34b9e36618e 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessToken.cs +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessToken.cs @@ -13,7 +13,7 @@ // ---------------------------------------------------------------------------------- using System; -using Microsoft.Azure.Common.Extensions.Authentication; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common { diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessTokenProvider.cs b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessTokenProvider.cs index f240e0c9bc32..db0a877cbc00 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessTokenProvider.cs +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FakeAccessTokenProvider.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/ServiceManagement/Services/Commands.Test.Utilities/Common/FileSystemHelper.cs b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FileSystemHelper.cs index 6dba8bed3435..d32c31ca8918 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FileSystemHelper.cs +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Common/FileSystemHelper.cs @@ -18,7 +18,7 @@ using Microsoft.WindowsAzure.Commands.Common; using Microsoft.WindowsAzure.Commands.Utilities.CloudService; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common { @@ -288,7 +288,7 @@ public string CreateAzureSdkDirectoryAndImportPublishSettings(string publishSett AzureSdkPath = CreateDirectory("AzureSdk"); ProfileClient client = new ProfileClient(); - ProfileClient.DataStore.WriteFile(publishSettingsPath, File.ReadAllText(publishSettingsPath)); + AzureSession.DataStore.WriteFile(publishSettingsPath, File.ReadAllText(publishSettingsPath)); client.ImportPublishSettings(publishSettingsPath, null); client.Profile.Save(); diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config index 8a8c7e1996ed..c79f3c3dea8e 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config @@ -3,12 +3,12 @@ - + - + diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/DisableAzureRemoteDesktopCommandTest.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/DisableAzureRemoteDesktopCommandTest.cs index f936935a51b8..1ef8e8cf4290 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/DisableAzureRemoteDesktopCommandTest.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/DisableAzureRemoteDesktopCommandTest.cs @@ -23,7 +23,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema; using Microsoft.WindowsAzure.Commands.Common; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Development { diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureMemcacheRoleTests.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureMemcacheRoleTests.cs index 3c2c0d037247..7044b646a30d 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureMemcacheRoleTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureMemcacheRoleTests.cs @@ -34,7 +34,7 @@ namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Development.Tests using ConfigConfigurationSetting = Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema.ConfigurationSetting; using DefinitionConfigurationSetting = Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema.ConfigurationSetting; using TestResources = Commands.Common.Test.Properties.Resources; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; public class EnableAzureMemcacheRoleTests : TestBase { diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureRemoteDesktopCommandTest.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureRemoteDesktopCommandTest.cs index 8f4463b5a538..38f5437240a3 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureRemoteDesktopCommandTest.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/EnableAzureRemoteDesktopCommandTest.cs @@ -26,7 +26,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; using Microsoft.WindowsAzure.Commands.Common; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Development { diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/SaveAzureServiceProjectPackageTests.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/SaveAzureServiceProjectPackageTests.cs index ead84c2be6ca..a8eb88a325a9 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Development/SaveAzureServiceProjectPackageTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Development/SaveAzureServiceProjectPackageTests.cs @@ -24,7 +24,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Microsoft.WindowsAzure.Commands.Common; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Development { diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/AzureServiceTests.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/AzureServiceTests.cs index 40c618e12f2a..69aa3b1086e2 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/AzureServiceTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/AzureServiceTests.cs @@ -26,7 +26,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Utilities { diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/CloudServiceClientTests.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/CloudServiceClientTests.cs index 810686336dbe..62fbf8a43d74 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/CloudServiceClientTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/CloudServiceClientTests.cs @@ -18,7 +18,7 @@ using System.Net; using System.Threading; using Xunit; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Common.Test.Mocks; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.CloudService; @@ -31,7 +31,7 @@ using Moq; using MockStorageService = Microsoft.WindowsAzure.Commands.Test.Utilities.Common.MockStorageService; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.Azure; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Utilities diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/GeneralTests.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/GeneralTests.cs index 67b990cbd864..811237bfe714 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/GeneralTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/GeneralTests.cs @@ -18,7 +18,7 @@ using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Utilities { diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/PublishContextTests.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/PublishContextTests.cs index cc4939661291..20f6237ed84b 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/PublishContextTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/PublishContextTests.cs @@ -23,7 +23,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.CloudService; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Properties; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Utilities { @@ -51,9 +51,9 @@ public PublishContextTests() packagePath = service.Paths.CloudPackage; configPath = service.Paths.CloudConfiguration; settings = ServiceSettingsTestData.Instance.Data[ServiceSettingsState.Default]; - ProfileClient.DataStore = new MockDataStore(); + AzureSession.DataStore = new MockDataStore(); ProfileClient client = new ProfileClient(); - ProfileClient.DataStore.WriteFile(Test.Utilities.Common.Data.ValidPublishSettings.First(), + AzureSession.DataStore.WriteFile(Test.Utilities.Common.Data.ValidPublishSettings.First(), File.ReadAllText(Test.Utilities.Common.Data.ValidPublishSettings.First())); client.ImportPublishSettings(Test.Utilities.Common.Data.ValidPublishSettings.First(), null); client.Profile.Save(); @@ -61,7 +61,7 @@ public PublishContextTests() public void TestCleanup() { - ProfileClient.DataStore = new MockDataStore(); + AzureSession.DataStore = new MockDataStore(); if (Directory.Exists(Test.Utilities.Common.Data.AzureSdkAppDir)) { new RemoveAzurePublishSettingsCommand().RemovePublishSettingsProcess(Test.Utilities.Common.Data.AzureSdkAppDir); diff --git a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/ScaffoldTests.cs b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/ScaffoldTests.cs index 3114798e5b92..8bd4d124091a 100644 --- a/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/ScaffoldTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/CloudService/Utilities/ScaffoldTests.cs @@ -17,7 +17,7 @@ using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.CloudService.Scaffolding; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.CloudService.Utilities { diff --git a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj index 6c0ceb9f26fe..2048fc3cd555 100644 --- a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj +++ b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj @@ -53,9 +53,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -72,12 +72,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 ..\..\..\packages\WindowsAzure.ServiceBus.2.3.2.0\lib\net40-full\Microsoft.ServiceBus.dll diff --git a/src/ServiceManagement/Services/Commands.Test/Environment/AddAzureEnvironmentTests.cs b/src/ServiceManagement/Services/Commands.Test/Environment/AddAzureEnvironmentTests.cs index dbae4495621c..14af98bff360 100644 --- a/src/ServiceManagement/Services/Commands.Test/Environment/AddAzureEnvironmentTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Environment/AddAzureEnvironmentTests.cs @@ -16,14 +16,14 @@ using System.Management.Automation; using System.Reflection; 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.Profile; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Moq; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Environment { @@ -34,12 +34,12 @@ public class AddAzureEnvironmentTests : TestBase, IDisposable public AddAzureEnvironmentTests() { dataStore = new MockDataStore(); - ProfileClient.DataStore = dataStore; + AzureSession.DataStore = dataStore; } public void Cleanup() { - AzureSession.SetCurrentContext(null, null, null); + AzureSession.Profile = new AzureProfile(); } [Fact] diff --git a/src/ServiceManagement/Services/Commands.Test/Environment/GetAzureEnvironmentTests.cs b/src/ServiceManagement/Services/Commands.Test/Environment/GetAzureEnvironmentTests.cs index 0382d1202d30..6d0f00e67b2d 100644 --- a/src/ServiceManagement/Services/Commands.Test/Environment/GetAzureEnvironmentTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Environment/GetAzureEnvironmentTests.cs @@ -15,14 +15,14 @@ using System.Collections.Generic; 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.Test.Mocks; using Microsoft.WindowsAzure.Commands.Profile; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Moq; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Environment { @@ -33,7 +33,7 @@ public class GetAzureEnvironmentTests : TestBase public GetAzureEnvironmentTests() { dataStore = new MockDataStore(); - ProfileClient.DataStore = dataStore; + AzureSession.DataStore = dataStore; } [Fact] diff --git a/src/ServiceManagement/Services/Commands.Test/Environment/RemoveAzureEnvironmentTests.cs b/src/ServiceManagement/Services/Commands.Test/Environment/RemoveAzureEnvironmentTests.cs index ad1085a6af8f..96a134e2fdf9 100644 --- a/src/ServiceManagement/Services/Commands.Test/Environment/RemoveAzureEnvironmentTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Environment/RemoveAzureEnvironmentTests.cs @@ -16,14 +16,14 @@ using System.Collections.Generic; 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.Test.Mocks; using Microsoft.WindowsAzure.Commands.Profile; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Moq; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Environment { @@ -34,12 +34,12 @@ public class RemoveAzureEnvironmentTests : TestBase, IDisposable public RemoveAzureEnvironmentTests() { dataStore = new MockDataStore(); - ProfileClient.DataStore = dataStore; + AzureSession.DataStore = dataStore; } public void Cleanup() { - AzureSession.SetCurrentContext(null, null, null); + AzureSession.Profile = new AzureProfile(); } [Fact] diff --git a/src/ServiceManagement/Services/Commands.Test/Environment/SetAzureEnvironmentTests.cs b/src/ServiceManagement/Services/Commands.Test/Environment/SetAzureEnvironmentTests.cs index 25587ec8616b..c5d662e0762d 100644 --- a/src/ServiceManagement/Services/Commands.Test/Environment/SetAzureEnvironmentTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Environment/SetAzureEnvironmentTests.cs @@ -18,13 +18,13 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common; using Xunit; 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.Profile; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Environment { @@ -36,12 +36,12 @@ public class SetAzureEnvironmentTests : TestBase, IDisposable public SetAzureEnvironmentTests() { dataStore = new MockDataStore(); - ProfileClient.DataStore = dataStore; + AzureSession.DataStore = dataStore; } public void Cleanup() { - AzureSession.SetCurrentContext(null, null, null); + AzureSession.Profile = new AzureProfile(); } [Fact] diff --git a/src/ServiceManagement/Services/Commands.Test/MediaServices/GetAzureMediaServicesTests.cs b/src/ServiceManagement/Services/Commands.Test/MediaServices/GetAzureMediaServicesTests.cs index dd00777e74fb..6053bf428236 100644 --- a/src/ServiceManagement/Services/Commands.Test/MediaServices/GetAzureMediaServicesTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/MediaServices/GetAzureMediaServicesTests.cs @@ -17,7 +17,7 @@ using System.Threading.Tasks; using Xunit; 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.MediaServices; using Microsoft.WindowsAzure.Commands.ServiceManagement.Model; @@ -26,7 +26,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.MediaServices.Services.Entities; using Microsoft.WindowsAzure.Management.MediaServices.Models; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.MediaServices { @@ -71,7 +71,10 @@ public void ProcessGetMediaServicesTest() MediaServicesClient = clientMock.Object, }; - AzureSession.SetCurrentContext(new AzureSubscription {Id = new Guid(SubscriptionId)}, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(SubscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(SubscriptionId)] = subscription; getAzureMediaServiceCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureMediaServiceCommand.CommandRuntime).OutputPipeline.Count); @@ -104,7 +107,10 @@ public void ProcessGetMediaServiceByNameShouldReturnOneMatchingEntry() MediaServicesClient = clientMock.Object, Name = expectedName }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(SubscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(SubscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(SubscriptionId)] = subscription; getAzureMediaServiceCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureMediaServiceCommand.CommandRuntime).OutputPipeline.Count); MediaServiceAccountDetails accounts = (MediaServiceAccountDetails)((MockCommandRuntime)getAzureMediaServiceCommand.CommandRuntime).OutputPipeline.FirstOrDefault(); @@ -142,7 +148,10 @@ public void ProcessGetMediaServiceByNameShouldNotReturnEntriesForNoneMatchingNam Name = mediaServicesAccountName }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(SubscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(SubscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(SubscriptionId)] = subscription; Assert.Throws(()=> getAzureMediaServiceCommand.ExecuteCmdlet()); Assert.Equal(0, ((MockCommandRuntime)getAzureMediaServiceCommand.CommandRuntime).OutputPipeline.Count); } diff --git a/src/ServiceManagement/Services/Commands.Test/MediaServices/MediaServicesClientTests.cs b/src/ServiceManagement/Services/Commands.Test/MediaServices/MediaServicesClientTests.cs index 310141cc26b9..a72148ea7740 100644 --- a/src/ServiceManagement/Services/Commands.Test/MediaServices/MediaServicesClientTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/MediaServices/MediaServicesClientTests.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Xunit; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Utilities.MediaServices; using Microsoft.WindowsAzure.Management.MediaServices; using Microsoft.WindowsAzure.Management.MediaServices.Models; diff --git a/src/ServiceManagement/Services/Commands.Test/Profile/GetAzurePublishSettingsFileTests.cs b/src/ServiceManagement/Services/Commands.Test/Profile/GetAzurePublishSettingsFileTests.cs index a053082992b8..b865f0b63a0c 100644 --- a/src/ServiceManagement/Services/Commands.Test/Profile/GetAzurePublishSettingsFileTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Profile/GetAzurePublishSettingsFileTests.cs @@ -19,8 +19,8 @@ using Microsoft.WindowsAzure.Commands.Profile; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Moq; -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.Test.Profile { @@ -31,7 +31,7 @@ public class GetAzurePublishSettingsFileTests public void GetsPublishSettingsFileUrl() { // Setup - ProfileClient.DataStore = new MockDataStore(); + AzureSession.DataStore = new MockDataStore(); Mock commandRuntimeMock = new Mock(); GetAzurePublishSettingsFileCommand cmdlet = new GetAzurePublishSettingsFileCommand() { diff --git a/src/ServiceManagement/Services/Commands.Test/ServiceBus/GetAzureSBNamespaceTest.cs b/src/ServiceManagement/Services/Commands.Test/ServiceBus/GetAzureSBNamespaceTest.cs index d1c170b9786b..d3f3bbabc671 100644 --- a/src/ServiceManagement/Services/Commands.Test/ServiceBus/GetAzureSBNamespaceTest.cs +++ b/src/ServiceManagement/Services/Commands.Test/ServiceBus/GetAzureSBNamespaceTest.cs @@ -22,7 +22,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Microsoft.WindowsAzure.Commands.Utilities.ServiceBus; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.ServiceBus { diff --git a/src/ServiceManagement/Services/Commands.Test/WAPackIaaS/WebClient/GetAbsoluteUriTests.cs b/src/ServiceManagement/Services/Commands.Test/WAPackIaaS/WebClient/GetAbsoluteUriTests.cs index 9600f704a96c..6242c66b3b48 100644 --- a/src/ServiceManagement/Services/Commands.Test/WAPackIaaS/WebClient/GetAbsoluteUriTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/WAPackIaaS/WebClient/GetAbsoluteUriTests.cs @@ -15,7 +15,7 @@ using System; using System.Text; using Xunit; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Utilities.WAPackIaaS.WebClient; namespace Microsoft.WindowsAzure.Commands.Test.WAPackIaaS.WebClient diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/DisableAzureWebsiteDiagnosticTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/DisableAzureWebsiteDiagnosticTests.cs index 765191222d13..5a690dbb913b 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/DisableAzureWebsiteDiagnosticTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/DisableAzureWebsiteDiagnosticTests.cs @@ -14,13 +14,14 @@ 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Websites; using Moq; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; +using System; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -56,7 +57,10 @@ public void DisableAzureWebsiteApplicationDiagnosticApplication() File = true, }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test disableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -85,7 +89,10 @@ public void DisableAzureWebsiteApplicationDiagnosticApplicationTableLog() TableStorage = true }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test disableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -114,7 +121,10 @@ public void DisableAzureWebsiteApplicationDiagnosticApplicationBlobLog() BlobStorage = true }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test disableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -145,7 +155,10 @@ public void DisablesApplicationDiagnosticOnSlot() Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test disableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/EnableAzureWebsiteDiagnosticTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/EnableAzureWebsiteDiagnosticTests.cs index 18fa8a81eb9d..a3d46cf0b365 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/EnableAzureWebsiteDiagnosticTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/EnableAzureWebsiteDiagnosticTests.cs @@ -15,14 +15,15 @@ using System.Collections.Generic; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.DeploymentEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; using Xunit; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; +using System; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -64,7 +65,10 @@ public void EnableAzureWebsiteApplicationDiagnosticApplication() LogLevel = LogEntryType.Information }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test enableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -102,7 +106,10 @@ public void EnableAzureWebsiteApplicationDiagnosticApplicationTableLog() StorageTableName = tableName }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test enableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -139,8 +146,11 @@ public void EnableAzureWebsiteApplicationDiagnosticApplicationTableLogUseCurrent StorageTableName = tableName }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); - AzureSession.CurrentContext.Subscription.Properties[AzureSubscription.Property.StorageAccount] = storageName; + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; + AzureSession.Profile.CurrentContext.Subscription.Properties[AzureSubscription.Property.StorageAccount] = storageName; // Test enableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -178,7 +188,10 @@ public void EnableAzureWebsiteApplicationDiagnosticApplicationBlobLog() StorageBlobContainerName = blobContainerName }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test enableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -215,8 +228,11 @@ public void EnableAzureWebsiteApplicationDiagnosticApplicationBlobLogUseCurrentS StorageBlobContainerName = blobContainerName }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); - AzureSession.CurrentContext.Subscription.Properties[AzureSubscription.Property.StorageAccount] = storageName; + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; + AzureSession.Profile.CurrentContext.Subscription.Properties[AzureSubscription.Property.StorageAccount] = storageName; // Test enableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); @@ -251,7 +267,10 @@ public void EnableApplicationDiagnosticOnSlot() Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new System.Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Test enableAzureWebsiteApplicationDiagnosticCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs index 97b27ddd563d..7af06a2a5cd5 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteMetricsTests.cs @@ -17,14 +17,14 @@ using System.Linq; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -66,7 +66,10 @@ public void GetWebsiteMetricsBasicTest() CommandRuntime = new MockCommandRuntime(), WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; command.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)command.CommandRuntime).OutputPipeline.Count); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteTests.cs index 466f519b4e57..165274dda7f9 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebSiteTests.cs @@ -17,7 +17,7 @@ using System.Linq; using Xunit; 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.Common.Test.Mocks; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; @@ -26,7 +26,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -56,7 +56,10 @@ public void ProcessGetWebsiteTest() CommandRuntime = new MockCommandRuntime(), WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; getAzureWebsiteCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline.Count); @@ -97,7 +100,10 @@ public void GetWebsiteProcessShowTest() Name = "website1", WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; getAzureWebsiteCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline.Count); @@ -115,7 +121,10 @@ public void GetWebsiteProcessShowTest() Name = "WEBSiTe1", WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; getAzureWebsiteCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline.Count); @@ -135,10 +144,10 @@ public void ProcessGetWebsiteWithNullSubscription() { CommandRuntime = new MockCommandRuntime() }; - AzureSession.SetCurrentContext(null, null, null); + AzureSession.Profile = new AzureProfile(); - Testing.AssertThrows(getAzureWebsiteCommand.ExecuteCmdlet, Resources.InvalidCurrentSubscription); + Testing.AssertThrows(getAzureWebsiteCommand.ExecuteCmdlet, Resources.InvalidDefaultSubscription); } [Fact] @@ -165,7 +174,10 @@ public void TestGetAzureWebsiteWithDiagnosticsSettings() WebsitesClient = websitesClientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; // Test getAzureWebsiteCommand.ExecuteCmdlet(); @@ -207,7 +219,10 @@ public void GetsWebsiteSlot() WebsitesClient = clientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; getAzureWebsiteCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline.Count); @@ -249,7 +264,10 @@ public void GetsSlots() WebsitesClient = clientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; getAzureWebsiteCommand.ExecuteCmdlet(); IEnumerable sites = ((MockCommandRuntime)getAzureWebsiteCommand.CommandRuntime).OutputPipeline[0] as IEnumerable; diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebsiteDeploymentTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebsiteDeploymentTests.cs index 148fa84cd857..cb40e8630aaa 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebsiteDeploymentTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/GetAzureWebsiteDeploymentTests.cs @@ -17,7 +17,7 @@ using System.Linq; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; @@ -25,7 +25,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -74,7 +74,10 @@ public void GetAzureWebsiteDeploymentTest() WebsitesClient = clientMock.Object, CommandRuntime = new MockCommandRuntime(), }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; getAzureWebsiteDeploymentCommand.ExecuteCmdlet(); @@ -129,7 +132,10 @@ public void GetAzureWebsiteDeploymentLogsTest() Details = true, CommandRuntime = new MockCommandRuntime(), }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; getAzureWebsiteDeploymentCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureWebsiteDeploymentCommand.CommandRuntime).OutputPipeline.Count); @@ -183,7 +189,10 @@ public void GetsDeploymentForSlot() CommandRuntime = new MockCommandRuntime(), Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; getAzureWebsiteDeploymentCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)getAzureWebsiteDeploymentCommand.CommandRuntime).OutputPipeline.Count); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/NewAzureWebSiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/NewAzureWebSiteTests.cs index 2670efa213db..603e7a490a1d 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/NewAzureWebSiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/NewAzureWebSiteTests.cs @@ -15,7 +15,7 @@ using System; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; @@ -23,7 +23,7 @@ using Microsoft.WindowsAzure.Commands.Websites; using Microsoft.WindowsAzure.Management.WebSites.Models; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -73,7 +73,10 @@ public void ProcessNewWebsiteTest() Location = webspaceName, WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; newAzureWebsiteCommand.ExecuteCmdlet(); Assert.Equal(websiteName, createdSiteName); @@ -119,7 +122,10 @@ public void GetsWebsiteDefaultLocation() Name = websiteName, WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; newAzureWebsiteCommand.ExecuteCmdlet(); Assert.True(created); @@ -163,7 +169,10 @@ public void CreateStageSlot() WebsitesClient = clientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; newAzureWebsiteCommand.ExecuteCmdlet(); clientMock.Verify(c => c.CreateWebsite(webspaceName, It.IsAny(), slot), Times.Once()); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/RemoveAzureWebSiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/RemoveAzureWebSiteTests.cs index 7d92d34adc01..fa892d27f5d1 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/RemoveAzureWebSiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/RemoveAzureWebSiteTests.cs @@ -15,14 +15,14 @@ using System; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -48,8 +48,12 @@ public void ProcessRemoveWebsiteTest() Name = "website1", Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; + // Delete existing website removeAzureWebsiteCommand.ExecuteCmdlet(); mockClient.Verify(c => c.DeleteWebsite("webspace1", "website1", slot), Times.Once()); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/RestartAzureWebsiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/RestartAzureWebsiteTests.cs index e952048e6e09..35e84a6b6d22 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/RestartAzureWebsiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/RestartAzureWebsiteTests.cs @@ -15,13 +15,13 @@ using System; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -43,7 +43,11 @@ public void ProcessRestartWebsiteTest() Name = websiteName, WebsitesClient = websitesClientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; restartAzureWebsiteCommand.ExecuteCmdlet(); @@ -68,7 +72,10 @@ public void RestartsWebsiteSlot() WebsitesClient = websitesClientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; restartAzureWebsiteCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/RestoreAzureWebsiteDeploymentTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/RestoreAzureWebsiteDeploymentTests.cs index 114c851d2b8f..1531b5189550 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/RestoreAzureWebsiteDeploymentTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/RestoreAzureWebsiteDeploymentTests.cs @@ -17,7 +17,7 @@ using System.Linq; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; @@ -25,7 +25,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -85,7 +85,10 @@ public void RestoreAzureWebsiteDeploymentTest() WebsitesClient = clientMock.Object, CommandRuntime = new MockCommandRuntime(), }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; restoreAzureWebsiteDeploymentCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime) restoreAzureWebsiteDeploymentCommand.CommandRuntime).OutputPipeline.Count); @@ -104,7 +107,10 @@ public void RestoreAzureWebsiteDeploymentTest() WebsitesClient = clientMock.Object, CommandRuntime = new MockCommandRuntime(), }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; restoreAzureWebsiteDeploymentCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)restoreAzureWebsiteDeploymentCommand.CommandRuntime).OutputPipeline.Count); @@ -170,7 +176,10 @@ public void RestoresDeploymentForSlot() CommandRuntime = new MockCommandRuntime(), Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; restoreAzureWebsiteDeploymentCommand.ExecuteCmdlet(); @@ -191,7 +200,10 @@ public void RestoresDeploymentForSlot() CommandRuntime = new MockCommandRuntime(), Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; restoreAzureWebsiteDeploymentCommand.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)restoreAzureWebsiteDeploymentCommand.CommandRuntime).OutputPipeline.Count); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/SaveAzureWebsiteLogTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/SaveAzureWebsiteLogTests.cs index 0c878701c3c2..f58686733dcd 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/SaveAzureWebsiteLogTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/SaveAzureWebsiteLogTests.cs @@ -18,7 +18,7 @@ using System.Text; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Common; @@ -26,7 +26,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -86,7 +86,10 @@ public void SaveAzureWebsiteLogTest() WebsitesClient = clientMock.Object, CommandRuntime = new MockCommandRuntime(), }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; getAzureWebsiteLogCommand.DefaultCurrentPath = ""; getAzureWebsiteLogCommand.ExecuteCmdlet(); @@ -113,7 +116,10 @@ public void SaveAzureWebsiteLogWithNoFileExtensionTest() CommandRuntime = new MockCommandRuntime(), Output = "file_without_ext" }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; getAzureWebsiteLogCommand.DefaultCurrentPath = ""; getAzureWebsiteLogCommand.ExecuteCmdlet(); @@ -138,7 +144,10 @@ public void SaveAzureWebsiteLogWithSlotTest() CommandRuntime = new MockCommandRuntime(), Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; getAzureWebsiteLogCommand.DefaultCurrentPath = ""; getAzureWebsiteLogCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/SetAzureWebSiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/SetAzureWebSiteTests.cs index 290079cb57d5..a7b86114af28 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/SetAzureWebSiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/SetAzureWebSiteTests.cs @@ -17,14 +17,14 @@ using System.Linq; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -75,7 +75,10 @@ public void SetAzureWebsiteProcess() NumberOfWorkers = 3, WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; setAzureWebsiteCommand.ExecuteCmdlet(); Assert.True(updatedSiteConfig); @@ -91,7 +94,10 @@ public void SetAzureWebsiteProcess() HostNames = new [] { "stuff.com" }, WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + subscription = new AzureSubscription { Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; setAzureWebsiteCommand.ExecuteCmdlet(); Assert.False(updatedSiteConfig); @@ -144,7 +150,10 @@ public void SetsWebsiteSlot() WebsitesClient = clientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; setAzureWebsiteCommand.ExecuteCmdlet(); Assert.True(updatedSiteConfig); @@ -161,7 +170,10 @@ public void SetsWebsiteSlot() WebsitesClient = clientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; setAzureWebsiteCommand.ExecuteCmdlet(); Assert.False(updatedSiteConfig); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzurePortalTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzurePortalTests.cs index f60098e641f8..b346e5f6ab29 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzurePortalTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzurePortalTests.cs @@ -16,7 +16,7 @@ using Microsoft.WindowsAzure.Commands.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Websites; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; namespace Microsoft.WindowsAzure.Commands.Test.Websites { diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzureWebsiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzureWebsiteTests.cs index ab3c9b5129e4..0b9a0ababe43 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzureWebsiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/ShowAzureWebsiteTests.cs @@ -15,14 +15,14 @@ using System; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -49,7 +49,10 @@ public void ProcessShowWebsiteTest() Name = "website1", WebsitesClient = mockClient.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Show existing website showAzureWebsiteCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/StartAzureWebSiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/StartAzureWebSiteTests.cs index df9dee13dc96..4b25d9188b3a 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/StartAzureWebSiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/StartAzureWebSiteTests.cs @@ -15,13 +15,13 @@ using System; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -44,7 +44,10 @@ public void ProcessStartWebsiteTest() Name = websiteName, WebsitesClient = websitesClientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; startAzureWebsiteCommand.ExecuteCmdlet(); @@ -69,7 +72,10 @@ public void StartsWebsiteSlot() WebsitesClient = websitesClientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; startAzureWebsiteCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/StopAzureWebSiteTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/StopAzureWebSiteTests.cs index 58c7f1acbc4b..630bf00ca013 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/StopAzureWebSiteTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/StopAzureWebSiteTests.cs @@ -15,13 +15,13 @@ using System; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -44,7 +44,10 @@ public void ProcessStopWebsiteTest() Name = websiteName, WebsitesClient = websitesClientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; stopAzureWebsiteCommand.ExecuteCmdlet(); @@ -69,7 +72,10 @@ public void StopsWebsiteSlot() WebsitesClient = websitesClientMock.Object, Slot = slot }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; stopAzureWebsiteCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/SwitchAzureWebSiteSlotTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/SwitchAzureWebSiteSlotTests.cs index 099cbf223ca9..d59171ec4dc5 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/SwitchAzureWebSiteSlotTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/SwitchAzureWebSiteSlotTests.cs @@ -16,14 +16,14 @@ using System.Collections.Generic; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -56,7 +56,10 @@ public void SwitchesSlots() Name = "website1", Force = true }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription { Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Switch existing website switchAzureWebsiteCommand.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/UpdateAzureWebsiteRepositoryTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/UpdateAzureWebsiteRepositoryTests.cs index 5210c9759ced..f286080b9abe 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/UpdateAzureWebsiteRepositoryTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/UpdateAzureWebsiteRepositoryTests.cs @@ -16,14 +16,14 @@ using System.Collections.Generic; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites { @@ -65,7 +65,10 @@ public void UpdatesRemote() WebsitesClient = mockClient.Object, Name = "website1", }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Switch existing website cmdlet.ExecuteCmdlet(); diff --git a/src/ServiceManagement/Services/Commands.Test/Websites/WebHostingPlans/GetAzureWebHostingPlanTests.cs b/src/ServiceManagement/Services/Commands.Test/Websites/WebHostingPlans/GetAzureWebHostingPlanTests.cs index 52c4c19a050c..293f1ba7a06e 100644 --- a/src/ServiceManagement/Services/Commands.Test/Websites/WebHostingPlans/GetAzureWebHostingPlanTests.cs +++ b/src/ServiceManagement/Services/Commands.Test/Websites/WebHostingPlans/GetAzureWebHostingPlanTests.cs @@ -18,14 +18,14 @@ using System.Linq; using Xunit; 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.Test.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Websites.WebHostingPlan; using Moq; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Test.Websites.WebHostingPlans { @@ -53,7 +53,10 @@ public void ListWebHostingPlansTest() CommandRuntime = new MockCommandRuntime(), WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; command.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)command.CommandRuntime).OutputPipeline.Count); @@ -81,7 +84,10 @@ public void GetAzureWebHostingPlanBasicTest() CommandRuntime = new MockCommandRuntime(), WebsitesClient = clientMock.Object }; - AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(subscriptionId) }, null, null); + AzureSession.Profile = new AzureProfile(); + var subscription = new AzureSubscription{Id = new Guid(subscriptionId) }; + subscription.Properties[AzureSubscription.Property.Default] = "True"; + AzureSession.Profile.Subscriptions[new Guid(subscriptionId)] = subscription; command.ExecuteCmdlet(); Assert.Equal(1, ((MockCommandRuntime)command.CommandRuntime).OutputPipeline.Count); diff --git a/src/ServiceManagement/Services/Commands.Test/packages.config b/src/ServiceManagement/Services/Commands.Test/packages.config index 8c7297707af0..6bf51c052b72 100644 --- a/src/ServiceManagement/Services/Commands.Test/packages.config +++ b/src/ServiceManagement/Services/Commands.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs b/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs index 3e5ceec09f22..9b2fac11b74f 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/CloudService/CloudServiceClient.cs @@ -22,7 +22,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; 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.Commands.Utilities.CloudService.AzureTools; using Microsoft.WindowsAzure.Commands.Utilities.CloudService.Model; @@ -41,8 +41,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService { using ConfigCertificate = Common.XmlSchema.ServiceConfigurationSchema.Certificate; using ConfigConfigurationSetting = Common.XmlSchema.ServiceConfigurationSchema.ConfigurationSetting; - 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; public class CloudServiceClient : ICloudServiceClient diff --git a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj index 799e0157b5bb..8febcd17bb05 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj @@ -62,9 +62,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -84,13 +84,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 ..\..\..\packages\WindowsAzure.ServiceBus.2.3.2.0\lib\net40-full\Microsoft.ServiceBus.dll diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/AzureTools/CsPack.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/AzureTools/CsPack.cs index 40ef0cb6d6e2..bcf3a6d82c1d 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/AzureTools/CsPack.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/AzureTools/CsPack.cs @@ -23,7 +23,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService.AzureTools { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServicePathInfo.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServicePathInfo.cs index c21ea4fdb4aa..2f40429eed26 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServicePathInfo.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServicePathInfo.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServiceProject.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServiceProject.cs index ffd12d3e6550..232d932769ac 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServiceProject.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/CloudServiceProject.cs @@ -27,7 +27,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; using Microsoft.WindowsAzure.Commands.Utilities; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/CommonUtilities.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/CommonUtilities.cs index dfff278043ad..01db3dc0ff4a 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/CommonUtilities.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/CommonUtilities.cs @@ -17,7 +17,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.CloudService; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema; using Microsoft.WindowsAzure.Commands.Utilities.Properties; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.Common { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/JavaScriptPackageHelpers.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/JavaScriptPackageHelpers.cs index d5a00b52369b..3692c859ff31 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/JavaScriptPackageHelpers.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/JavaScriptPackageHelpers.cs @@ -18,7 +18,7 @@ using System.Web.Script.Serialization; using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/PublishContext.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/PublishContext.cs index efd3f357acd2..a0f1ee2c0cdd 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/PublishContext.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/PublishContext.cs @@ -16,9 +16,9 @@ using System.IO; using System.Linq; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; +using Microsoft.WindowsAzure.Commands.Utilities.Properties; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/RoleInfo.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/RoleInfo.cs index f6fd5477ba61..e4182bd5e552 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/RoleInfo.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/RoleInfo.cs @@ -12,7 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema; diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/NodeRules.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/NodeRules.cs index 4d3077897178..23c0b7bf79d9 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/NodeRules.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/NodeRules.cs @@ -18,7 +18,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService.Scaffolding { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PHPRules.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PHPRules.cs index 67d0f22aab6a..e85f53d8689d 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PHPRules.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PHPRules.cs @@ -17,7 +17,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.WindowsAzure.Commands.Common; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService.Scaffolding diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PythonRules.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PythonRules.cs index 2d347a777af9..42d6064b8b5b 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PythonRules.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/PythonRules.cs @@ -17,7 +17,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.WindowsAzure.Commands.Common; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService.Scaffolding diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/Scaffold.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/Scaffold.cs index 9eae6d86279d..b15f56c7f452 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/Scaffold.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/Scaffolding/Scaffold.cs @@ -20,7 +20,7 @@ using System.Xml.Linq; using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService.Scaffolding { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceComponents.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceComponents.cs index 8a71dd4d11f4..558b7cfe530c 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceComponents.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceComponents.cs @@ -22,7 +22,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceConfigurationSchema.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceConfigurationSchema.cs index 9c2e9a899813..07f097075884 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceConfigurationSchema.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceConfigurationSchema.cs @@ -10,7 +10,7 @@ // This source code was auto-generated by xsd, Version=4.0.30319.34014 using command: // xsd.exe "C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\schemas\ServiceConfigurationSchema.xsd" -// /c /namespace:Microsoft.Azure.Common.Extensions.XmlSchema.ServiceConfigurationSchema +// /c /namespace:Microsoft.Azure.Common.Authentication.XmlSchema.ServiceConfigurationSchema // /language:cs namespace Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceDefinitionSchema.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceDefinitionSchema.cs index 0141831de1f5..841780eb1913 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceDefinitionSchema.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceDefinitionSchema.cs @@ -10,7 +10,7 @@ // This source code was auto-generated by xsd, Version=4.0.30319.34014 using command: // xsd.exe "C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\schemas\ServiceDefinitionSchema.xsd" -// /c /namespace:Microsoft.Azure.Common.Extensions.XmlSchema.ServiceDefinitionSchema +// /c /namespace:Microsoft.Azure.Common.Authentication.XmlSchema.ServiceDefinitionSchema // /language:cs namespace Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceDefinitionSchema { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceManagementBaseCmdlet.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceManagementBaseCmdlet.cs index 0f92dff06086..97f62c919442 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceManagementBaseCmdlet.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceManagementBaseCmdlet.cs @@ -21,14 +21,14 @@ using System.ServiceModel.Dispatcher; using AutoMapper; 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.Utilities.Properties; using Microsoft.WindowsAzure.Management; using Microsoft.WindowsAzure.Management.Compute; using Microsoft.WindowsAzure.Management.Network; using Microsoft.WindowsAzure.Management.Storage; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.Azure; using Hyak.Common; diff --git a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceSettings.cs b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceSettings.cs index b1db82219311..dc96bb1723ec 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceSettings.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Common/ServiceSettings.cs @@ -21,7 +21,7 @@ using Microsoft.WindowsAzure.Commands.Common.Properties; using Microsoft.WindowsAzure.Commands.ServiceManagement.Model; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.CloudService { diff --git a/src/ServiceManagement/Services/Commands.Utilities/MediaServices/MediaServicesClient.cs b/src/ServiceManagement/Services/Commands.Utilities/MediaServices/MediaServicesClient.cs index ed35fcf13d2e..a20fc8286f47 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/MediaServices/MediaServicesClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/MediaServices/MediaServicesClient.cs @@ -22,7 +22,7 @@ using System.Xml; using System.Xml.Serialization; 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.Utilities.Websites.Services; using Microsoft.WindowsAzure.Management.MediaServices; @@ -30,7 +30,7 @@ using Microsoft.WindowsAzure.Management.Storage; using Microsoft.WindowsAzure.Management.Storage.Models; using Newtonsoft.Json; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.Azure; namespace Microsoft.WindowsAzure.Commands.Utilities.MediaServices diff --git a/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs b/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs index d2c6a3cc7b53..505df9d647e0 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs index c678fe40b48c..65ddcc09af41 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs @@ -20,7 +20,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model; using Microsoft.WindowsAzure.Scheduler; using Microsoft.WindowsAzure.Scheduler.Models; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs index e48cdc6edd3f..9a885e130277 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Common; using Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model; @@ -24,7 +24,7 @@ using Microsoft.WindowsAzure.Management.Scheduler.Models; using Microsoft.WindowsAzure.Scheduler; using Microsoft.WindowsAzure.Scheduler.Models; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.Azure; namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler diff --git a/src/ServiceManagement/Services/Commands.Utilities/ServiceBus/ServiceBusClientExtensions.cs b/src/ServiceManagement/Services/Commands.Utilities/ServiceBus/ServiceBusClientExtensions.cs index efe36786dcb8..2a6d6c5666c7 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/ServiceBus/ServiceBusClientExtensions.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/ServiceBus/ServiceBusClientExtensions.cs @@ -22,7 +22,7 @@ using Microsoft.ServiceBus.Messaging; using Microsoft.ServiceBus.Notifications; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Microsoft.WindowsAzure.Management.ServiceBus; using Microsoft.WindowsAzure.Management.ServiceBus.Models; @@ -30,8 +30,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.ServiceBus { using ServiceBusNamespaceDescription = Management.ServiceBus.Models.NamespaceDescription; - 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; public class ServiceBusClientExtensions diff --git a/src/ServiceManagement/Services/Commands.Utilities/Store/StoreClient.cs b/src/ServiceManagement/Services/Commands.Utilities/Store/StoreClient.cs index dfa975d3c4f0..0bae6ab24d5c 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Store/StoreClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Store/StoreClient.cs @@ -19,7 +19,7 @@ using System.Security.Cryptography; using System.Text; 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.WindowsAzure.Commands.Utilities.MarketplaceServiceReference; using Microsoft.WindowsAzure.Commands.Utilities.Properties; @@ -32,8 +32,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Store { using Resource = Management.Store.Models.CloudServiceListResponse.CloudService.AddOnResource; - using Microsoft.Azure.Common.Extensions.Models; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication.Models; + using Microsoft.Azure.Common.Authentication; public class StoreClient { diff --git a/src/ServiceManagement/Services/Commands.Utilities/WAPackIaaS/WebClient/Subscription.cs b/src/ServiceManagement/Services/Commands.Utilities/WAPackIaaS/WebClient/Subscription.cs index c8b00a60b2f0..f5417d06f72d 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/WAPackIaaS/WebClient/Subscription.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/WAPackIaaS/WebClient/Subscription.cs @@ -17,9 +17,9 @@ using System.Security; 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.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.WAPackIaaS.WebClient { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Websites/KuduRemoteClientBase.cs b/src/ServiceManagement/Services/Commands.Utilities/Websites/KuduRemoteClientBase.cs index d01d08427868..6f723e751952 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Websites/KuduRemoteClientBase.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Websites/KuduRemoteClientBase.cs @@ -17,8 +17,8 @@ using System.Net.Http; using Microsoft.WindowsAzure.Commands.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; -using Microsoft.Azure.Common.Extensions.Factories; +using Microsoft.Azure.Common.Authentication; +using Microsoft.Azure.Common.Authentication.Factories; namespace Microsoft.WindowsAzure.Commands.Utilities.Websites { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/Cache.cs b/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/Cache.cs index b5c18f3badee..11fe3c14f9ce 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/Cache.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/Cache.cs @@ -19,7 +19,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.Websites.Services { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/LinkedRevisionControl.cs b/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/LinkedRevisionControl.cs index 2a9b78ac97af..082caae89f5b 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/LinkedRevisionControl.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/LinkedRevisionControl.cs @@ -17,7 +17,7 @@ using System.Linq; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Utilities.Websites.Services { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs b/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs index 6d081e1819c4..74835271bf51 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs @@ -27,7 +27,7 @@ using Microsoft.Build.Logging; using Microsoft.Web.Deployment; 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.Commands.Utilities.CloudService; using Microsoft.WindowsAzure.Commands.Utilities.Common; @@ -47,8 +47,8 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Websites { using Utilities = Services.WebEntities; - 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; public class WebsitesClient : IWebsitesClient diff --git a/src/ServiceManagement/Services/Commands.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Utilities/packages.config index 9c38940e2220..295098100097 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Utilities/packages.config @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/src/ServiceManagement/Services/Commands/CloudService/Development/EnableAzureRemoteDesktop.cs b/src/ServiceManagement/Services/Commands/CloudService/Development/EnableAzureRemoteDesktop.cs index cf1eb84ce317..e7ca9869c1a2 100644 --- a/src/ServiceManagement/Services/Commands/CloudService/Development/EnableAzureRemoteDesktop.cs +++ b/src/ServiceManagement/Services/Commands/CloudService/Development/EnableAzureRemoteDesktop.cs @@ -30,7 +30,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.Properties; using Certificate = Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema.Certificate; using ConfigurationSetting = Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema.ServiceConfigurationSchema.ConfigurationSetting; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.CloudService.Development { diff --git a/src/ServiceManagement/Services/Commands/CloudService/Development/Scaffolding/NewAzureRoleTemplate.cs b/src/ServiceManagement/Services/Commands/CloudService/Development/Scaffolding/NewAzureRoleTemplate.cs index 18fe8452fa07..b8d56ff6a556 100644 --- a/src/ServiceManagement/Services/Commands/CloudService/Development/Scaffolding/NewAzureRoleTemplate.cs +++ b/src/ServiceManagement/Services/Commands/CloudService/Development/Scaffolding/NewAzureRoleTemplate.cs @@ -19,7 +19,7 @@ using Microsoft.WindowsAzure.Commands.Utilities.CloudService; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Properties; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.CloudService.Development.Scaffolding { diff --git a/src/ServiceManagement/Services/Commands/CloudService/TestAzureName.cs b/src/ServiceManagement/Services/Commands/CloudService/TestAzureName.cs index 1c8f38e2ebc9..5fe9ede444d2 100644 --- a/src/ServiceManagement/Services/Commands/CloudService/TestAzureName.cs +++ b/src/ServiceManagement/Services/Commands/CloudService/TestAzureName.cs @@ -14,12 +14,12 @@ using System.IO; using System.Management.Automation; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Utilities.CloudService; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.ServiceBus; using Microsoft.WindowsAzure.Commands.Utilities.Websites; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.CloudService { diff --git a/src/ServiceManagement/Services/Commands/Commands.csproj b/src/ServiceManagement/Services/Commands/Commands.csproj index 263cf2e345c9..53bc96f12f01 100644 --- a/src/ServiceManagement/Services/Commands/Commands.csproj +++ b/src/ServiceManagement/Services/Commands/Commands.csproj @@ -60,9 +60,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -82,13 +82,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 ..\..\..\packages\WindowsAzure.ServiceBus.2.3.2.0\lib\net40-full\Microsoft.ServiceBus.dll @@ -345,7 +345,9 @@ - + + Designer + diff --git a/src/ServiceManagement/Services/Commands/MediaServices/AzureMediaServicesHttpClientCommandBase.cs b/src/ServiceManagement/Services/Commands/MediaServices/AzureMediaServicesHttpClientCommandBase.cs index 9f32f435bd8d..2afd5c031d8f 100644 --- a/src/ServiceManagement/Services/Commands/MediaServices/AzureMediaServicesHttpClientCommandBase.cs +++ b/src/ServiceManagement/Services/Commands/MediaServices/AzureMediaServicesHttpClientCommandBase.cs @@ -14,7 +14,7 @@ using System; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.MediaServices { diff --git a/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs b/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs index 503cc72e53c5..90ba2cb8809a 100644 --- a/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs +++ b/src/ServiceManagement/Services/Commands/Websites/EnableAzureWebsiteDiagnostic.cs @@ -14,7 +14,7 @@ using System.Collections.Generic; using System.Management.Automation; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Utilities.Websites; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Common; using Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.DeploymentEntities; diff --git a/src/ServiceManagement/Services/Commands/Websites/NewAzureWebSite.cs b/src/ServiceManagement/Services/Commands/Websites/NewAzureWebSite.cs index 60894f57babe..cfcc634ba61c 100644 --- a/src/ServiceManagement/Services/Commands/Websites/NewAzureWebSite.cs +++ b/src/ServiceManagement/Services/Commands/Websites/NewAzureWebSite.cs @@ -32,7 +32,7 @@ namespace Microsoft.WindowsAzure.Commands.Websites { using GitClass = Utilities.Websites.Services.Git; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; using Hyak.Common; /// diff --git a/src/ServiceManagement/Services/Commands/Websites/ShowAzurePortal.cs b/src/ServiceManagement/Services/Commands/Websites/ShowAzurePortal.cs index 38c49306e520..14c341f5f621 100644 --- a/src/ServiceManagement/Services/Commands/Websites/ShowAzurePortal.cs +++ b/src/ServiceManagement/Services/Commands/Websites/ShowAzurePortal.cs @@ -14,10 +14,10 @@ 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.Properties; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Websites { @@ -57,7 +57,7 @@ public override void ExecuteCmdlet() AzureEnvironment environment; if (string.IsNullOrEmpty(Environment)) { - environment = AzureSession.CurrentContext.Environment; + environment = AzureSession.Profile.CurrentContext.Environment; } else { diff --git a/src/ServiceManagement/Services/Commands/packages.config b/src/ServiceManagement/Services/Commands/packages.config index 1b775e508671..561f7f720f57 100644 --- a/src/ServiceManagement/Services/Commands/packages.config +++ b/src/ServiceManagement/Services/Commands/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj index 3face97e95be..52ee42244aeb 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj @@ -54,9 +54,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -73,12 +73,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/Sql/Commands.SqlDatabase.Test/FunctionalTests/OutputFormatValidator.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/FunctionalTests/OutputFormatValidator.cs index f95acb7f8976..5aaa9d924df7 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/FunctionalTests/OutputFormatValidator.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/FunctionalTests/OutputFormatValidator.cs @@ -16,7 +16,7 @@ using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Test.FunctionalTests { diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCertAuthTests.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCertAuthTests.cs index 9da5e0011c3c..5cbf27b7c832 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCertAuthTests.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCertAuthTests.cs @@ -19,7 +19,7 @@ using System.Linq; using System.Management.Automation; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.MockServer; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.Server.Cmdlet; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCopyCertAuthTests.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCopyCertAuthTests.cs index 72b8006ee7e6..5932cc9c0070 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCopyCertAuthTests.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/AzureSqlDatabaseCopyCertAuthTests.cs @@ -18,7 +18,7 @@ using System.Management.Automation; using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Model; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.MockServer; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.Server.Cmdlet; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/GetRestorableDroppedDatabaseCertAuthTests.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/GetRestorableDroppedDatabaseCertAuthTests.cs index ad8846138cd9..e44858c1c471 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/GetRestorableDroppedDatabaseCertAuthTests.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/GetRestorableDroppedDatabaseCertAuthTests.cs @@ -19,7 +19,7 @@ using System.Management.Automation; 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.Common; using Microsoft.WindowsAzure.Commands.Common.Test.Mocks; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/ImportExportCmdletTests.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/ImportExportCmdletTests.cs index bf559a0278bc..abb8884b0d7b 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/ImportExportCmdletTests.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/ImportExportCmdletTests.cs @@ -18,7 +18,7 @@ using System.Text.RegularExpressions; 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.SqlDatabase.Test.UnitTests.MockServer; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.Server.Cmdlet; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.Utilities; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/NewAzureSqlDatabaseServerContextTests.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/NewAzureSqlDatabaseServerContextTests.cs index 0d7a63866b9f..40a846c80384 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/NewAzureSqlDatabaseServerContextTests.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Database/Cmdlet/NewAzureSqlDatabaseServerContextTests.cs @@ -18,7 +18,7 @@ using System.Linq; using System.Management.Automation; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet; using Microsoft.WindowsAzure.Commands.SqlDatabase.Properties; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Firewall/Cmdlet/FirewallCmdletTests.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Firewall/Cmdlet/FirewallCmdletTests.cs index 3e4ceeac3e8d..7cba63f01036 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Firewall/Cmdlet/FirewallCmdletTests.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Firewall/Cmdlet/FirewallCmdletTests.cs @@ -17,7 +17,7 @@ using System.Linq; using System.Management.Automation; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Model; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.MockServer; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.Server.Cmdlet; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/MockServer/MockHttpServer.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/MockServer/MockHttpServer.cs index a03bd2d3594f..ece284ea878a 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/MockServer/MockHttpServer.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/MockServer/MockHttpServer.cs @@ -22,11 +22,11 @@ using System.Security.Cryptography.X509Certificates; using System.Text; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Common.Test.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.SqlDatabase.Test.UnitTests.MockServer { @@ -171,7 +171,7 @@ public static WebException CreateWebException( public static void SetupCertificates() { TestingTracingInterceptor.AddToContext(); - ProfileClient.DataStore = new MockDataStore(); + AzureSession.DataStore = new MockDataStore(); AzureSession.AuthenticationFactory = new MockTokenAuthenticationFactory(); var newGuid = Guid.NewGuid(); ProfileClient client = new ProfileClient(); @@ -209,8 +209,8 @@ public static void SetupCertificates() {AzureAccount.Property.Subscriptions, newGuid.ToString()} } }; - AzureSession.SetCurrentContext(client.Profile.Subscriptions[newGuid], - null, client.Profile.Accounts["test"]); + client.SetSubscriptionAsDefault(newGuid, "test"); + AzureSession.Profile = client.Profile; client.Profile.Save(); diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Server/Cmdlet/ServerCmdletTests.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Server/Cmdlet/ServerCmdletTests.cs index b83b2ae15109..3f92417cbb9e 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Server/Cmdlet/ServerCmdletTests.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/Server/Cmdlet/ServerCmdletTests.cs @@ -17,7 +17,7 @@ using System.Linq; using System.Management.Automation; using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Model; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests.Database.Cmdlet; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/UnitTestHelper.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/UnitTestHelper.cs index 97254adb0701..cafe590b6aa2 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/UnitTestHelper.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/UnitTests/UnitTestHelper.cs @@ -23,9 +23,9 @@ using System.Security.Cryptography.X509Certificates; 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.SqlDatabase.Test.UnitTests.MockServer; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Test.UnitTests { @@ -325,7 +325,7 @@ public static AzureSubscription SetupUnitTestSubscription(System.Management.Auto client.AddOrSetAccount(account); client.AddOrSetSubscription(subscription); - client.SetSubscriptionAsCurrent(UnitTestSubscriptionName, account.Id); + client.SetSubscriptionAsDefault(UnitTestSubscriptionName, account.Id); client.Profile.Save(); return subscription; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config index 6bead9261a3b..639925966476 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj b/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj index 710c6a6502fb..393cb5afd294 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj @@ -57,9 +57,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -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/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabase.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabase.cs index 9c6deb7746cb..2b1c49a3d524 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabase.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabase.cs @@ -18,7 +18,7 @@ using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -136,7 +136,7 @@ public override void ExecuteCmdlet() break; case ByServerName: - context = ServerDataServiceCertAuth.Create(this.ServerName, AzureSession.CurrentContext.Subscription); + context = ServerDataServiceCertAuth.Create(this.ServerName, AzureSession.Profile.CurrentContext.Subscription); break; default: diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseCopy.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseCopy.cs index aaefb6e0c3b6..30735cba962f 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseCopy.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseCopy.cs @@ -22,7 +22,7 @@ namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { using DatabaseCopyModel = Model.DatabaseCopy; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; /// /// Retrieves a list of all ongoing Microsoft Azure SQL Database copy operations in the given @@ -118,7 +118,7 @@ public override void ExecuteCmdlet() // Use the provided ServerDataServiceContext or create one from the // provided ServerName and the active subscription. IServerDataServiceContext context = ServerDataServiceCertAuth.Create(this.ServerName, - AzureSession.CurrentContext.Subscription); + AzureSession.Profile.CurrentContext.Subscription); try { diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseImportExportStatus.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseImportExportStatus.cs index 34067c97e70b..453bcbfeaa17 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseImportExportStatus.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseImportExportStatus.cs @@ -19,8 +19,8 @@ using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.ImportExport; using Microsoft.WindowsAzure.Management.Sql; using Microsoft.WindowsAzure.Management.Sql.Models; -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.SqlDatabase.Database.Cmdlet { @@ -174,7 +174,7 @@ public override void ExecuteCmdlet() var status = this.GetAzureSqlDatabaseImportExportStatusProcess( serverName, - serverName + AzureSession.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix), + serverName + AzureSession.Profile.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix), userName, password, requestId); diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseOperation.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseOperation.cs index 2eb455284457..c6fc1d5df18b 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseOperation.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseOperation.cs @@ -18,7 +18,7 @@ using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -111,7 +111,7 @@ public override void ExecuteCmdlet() break; case ByServerName: - context = ServerDataServiceCertAuth.Create(this.ServerName, AzureSession.CurrentContext.Subscription); + context = ServerDataServiceCertAuth.Create(this.ServerName, AzureSession.Profile.CurrentContext.Subscription); break; } ProcessWithContext(context); diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseServiceObjective.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseServiceObjective.cs index 1c644705ad7e..cc3a72454ca5 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseServiceObjective.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabaseServiceObjective.cs @@ -18,7 +18,7 @@ using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -98,7 +98,7 @@ public override void ExecuteCmdlet() break; case ByServerName: - context = ServerDataServiceCertAuth.Create(this.ServerName, AzureSession.CurrentContext.Subscription); + context = ServerDataServiceCertAuth.Create(this.ServerName, AzureSession.Profile.CurrentContext.Subscription); break; default: diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabase.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabase.cs index cf085ab42159..994c27a7ebba 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabase.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabase.cs @@ -15,12 +15,12 @@ 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.SqlDatabase.Properties; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -171,7 +171,7 @@ private void ProcessWithServerName(int? maxSizeGb, long? maxSizeBytes) try { // Get the current subscription data. - AzureSubscription subscription = AzureSession.CurrentContext.Subscription; + AzureSubscription subscription = AzureSession.Profile.CurrentContext.Subscription; // Create a temporary context ServerDataServiceCertAuth context = diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabaseServerContext.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabaseServerContext.cs index 2a1e399592c5..f79043c2976a 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabaseServerContext.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabaseServerContext.cs @@ -18,12 +18,12 @@ using System.Management.Automation; using System.Xml.Linq; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Properties; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -151,7 +151,7 @@ private AzureSubscription CurrentSubscription { if (string.IsNullOrEmpty(SubscriptionName)) { - return AzureSession.CurrentContext.Subscription; + return AzureSession.Profile.CurrentContext.Subscription; } ProfileClient client = new ProfileClient(); @@ -311,7 +311,7 @@ private Uri GetManageUrl(string parameterSetName) // and append the azure database DNS suffix. return new Uri( Uri.UriSchemeHttps + Uri.SchemeDelimiter + - this.ServerName + AzureSession.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix)); + this.ServerName + AzureSession.Profile.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix)); case FullyQualifiedServerNameWithSqlAuthParamSet: case FullyQualifiedServerNameWithCertAuthParamSet: // The fully qualified server name was specified, diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/RemoveAzureSqlDatabase.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/RemoveAzureSqlDatabase.cs index 68bb1ccdc563..a591d44da49d 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/RemoveAzureSqlDatabase.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/RemoveAzureSqlDatabase.cs @@ -16,12 +16,12 @@ using System.Globalization; 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.SqlDatabase.Properties; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -201,7 +201,7 @@ private void ProcessWithServerName(string databaseName) try { // Get the current subscription data. - AzureSubscription subscription = AzureSession.CurrentContext.Subscription; + AzureSubscription subscription = AzureSession.Profile.CurrentContext.Subscription; // Create a temporary context ServerDataServiceCertAuth context = diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/SetAzureSqlDatabase.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/SetAzureSqlDatabase.cs index 7292204dabe6..e282d454fd92 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/SetAzureSqlDatabase.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/SetAzureSqlDatabase.cs @@ -16,12 +16,12 @@ using System.Globalization; 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.SqlDatabase.Properties; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -280,7 +280,7 @@ private void ProcessWithServerName(string databaseName, int? maxSizeGb, long? ma try { // Get the current subscription data. - AzureSubscription subscription = AzureSession.CurrentContext.Subscription; + AzureSubscription subscription = AzureSession.Profile.CurrentContext.Subscription; // Create a temporary context ServerDataServiceCertAuth context = diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseCopy.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseCopy.cs index 5fa5166b8d68..23dadc019a5b 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseCopy.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseCopy.cs @@ -24,7 +24,7 @@ namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { using DatabaseCopyModel = Model.DatabaseCopy; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; /// /// Start a copy operation for a Microsoft Azure SQL Database in the given server context. @@ -188,7 +188,7 @@ public override void ExecuteCmdlet() // Use the provided ServerDataServiceContext or create one from the // provided ServerName and the active subscription. IServerDataServiceContext context = ServerDataServiceCertAuth.Create(this.ServerName, - AzureSession.CurrentContext.Subscription); + AzureSession.Profile.CurrentContext.Subscription); try { diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseExport.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseExport.cs index f9fec0f80808..c28cfe6302cf 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseExport.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseExport.cs @@ -14,7 +14,7 @@ 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.Storage; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.ImportExport; @@ -22,7 +22,7 @@ using Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel; using Microsoft.WindowsAzure.Management.Sql; using Microsoft.WindowsAzure.Management.Sql.Models; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -210,7 +210,7 @@ public override void ExecuteCmdlet() // Retrieve the fully qualified server name string fullyQualifiedServerName = - this.SqlConnectionContext.ServerName + AzureSession.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix); + this.SqlConnectionContext.ServerName + AzureSession.Profile.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix); // Issue the request ImportExportRequest context = this.ExportSqlAzureDatabaseProcess( diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseImport.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseImport.cs index b0736940ef05..bd51e1e8a7c3 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseImport.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseImport.cs @@ -14,7 +14,7 @@ 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.Storage; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.ImportExport; @@ -22,7 +22,7 @@ using Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel; using Microsoft.WindowsAzure.Management.Sql; using Microsoft.WindowsAzure.Management.Sql.Models; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -233,7 +233,7 @@ public override void ExecuteCmdlet() // Retrieve the fully qualified server name string fullyQualifiedServerName = - this.SqlConnectionContext.ServerName + AzureSession.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix); + this.SqlConnectionContext.ServerName + AzureSession.Profile.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix); // Issue the request ImportExportRequest context = this.ImportSqlAzureDatabaseProcess( diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseRestore.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseRestore.cs index ceea8020e6ab..d5d5f9e8a1c5 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseRestore.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StartAzureSqlDatabaseRestore.cs @@ -18,7 +18,7 @@ using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { @@ -199,7 +199,7 @@ public override void ExecuteCmdlet() { string serverName = this.SourceServerName ?? connectionContext.ServerName; - connectionContext = ServerDataServiceCertAuth.Create(serverName, AzureSession.CurrentContext.Subscription); + connectionContext = ServerDataServiceCertAuth.Create(serverName, AzureSession.Profile.CurrentContext.Subscription); } string clientRequestId = connectionContext.ClientRequestId; diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StopAzureSqlDatabaseCopy.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StopAzureSqlDatabaseCopy.cs index f838ec05af79..88ffcc275dd7 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StopAzureSqlDatabaseCopy.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Database/Cmdlet/StopAzureSqlDatabaseCopy.cs @@ -25,7 +25,7 @@ namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet { using DatabaseCopyModel = Model.DatabaseCopy; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; /// /// Stop an ongoing copy operation for a Microsoft Azure SQL Database in the given server context. @@ -132,7 +132,7 @@ public override void ExecuteCmdlet() // Use the provided ServerDataServiceContext or create one from the // provided ServerName and the active subscription. IServerDataServiceContext context = ServerDataServiceCertAuth.Create(this.ServerName, - AzureSession.CurrentContext.Subscription); + AzureSession.Profile.CurrentContext.Subscription); DatabaseCopyModel databaseCopy; if (this.MyInvocation.BoundParameters.ContainsKey("DatabaseCopy")) diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Services/Server/ServerDataServiceCertAuth.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/Services/Server/ServerDataServiceCertAuth.cs index e2ee0560b138..80b83babdbfb 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Services/Server/ServerDataServiceCertAuth.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Services/Server/ServerDataServiceCertAuth.cs @@ -17,7 +17,7 @@ using System.Globalization; using System.Linq; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Properties; using Microsoft.WindowsAzure.Management.Sql; using Microsoft.WindowsAzure.Management.Sql.Models; @@ -26,7 +26,7 @@ namespace Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server { using DatabaseCopyModel = Model.DatabaseCopy; using WamlDatabaseCopy = Management.Sql.Models.DatabaseCopy; - using Microsoft.Azure.Common.Extensions; + using Microsoft.Azure.Common.Authentication; using Microsoft.Azure; /// diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/SqlDatabaseCmdletBase.cs b/src/ServiceManagement/Sql/Commands.SqlDatabase/SqlDatabaseCmdletBase.cs index 709b58ed2f66..673b5a3e3660 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/SqlDatabaseCmdletBase.cs +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/SqlDatabaseCmdletBase.cs @@ -15,12 +15,12 @@ using System; using System.Globalization; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services; using Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Management.Sql; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.SqlDatabase { @@ -61,7 +61,7 @@ public static string GenerateClientTracingId() protected SqlManagementClient GetCurrentSqlClient() { // Get the SQL management client for the current subscription - AzureSubscription subscription = AzureSession.CurrentContext.Subscription; + AzureSubscription subscription = AzureSession.Profile.CurrentContext.Subscription; SqlDatabaseCmdletBase.ValidateSubscription(subscription); SqlManagementClient client = AzureSession.ClientFactory.CreateClient(subscription, AzureEnvironment.Endpoint.ServiceManagement); client.HttpClient.DefaultRequestHeaders.Add(Constants.ClientSessionIdHeaderName, clientSessionId); @@ -78,7 +78,7 @@ public static void ValidateSubscription(AzureSubscription subscription) if (subscription == null) { throw new ArgumentException( - Common.Properties.Resources.InvalidCurrentSubscription); + Common.Properties.Resources.InvalidDefaultSubscription); } } diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config b/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config index 5c82cbc0ff5c..e561ff5c0963 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj index 2ee4f8eb07ca..e305cc24bac4 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/Commands.StorSimple.Test.csproj @@ -39,8 +39,8 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -51,13 +51,13 @@ ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-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 ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/StorSimpleTestBase.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/StorSimpleTestBase.cs index 6764ee2c1598..31975b9e2d45 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/StorSimpleTestBase.cs +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/ScenarioTests/StorSimpleTestBase.cs @@ -19,7 +19,7 @@ using System.Net.Security; using System.Reflection; using Microsoft.Azure; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.Azure.Test; using Microsoft.Azure.Test.HttpRecorder; using Microsoft.WindowsAzure.Commands.ScenarioTest; diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config index 56c5975bcf97..c6bb342cca91 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple.Test/packages.config @@ -3,11 +3,11 @@ - + - + diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj b/src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj index d85826af8995..b149b73e4271 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj @@ -49,19 +49,19 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.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 ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleClient.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleClient.cs index 86a06a776a6e..83618d5751a4 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleClient.cs +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleClient.cs @@ -20,8 +20,8 @@ using System.Net.Security; using System.Runtime.Caching; using Hyak.Common; -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.Management.Scheduler; using Microsoft.WindowsAzure.Management.StorSimple; using Microsoft.WindowsAzure.Management.StorSimple.Models; @@ -63,7 +63,7 @@ private StorSimpleManagementClient GetStorSimpleClient() StorSimpleContext.ResourceName, StorSimpleContext.ResourceId, StorSimpleContext.ResourceProviderNameSpace, StorSimpleContext.StampId, this.cloudServicesClient.Credentials, - AzureSession.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement)); + AzureSession.Profile.CurrentContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ServiceManagement)); if (storSimpleClient == null) { diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config b/src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config index ceca9f9facc6..e313f29f0dc6 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config @@ -3,11 +3,11 @@ - + - + diff --git a/src/ServiceManagement/Storage/Commands.Storage.Test/Blob/StorageBlobTestBase.cs b/src/ServiceManagement/Storage/Commands.Storage.Test/Blob/StorageBlobTestBase.cs index 4c57942c8b2e..3e88475f1426 100644 --- a/src/ServiceManagement/Storage/Commands.Storage.Test/Blob/StorageBlobTestBase.cs +++ b/src/ServiceManagement/Storage/Commands.Storage.Test/Blob/StorageBlobTestBase.cs @@ -19,7 +19,7 @@ using Microsoft.WindowsAzure.Commands.Common.Test.Mocks; using Microsoft.WindowsAzure.Commands.Storage.Test.Service; using Microsoft.WindowsAzure.Storage.Blob; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Storage.Test.Blob { @@ -60,7 +60,7 @@ public void InitMock() { BlobMock = new MockStorageBlobManagement(); MockCmdRunTime = new MockCommandRuntime(); - ProfileClient.DataStore = new MockDataStore(); + AzureSession.DataStore = new MockDataStore(); } [TestCleanup] diff --git a/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj b/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj index e0d8286547d1..550af457674d 100644 --- a/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj +++ b/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj @@ -54,9 +54,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -73,12 +73,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/Storage/Commands.Storage.Test/packages.config b/src/ServiceManagement/Storage/Commands.Storage.Test/packages.config index bdea9420592b..25d6269cccaa 100644 --- a/src/ServiceManagement/Storage/Commands.Storage.Test/packages.config +++ b/src/ServiceManagement/Storage/Commands.Storage.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj b/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj index ea8af24d5ceb..457e9fe05480 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj +++ b/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj @@ -49,9 +49,9 @@ False ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll False @@ -70,12 +70,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/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs b/src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs index c311e9108c65..e8fe21106612 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs @@ -17,12 +17,12 @@ using System.Management.Automation; using System.Security.Permissions; 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.Commands.Utilities.Common; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Auth; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; namespace Microsoft.WindowsAzure.Commands.Storage.Common.Cmdlet { @@ -332,7 +332,7 @@ internal CloudStorageAccount GetStorageAccountWithEndPoint(StorageCredentials cr /// /// Get storage account and use specific azure environment /// - /// Storage credentail + /// Storage credential /// Storage account name, it's used for build end point /// Use secure Http protocol /// Environment name @@ -344,7 +344,7 @@ internal CloudStorageAccount GetStorageAccountWithAzureEnvironment(StorageCreden if (string.IsNullOrEmpty(azureEnvironmentName)) { - azureEnvironment = AzureSession.CurrentContext.Environment; + azureEnvironment = AzureSession.Profile.CurrentContext.Environment; } else { diff --git a/src/ServiceManagement/Storage/Commands.Storage/Common/StorageCloudCmdletBase.cs b/src/ServiceManagement/Storage/Commands.Storage/Common/StorageCloudCmdletBase.cs index 3effb41d97c6..d8cc2980e061 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Common/StorageCloudCmdletBase.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Common/StorageCloudCmdletBase.cs @@ -20,7 +20,7 @@ using System.Net; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.Common.Storage; using Microsoft.WindowsAzure.Commands.Storage.File; using Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel; diff --git a/src/ServiceManagement/Storage/Commands.Storage/packages.config b/src/ServiceManagement/Storage/Commands.Storage/packages.config index bdea9420592b..25d6269cccaa 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/packages.config +++ b/src/ServiceManagement/Storage/Commands.Storage/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj index e8ab5c18c638..43dd6e1fe9d6 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj @@ -41,9 +41,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -60,12 +60,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/TrafficManager/Commands.TrafficManager.Test/packages.config b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config index 6a1d321c8bcf..2a4bca960d2f 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj index f084b7c8e9e5..f7931fd3ab55 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj @@ -51,9 +51,9 @@ ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll - + False - ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + ..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.2-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll @@ -71,12 +71,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/TrafficManager/Commands.TrafficManager/TestAzureTrafficManagerDomainName.cs b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/TestAzureTrafficManagerDomainName.cs index ddf18d9ca57c..fc652d83e066 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/TestAzureTrafficManagerDomainName.cs +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/TestAzureTrafficManagerDomainName.cs @@ -16,8 +16,8 @@ using Microsoft.WindowsAzure.Commands.TrafficManager.Utilities; using Microsoft.WindowsAzure.Commands.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; -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.TrafficManager { @@ -36,8 +36,8 @@ public override void ExecuteCmdlet() private string GetDomainNameToCheck(string domainName) { - string TrafficManagerSuffix = !string.IsNullOrEmpty(AzureSession.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix)) ? - AzureSession.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix) : + string TrafficManagerSuffix = !string.IsNullOrEmpty(AzureSession.Profile.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix)) ? + AzureSession.Profile.CurrentContext.Environment.GetEndpoint(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix) : AzureEnvironmentConstants.AzureTrafficManagerDnsSuffix; if (!string.IsNullOrEmpty(domainName) && !domainName.ToLower().EndsWith(TrafficManagerSuffix)) diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs index 50a60c5de37b..fe2321015698 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs @@ -16,11 +16,11 @@ using System.Collections.Generic; using System.Linq; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.Azure.Common.Extensions.Models; +using Microsoft.Azure.Common.Authentication.Models; using Microsoft.WindowsAzure.Commands.TrafficManager.Models; using Microsoft.WindowsAzure.Management.TrafficManager; using Microsoft.WindowsAzure.Management.TrafficManager.Models; -using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Authentication; using Microsoft.Azure; using Hyak.Common; diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config index 79ad7aea5fe6..3ccafa71a1c7 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - +