azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Unsafe use of HttpClient per request

Open changov opened this issue 8 years ago • 4 comments

https://github.com/Azure/azure-powershell/blob/bbe5ee957de07032bcf7f9062bba91cceee62565/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/RestClients/ResourceManagerRestClientBase.cs#L221

The proper usage is [finally] documented in the Remarks section here: https://msdn.microsoft.com/en-us/library/system.net.http.httpclient%28v=vs.110%29.aspx . Here's a sample report of what happens with per-request instance of HttpClient: https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/ .

changov avatar Jul 07 '18 22:07 changov

@Tiano2017 @ravbhatnagar would you mind taking a look at this issue?

cormacpayne avatar Jul 10 '18 21:07 cormacpayne

This is a valid ask. We'll create a work item to fix these.

Tiano2017 avatar Oct 25 '19 22:10 Tiano2017

:bell: Routing this issue to @act-identity-squad.

Thanks for the report, this is in the retired AzureRm module's REST client. Az.Resources uses the SDK's managed HttpClient which handles reuse correctly. Closing as obsolete.

MaddyMicrosoft avatar Aug 04 '26 08:08 MaddyMicrosoft