-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set UserAgent for ARM telemetry #428
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve with minor comments
AzureSession.Instance.ClientFactory.AddUserAgent(hostEnv); | ||
} | ||
} | ||
catch (Exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are try-catch AddUserAgent()
, does it make sense to wrap all AddUserAgent()
calls in it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are try-catch
AddUserAgent()
, does it make sense to wrap allAddUserAgent()
calls in it?
Here is AzureSession.Instance.ClientFactory.AddUserAgent(hostEnv);
. Below is ClientFactory.RemoveUserAgent(hostEnv);
. The Client part is UserAgent += string.Format(" {0}", hostEnv);
I can't merge them together.
AzureSession.Instance.ClientFactory.RemoveUserAgent(hostEnv); | ||
} | ||
} | ||
catch (Exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add a catch here just in case the env var is not OK for setting UserAgent, we'll ignore it.
This PR is to set UserAgent for ARM request in case of SDK-based cmdlets.
And it fixes the bug of dumplicated CommandName and ParameterSetName.