Skip to content

Commit 3dbbbe0

Browse files
authored
Bugfix (Azure#481)
* Fix for RetryPolicy DelegatingHandler * Fixed the actual issue. * Changed ExpandableStringEnum to use ConcurrentDictionary. * Removed CR nuget package from the localfeed.
1 parent fb77cce commit 3dbbbe0

File tree

61 files changed

+274
-5369
lines changed

Some content is hidden

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

61 files changed

+274
-5369
lines changed

NuGet.Config

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<!-- To Enable LocalFeed for testing uncomment the following line -->
54
<add key="NugetOfficialV3" value="https://api.nuget.org/v3/index.json" />
6-
<add key="Local" value="tools/LocalNugetFeed" />
5+
<!-- To Enable LocalFeed for testing uncomment the following line -->
6+
<!-- <add key="Local" value="tools/LocalNugetFeed" /> -->
77
</packageSources>
88
</configuration>

Samples/Samples.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<ItemGroup>
3131
<PackageReference Include="Microsoft.Azure.KeyVault" Version="2.3.2" />
32-
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.13" />
32+
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.15" />
3333
<PackageReference Include="CoreFTP" Version="1.2.0" />
3434
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="0.0.2-preview" />
3535
<PackageReference Include="SSH.NET" Version="2016.0.0" />

Tests/AzSdk.test.reference.props

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<Import Project="$([MSBuild]::GetPathOfFileAbove('test.props'))" />
33
<ItemGroup>
4-
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.13" />
54
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.3.4" />
6-
<PackageReference Include="Microsoft.Azure.Test.HttpRecorder" Version="1.11.0" />
5+
<PackageReference Include="Microsoft.Azure.Test.HttpRecorder" Version="1.12.0" />
76
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="1.7.4" />
87
<PackageReference Include="SSH.NET" Version="2016.0.0" />
98
<PackageReference Include="WindowsAzure.Storage" Version="8.1.4" />

src/AzSdk.reference.props

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<Import Project="$([MSBuild]::GetPathOfFileAbove('AzSdk.props'))" />
33
<ItemGroup>
4-
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="[3.3.15, 4.0.0)" />
4+
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="[2.3.15, 3.0.0)" />
5+
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="[3.3.16, 4.0.0)" />
56
</ItemGroup>
67

78
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">

src/ResourceManagement/AppService/AppServiceManager.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ public class AppServiceManager : Manager<IWebSiteManagementClient>, IAppServiceM
3434
#region ctrs
3535

3636
public AppServiceManager(RestClient restClient, string subscriptionId, string tenantId) :
37-
base(restClient, subscriptionId, new WebSiteManagementClient(new Uri(restClient.BaseUri),
38-
restClient.Credentials,
39-
restClient.RootHttpHandler,
40-
restClient.Handlers.ToArray())
37+
base(restClient, subscriptionId, new WebSiteManagementClient(restClient)
4138
{
4239
SubscriptionId = subscriptionId
4340
})

src/ResourceManagement/AppService/Generated/WebSiteManagementClient.cs

+5-195
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Microsoft.Azure.Management.AppService.Fluent
1010
{
11+
using Microsoft.Azure.Management.ResourceManager.Fluent.Core;
1112
using Microsoft.Rest;
1213
using Microsoft.Rest.Azure;
1314
using Microsoft.Rest.Serialization;
@@ -24,13 +25,8 @@ namespace Microsoft.Azure.Management.AppService.Fluent
2425
/// <summary>
2526
/// WebSite Management Client
2627
/// </summary>
27-
public partial class WebSiteManagementClient : ServiceClient<WebSiteManagementClient>, IWebSiteManagementClient, IAzureClient
28+
public partial class WebSiteManagementClient : FluentServiceClientBase<WebSiteManagementClient>, IWebSiteManagementClient, IAzureClient
2829
{
29-
/// <summary>
30-
/// The base URI of the service.
31-
/// </summary>
32-
public System.Uri BaseUri { get; set; }
33-
3430
/// <summary>
3531
/// Gets or sets json serialization settings.
3632
/// </summary>
@@ -41,11 +37,6 @@ public partial class WebSiteManagementClient : ServiceClient<WebSiteManagementCl
4137
/// </summary>
4238
public JsonSerializerSettings DeserializationSettings { get; private set; }
4339

44-
/// <summary>
45-
/// Credentials needed for the client to connect to Azure.
46-
/// </summary>
47-
public ServiceClientCredentials Credentials { get; private set; }
48-
4940
/// <summary>
5041
/// Your Azure subscription ID. This is a GUID-formatted string (e.g.
5142
/// 00000000-0000-0000-0000-000000000000).
@@ -143,193 +134,12 @@ public partial class WebSiteManagementClient : ServiceClient<WebSiteManagementCl
143134
/// <summary>
144135
/// Initializes a new instance of the WebSiteManagementClient class.
145136
/// </summary>
146-
/// <param name='handlers'>
147-
/// Optional. The delegating handlers to add to the http client pipeline.
148-
/// </param>
149-
protected WebSiteManagementClient(params DelegatingHandler[] handlers) : base(handlers)
150-
{
151-
Initialize();
152-
}
153-
154-
/// <summary>
155-
/// Initializes a new instance of the WebSiteManagementClient class.
156-
/// </summary>
157-
/// <param name='rootHandler'>
158-
/// Optional. The http client handler used to handle http transport.
159-
/// </param>
160-
/// <param name='handlers'>
161-
/// Optional. The delegating handlers to add to the http client pipeline.
162-
/// </param>
163-
protected WebSiteManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
164-
{
165-
Initialize();
166-
}
167-
168-
/// <summary>
169-
/// Initializes a new instance of the WebSiteManagementClient class.
170-
/// </summary>
171-
/// <param name='baseUri'>
172-
/// Optional. The base URI of the service.
173-
/// </param>
174-
/// <param name='handlers'>
175-
/// Optional. The delegating handlers to add to the http client pipeline.
176-
/// </param>
177-
/// <exception cref="System.ArgumentNullException">
178-
/// Thrown when a required parameter is null
179-
/// </exception>
180-
protected WebSiteManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
181-
{
182-
if (baseUri == null)
183-
{
184-
throw new System.ArgumentNullException("baseUri");
185-
}
186-
BaseUri = baseUri;
187-
}
188-
189-
/// <summary>
190-
/// Initializes a new instance of the WebSiteManagementClient class.
191-
/// </summary>
192-
/// <param name='baseUri'>
193-
/// Optional. The base URI of the service.
194-
/// </param>
195-
/// <param name='rootHandler'>
196-
/// Optional. The http client handler used to handle http transport.
197-
/// </param>
198-
/// <param name='handlers'>
199-
/// Optional. The delegating handlers to add to the http client pipeline.
200-
/// </param>
201-
/// <exception cref="System.ArgumentNullException">
202-
/// Thrown when a required parameter is null
203-
/// </exception>
204-
protected WebSiteManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
205-
{
206-
if (baseUri == null)
207-
{
208-
throw new System.ArgumentNullException("baseUri");
209-
}
210-
BaseUri = baseUri;
211-
}
212-
213-
/// <summary>
214-
/// Initializes a new instance of the WebSiteManagementClient class.
215-
/// </summary>
216-
/// <param name='credentials'>
217-
/// Required. Credentials needed for the client to connect to Azure.
218-
/// </param>
219-
/// <param name='handlers'>
220-
/// Optional. The delegating handlers to add to the http client pipeline.
221-
/// </param>
222137
/// <exception cref="System.ArgumentNullException">
223138
/// Thrown when a required parameter is null
224139
/// </exception>
225-
public WebSiteManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
140+
public WebSiteManagementClient(RestClient restClient)
141+
: base(restClient)
226142
{
227-
if (credentials == null)
228-
{
229-
throw new System.ArgumentNullException("credentials");
230-
}
231-
Credentials = credentials;
232-
if (Credentials != null)
233-
{
234-
Credentials.InitializeServiceClient(this);
235-
}
236-
}
237-
238-
/// <summary>
239-
/// Initializes a new instance of the WebSiteManagementClient class.
240-
/// </summary>
241-
/// <param name='credentials'>
242-
/// Required. Credentials needed for the client to connect to Azure.
243-
/// </param>
244-
/// <param name='rootHandler'>
245-
/// Optional. The http client handler used to handle http transport.
246-
/// </param>
247-
/// <param name='handlers'>
248-
/// Optional. The delegating handlers to add to the http client pipeline.
249-
/// </param>
250-
/// <exception cref="System.ArgumentNullException">
251-
/// Thrown when a required parameter is null
252-
/// </exception>
253-
public WebSiteManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
254-
{
255-
if (credentials == null)
256-
{
257-
throw new System.ArgumentNullException("credentials");
258-
}
259-
Credentials = credentials;
260-
if (Credentials != null)
261-
{
262-
Credentials.InitializeServiceClient(this);
263-
}
264-
}
265-
266-
/// <summary>
267-
/// Initializes a new instance of the WebSiteManagementClient class.
268-
/// </summary>
269-
/// <param name='baseUri'>
270-
/// Optional. The base URI of the service.
271-
/// </param>
272-
/// <param name='credentials'>
273-
/// Required. Credentials needed for the client to connect to Azure.
274-
/// </param>
275-
/// <param name='handlers'>
276-
/// Optional. The delegating handlers to add to the http client pipeline.
277-
/// </param>
278-
/// <exception cref="System.ArgumentNullException">
279-
/// Thrown when a required parameter is null
280-
/// </exception>
281-
public WebSiteManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
282-
{
283-
if (baseUri == null)
284-
{
285-
throw new System.ArgumentNullException("baseUri");
286-
}
287-
if (credentials == null)
288-
{
289-
throw new System.ArgumentNullException("credentials");
290-
}
291-
BaseUri = baseUri;
292-
Credentials = credentials;
293-
if (Credentials != null)
294-
{
295-
Credentials.InitializeServiceClient(this);
296-
}
297-
}
298-
299-
/// <summary>
300-
/// Initializes a new instance of the WebSiteManagementClient class.
301-
/// </summary>
302-
/// <param name='baseUri'>
303-
/// Optional. The base URI of the service.
304-
/// </param>
305-
/// <param name='credentials'>
306-
/// Required. Credentials needed for the client to connect to Azure.
307-
/// </param>
308-
/// <param name='rootHandler'>
309-
/// Optional. The http client handler used to handle http transport.
310-
/// </param>
311-
/// <param name='handlers'>
312-
/// Optional. The delegating handlers to add to the http client pipeline.
313-
/// </param>
314-
/// <exception cref="System.ArgumentNullException">
315-
/// Thrown when a required parameter is null
316-
/// </exception>
317-
public WebSiteManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
318-
{
319-
if (baseUri == null)
320-
{
321-
throw new System.ArgumentNullException("baseUri");
322-
}
323-
if (credentials == null)
324-
{
325-
throw new System.ArgumentNullException("credentials");
326-
}
327-
BaseUri = baseUri;
328-
Credentials = credentials;
329-
if (Credentials != null)
330-
{
331-
Credentials.InitializeServiceClient(this);
332-
}
333143
}
334144

335145
/// <summary>
@@ -339,7 +149,7 @@ public WebSiteManagementClient(System.Uri baseUri, ServiceClientCredentials cred
339149
/// <summary>
340150
/// Initializes client properties.
341151
/// </summary>
342-
private void Initialize()
152+
protected override void Initialize()
343153
{
344154
AppServiceCertificateOrders = new AppServiceCertificateOrdersOperations(this);
345155
CertificateRegistrationProvider = new CertificateRegistrationProviderOperations(this);

src/ResourceManagement/Batch/BatchManager.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ public class BatchManager : Manager<IBatchManagementClient>, IBatchManager
1515
private IBatchAccounts batchAccounts;
1616

1717
public BatchManager(RestClient restClient, string subscriptionId) :
18-
base(restClient, subscriptionId, new BatchManagementClient(new Uri(restClient.BaseUri),
19-
restClient.Credentials,
20-
restClient.RootHttpHandler,
21-
restClient.Handlers.ToArray())
18+
base(restClient, subscriptionId, new BatchManagementClient(restClient)
2219
{
2320
SubscriptionId = subscriptionId
2421
})

0 commit comments

Comments
 (0)