Skip to content

Commit d065458

Browse files
author
Hao Chen
committed
Merge pull request #1314 from haocs/clu
Use ADAL 3 and Microsoft.Rest.ClientRuntime.Azure.Authentication
2 parents 1184ef6 + 0c53e08 commit d065458

16 files changed

+82
-48
lines changed

src/Common/Authentication/Common.Authentication.Tests/AuthenticationFactoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using Microsoft.Azure.Common.Authentication;
1616
using Microsoft.Azure.Common.Authentication.Factories;
1717
using Microsoft.Azure.Common.Authentication.Models;
18-
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
18+
using Microsoft.Azure.Commands.Test.Utilities.Common;
1919
using System;
2020
using System.Collections.Generic;
2121
using Xunit;

src/Common/Authentication/Common.Authentication.Tests/AzureRMProfileTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
using Microsoft.Azure.Common.Authentication;
1616
using Microsoft.Azure.Common.Authentication.Models;
17-
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
17+
using Microsoft.Azure.Commands.Common.Test.Mocks;
1818
using System;
1919
using System.IO;
2020
using System.Runtime.Serialization.Formatters.Binary;

src/Common/Authentication/Common.Authentication.Tests/AzureSMProfileTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
using Microsoft.Azure.Common.Authentication;
1616
using Microsoft.Azure.Common.Authentication.Models;
17-
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
17+
using Microsoft.Azure.Commands.Common.Test.Mocks;
1818
using Newtonsoft.Json;
1919
using System;
2020
using System.Collections.Generic;

src/Common/Authentication/Common.Authentication.Tests/ClientFactoryHandlerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
using Microsoft.Azure.Common.Authentication;
1616
using Microsoft.Azure.Common.Authentication.Models;
17-
using Microsoft.WindowsAzure.Management.Storage;
1817
using System;
1918
using System.Collections.Generic;
2019
using System.Net.Http;
2120
using System.Security;
2221
using Microsoft.Azure.Common.Authentication.Factories;
23-
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
22+
using Microsoft.Azure.Commands.Common.Test.Mocks;
2423
using Xunit;
24+
using Microsoft.Azure.Management.Storage;
2525

