Closed collinstevens closed 3 years ago
Sorry for late response. @collinstevens Hi Collin could you share your code sample, the expected hehavior, and the actual behavior with us? Thanks
@isra-fel I don't have an issue with the usage of the API; I'm asking for documentation as to why the ServiceClient performs this operation and preferably a way to opt out of it.
User agent header allows us to categorize client library info to aid better support and SDK retirement decisions. There is no PII information in it. If you really want to override it, you can pass in a DelegatingHandler similar to this to override.
var wsmClient = new WebSiteManagementClient(cred, new DelegatingHandler[] { new UserAgentDelegatingHandler() })
Also, we are working on the new Azure.Core based management SDKs. This library will only be updated for critical and security fixes at this point. If you have a similar request/suggestion for Azure.Core, please open a separate feature request. Thanks!
Query/Question Why does SetDefaultAgentInfo exist in Microsoft.Rest.ClientRuntime?
This is appending the name type name of our AutoRest clients which use ServiceClient as base class to the UserAgent of the HttpClient given to the AutoRest client. We also share a single HttpClient across multiple AutoRest clients which causes a chain of type names in the UserAgent. There seems to be no way to opt out of this behavior from looking at the source.
If I am using the constructor which takes an HttpClient, I shoud be able to opt-out of this behavior or it shouldn't do it in the first place.
Environment: Microsoft.Rest.ClientRuntime.2.3.20\lib\net461\Microsoft.Rest.ClientRuntime.dll