2626
namespace Common.Authentication.Test
2727
{

src/Common/Authentication/Common.Authentication.Tests/ClientFactoryTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414

1515
using Microsoft.Azure.Common.Authentication;
1616
using Microsoft.Azure.Common.Authentication.Models;
17-
using Microsoft.WindowsAzure.Management.Storage;
1817
using System;
1918
using System.Collections.Generic;
2019
using System.Linq;
21-
using System.Net.Http;
2220
using System.Security;
2321
using Microsoft.Azure.Common.Authentication.Factories;
24-
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
22+
using Microsoft.Azure.Commands.Common.Test.Mocks;
2523
using Xunit;
24+
using Microsoft.Azure.Management.Storage;
2625

2726
namespace Common.Authentication.Test
2827
{
@@ -100,8 +99,7 @@ public void VerifyClientFactoryWorks()
10099
var client = AzureSession.ClientFactory.CreateClient<StorageManagementClient>(context, AzureEnvironment.Endpoint.ServiceManagement);
101100

102101
// List storage accounts
103-
var storageAccounts = client.StorageAccounts.List().StorageAccounts;
104-
foreach (var storageAccount in storageAccounts)
102+
foreach (var storageAccount in client.StorageAccounts.List())
105103
{
106104
Assert.NotNull(storageAccount);
107105
}

src/Common/Authentication/Common.Authentication.Tests/Common.Authentication.Tests.csproj

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\..\..\packages\xunit.runner.visualstudio.2.0.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.2.0.1\build\net20\xunit.runner.visualstudio.props')" />
3+
<Import Project="..\..\..\packages\xunit.runner.msbuild.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.props" Condition="Exists('..\..\..\packages\xunit.runner.msbuild.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.props')" />
4+
<Import Project="..\..\..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" />
5+
<Import Project="..\..\..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props" Condition="Exists('..\..\..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" />
46
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
57
<PropertyGroup>
68
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -11,7 +13,8 @@
1113
<AssemblyName>Common.Authentication.Tests</AssemblyName>
1214
<FileAlignment>512</FileAlignment>
1315
<RestorePackages>true</RestorePackages>
14-
<NuGetPackageImportStamp>9fdcb6f4</NuGetPackageImportStamp>
16+
<NuGetPackageImportStamp>
17+
</NuGetPackageImportStamp>
1518
<SDKTestProject>true</SDKTestProject>
1619
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1720
<TargetFrameworkProfile />
@@ -34,6 +37,17 @@
3437
<Prefer32Bit>false</Prefer32Bit>
3538
</PropertyGroup>
3639
<ItemGroup>
40+
<Reference Include="System" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net" />
43+
<Reference Include="System.Net.Http" />
44+
<Reference Include="System.Net.Http.WebRequest" />
45+
<Reference Include="System.Runtime.Serialization" />
46+
<Reference Include="Microsoft.Azure.Management.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
47+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.4.0.0-preview\lib\net45\Microsoft.Azure.Management.Storage.dll</HintPath>
48+
<Private>True</Private>
49+
</Reference>
50+
<Reference Include="Microsoft.CSharp" />
3751
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
3852
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.6.210231457-alpha\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
3953
<Private>True</Private>
@@ -46,22 +60,30 @@
4660
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.1.4.1\lib\portable-net45+win8+wpa81\Microsoft.Rest.ClientRuntime.dll</HintPath>
4761
<Private>True</Private>
4862
</Reference>
63+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
64+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.2.1.0\lib\dotnet\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
65+
<Private>True</Private>
66+
</Reference>
4967
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5068
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.1.0.0-preview\lib\portable-net45+win8+wpa81\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
5169
<Private>True</Private>
5270
</Reference>
53-
<Reference Include="Moq">
54-
<HintPath>..\..\..\packages\Moq.4.2.1409.1722\lib\net40\Moq.dll</HintPath>
55-
</Reference>
5671
<Reference Include="Newtonsoft.Json">
5772
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
5873
</Reference>
59-
<Reference Include="xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
60-
<HintPath>..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
74+
<Reference Include="xunit.abstractions">
75+
<HintPath>..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
76+
</Reference>
77+
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
78+
<HintPath>..\..\..\packages\xunit.assert.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
79+
<Private>True</Private>
80+
</Reference>
81+
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
82+
<HintPath>..\..\..\packages\xunit.extensibility.core.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll</HintPath>
6183
<Private>True</Private>
6284
</Reference>
63-
<Reference Include="xunit.extensions, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
64-
<HintPath>..\..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll</HintPath>
85+
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
86+
<HintPath>..\..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
6587
<Private>True</Private>
6688
</Reference>
6789
</ItemGroup>
@@ -133,5 +155,8 @@
133155
<PropertyGroup>
134156
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
135157
</PropertyGroup>
158+
<Error Condition="!Exists('..\..\..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props'))" />
159+
<Error Condition="!Exists('..\..\..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props'))" />
160+
<Error Condition="!Exists('..\..\..\packages\xunit.runner.msbuild.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.runner.msbuild.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.props'))" />
136161
</Target>
137162
</Project>

src/Common/Authentication/Common.Authentication.Tests/ConversionUtilitiesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using System.Collections.Generic;
1717
using Xunit;
1818

19-
namespace Microsoft.WindowsAzure.Commands.Common.Test
19+
namespace Common.Authentication.Test
2020
{
2121
public class ConversionUtilitiesTests
2222
{

src/Common/Authentication/Common.Authentication.Tests/Mocks/MockAccessToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using Microsoft.Azure.Common.Authentication;
1616
using System;
1717

18-
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
18+
namespace Microsoft.Azure.Commands.Common.Test.Mocks
1919
{
2020
public class MockAccessToken : IAccessToken
2121
{

src/Common/Authentication/Common.Authentication.Tests/Mocks/MockAccessTokenProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.Common.Test.Mocks;
1516
using Microsoft.Azure.Common.Authentication;
1617
using Microsoft.Azure.Common.Authentication.Models;
17-
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
1818
using System.Security;
1919

20-
namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
20+
namespace Microsoft.Azure.Commands.Test.Utilities.Common
2121
{
2222
public class MockAccessTokenProvider : ITokenProvider
2323
{
@@ -45,7 +45,7 @@ public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBe
4545
return this.accessToken;
4646
}
4747

48-
public IAccessToken GetAccessTokenWithCertificate(AdalConfiguration config, string clientId, string certificateThumbprint, AzureAccount.AccountType credentialType)
48+
public IAccessToken GetAccessTokenWithCertificate(AdalConfiguration config, string clientId, string certificateThumbprint, string certificatePassword, AzureAccount.AccountType credentialType)
4949
{
5050
AdalConfiguration = config;
5151
return this.accessToken;

src/Common/Authentication/Common.Authentication.Tests/Mocks/MockCertificateAuthenticationFactory.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure;
1615
using Microsoft.Azure.Common.Authentication;
1716
using Microsoft.Azure.Common.Authentication.Models;
17+
using System;
1818
using System.Security;
1919
using System.Security.Cryptography.X509Certificates;
20+
using Microsoft.Rest;
2021

21-
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
22+
namespace Microsoft.Azure.Commands.Common.Test.Mocks
2223
{
2324
public class MockCertificateAuthenticationFactory : IAuthenticationFactory
2425
{
@@ -69,21 +70,23 @@ public IAccessToken Authenticate(
6970
return Authenticate(account, environment, tenant, password, promptBehavior, AzureSession.TokenCache, resourceId);
7071
}
7172

72-
public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context)
73+
public ServiceClientCredentials GetSubscriptionCloudCredentials(AzureContext context)
7374
{
74-
return new CertificateCloudCredentials(context.Subscription.Id.ToString(), Certificate);
75+
throw new NotImplementedException("ADAL 3.6.210231457-alpha does not support certificate based authentication.");
76+
// return new CertificateCredentials(context.Subscription.Id.ToString(), Certificate);
7577
}
7678

7779

78-
public Rest.ServiceClientCredentials GetServiceClientCredentials(AzureContext context)
80+
public ServiceClientCredentials GetServiceClientCredentials(AzureContext context)
7981
{
8082
throw new System.NotImplementedException();
8183
}
8284

8385

84-
public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context, AzureEnvironment.Endpoint targetEndpoint)
86+
public ServiceClientCredentials GetSubscriptionCloudCredentials(AzureContext context, AzureEnvironment.Endpoint targetEndpoint)
8587
{
86-
return new CertificateCloudCredentials(context.Subscription.Id.ToString(), Certificate);
88+
throw new NotImplementedException("ADAL 3.6.210231457-alpha does not support certificate based authentication.");
89+
// return new CertificateCredentials(context.Subscription.Id.ToString(), Certificate);
8790
}
8891
}
8992
}

src/Common/Authentication/Common.Authentication.Tests/Mocks/MockClientFactory.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Hyak.Common;
16-
using Microsoft.Azure;
1715
using Microsoft.Azure.Common.Authentication;
1816
using Microsoft.Azure.Common.Authentication.Models;
17+
using Microsoft.Rest;
1918
using System;
2019
using System.Collections.Generic;
2120
using System.Linq;
2221
using System.Net.Http;
2322
using System.Net.Http.Headers;
2423

25-
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
24+
namespace Microsoft.Azure.Commands.Common.Test.Mocks
2625
{
2726
public class MockClientFactory : IClientFactory
2827
{
@@ -36,15 +35,15 @@ public MockClientFactory(IEnumerable<object> clients)
3635
public TClient CreateClient<TClient>(AzureSMProfile profile, AzureSubscription subscription, AzureEnvironment.Endpoint endpoint)
3736
where TClient : ServiceClient<TClient>
3837
{
39-
SubscriptionCloudCredentials creds = new TokenCloudCredentials(subscription.Id.ToString(), "fake_token");
38+
ServiceClientCredentials creds = new TokenCredentials("fake_token");
4039
Uri endpointUri = profile.Environments[subscription.Environment].GetEndpointAsUri(endpoint);
4140
return CreateCustomClient<TClient>(creds, endpointUri);
4241
}
4342

4443
public TClient CreateClient<TClient>(AzureContext context, AzureEnvironment.Endpoint endpoint)
4544
where TClient : ServiceClient<TClient>
4645
{
47-
SubscriptionCloudCredentials creds = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(context);
46+
ServiceClientCredentials creds = AzureSession.AuthenticationFactory.GetSubscriptionCloudCredentials(context);
4847
return CreateCustomClient<TClient>(creds, context.Environment.GetEndpointAsUri(endpoint));
4948
}
5049

src/Common/Authentication/Common.Authentication.Tests/Mocks/MockDataStore.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
using System.Text;
2222
using System.Text.RegularExpressions;
2323

24-
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
24+
namespace Microsoft.Azure.Commands.Common.Test.Mocks
2525
{
2626
public class MockDataStore : IDataStore
2727
{
@@ -261,15 +261,15 @@ public FileAttributes GetFileAttributes(string path)
261261
}
262262
}
263263

264-
public X509Certificate2 GetCertificate(string thumbprint)
264+
public byte [] GetCertificate(string thumbprint)
265265
{
266266
if (thumbprint != null && certStore.ContainsKey(thumbprint))
267267
{
268-
return certStore[thumbprint];
268+
return certStore[thumbprint].Export(X509ContentType.Pkcs12);
269269
}
270270
else
271271
{
272-
return new X509Certificate2();
272+
return new X509Certificate2().Export(X509ContentType.Pkcs12);
273273
}
274274
}
275275

src/Common/Authentication/Common.Authentication.Tests/Mocks/MockTokenAuthenticationFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using System;
2020
using System.Security;
2121

22-
namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks
22+
namespace Microsoft.Azure.Commands.Common.Test.Mocks
2323
{
2424
public class MockTokenAuthenticationFactory : IAuthenticationFactory
2525
{
@@ -82,7 +82,7 @@ public IAccessToken Authenticate(
8282
return Authenticate(account, environment, tenant, password, promptBehavior, AzureSession.TokenCache, resourceId);
8383
}
8484

85-
public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context)
85+
public ServiceClientCredentials GetSubscriptionCloudCredentials(AzureContext context)
8686
{
8787
return new AccessTokenCredential(context.Subscription.Id, Token);
8888
}
@@ -94,7 +94,7 @@ public ServiceClientCredentials GetServiceClientCredentials(AzureContext context
9494
}
9595

9696

97-
public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context, AzureEnvironment.Endpoint targetEndpoint)
97+
public ServiceClientCredentials GetSubscriptionCloudCredentials(AzureContext context, AzureEnvironment.Endpoint targetEndpoint)
9898
{
9999
return new AccessTokenCredential(context.Subscription.Id, Token);
100100
}

src/Common/Authentication/Common.Authentication.Tests/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
3+
using Xunit;
34

45
// General Information about an assembly is controlled through the following
56
// set of attributes. Change these attribute values to modify the information
@@ -33,3 +34,4 @@
3334
// [assembly: AssemblyVersion("1.0.*")]
3435
[assembly: AssemblyVersion("1.0.0.0")]
3536
[assembly: AssemblyFileVersion("1.0.0.0")]
37+
[assembly: CollectionBehavior(MaxParallelThreads = 1, DisableTestParallelization = true)]
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Microsoft.Azure.Management.Storage" version="4.0.0-preview" targetFramework="net452" />
34
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.6.210231457-alpha" targetFramework="net45" />
45
<package id="Microsoft.Rest.ClientRuntime" version="1.4.1" targetFramework="net45" />
6+
<package id="Microsoft.Rest.ClientRuntime.Azure" version="2.1.0" targetFramework="net452" />
57
<package id="Microsoft.Rest.ClientRuntime.Azure.Authentication" version="1.0.0-preview" targetFramework="net45" />
6-
<package id="Moq" version="4.2.1409.1722" targetFramework="net45" />
78
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
8-
<package id="xunit" version="1.9.2" targetFramework="net45" />
9-
<package id="xunit.extensions" version="1.9.2" targetFramework="net45" />
10-
<package id="xunit.runner.visualstudio" version="2.0.1" targetFramework="net45" />
9+
<package id="xunit" version="2.1.0" targetFramework="net45" />
10+
<package id="xunit.abstractions" version="2.0.0" targetFramework="net451" />
11+
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
12+
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
13+
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
14+
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
15+
<package id="xunit.extensions" version="2.0.0" targetFramework="net451" />
16+
<package id="xunit.runner.msbuild" version="2.1.0" targetFramework="net45" />
17+
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net452" />
1118
</packages>

src/Common/Authentication/Common.Authentication/Factories/ClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ public virtual TClient CreateClient<TClient>(AzureContext context, AzureEnvironm
113113

114114
ServiceClientCredentials creds = AuthenticationFactory.GetSubscriptionCloudCredentials(context, endpoint);
115115
TClient client = CreateCustomClient<TClient>(
116+
context.Environment.GetEndpointAsUri(endpoint),
116117
creds,
117-
context.Environment.GetEndpointAsUri(endpoint),
118118
GetCustomHandlers());
119119

120120
return client;

0 commit comments

Comments
 (0)