-
Notifications
You must be signed in to change notification settings - Fork 56
set subscription id and tenant id in telemetry if it's null #427
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
Conversation
isra-fel
left a comment
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.
PR itself looks good.
If we do this, does it make the logic of setting sub id in AzureRMCmdlet.BeginProcessing duplicate, and can we remove that?
Also, this will impact cmdlets that do not inherit AzureRMCmdlet . Please ensure we have tested that scneario. Thanks.
@isra-fel , according to your comment, I changed the update and test the below cmdlets. Their subscription ids and tenant ids are recorded correctly now.
|
|
|
||
| IAzureContext context; | ||
| _qosEvent.Uid = "defaultid"; | ||
| if (RequireDefaultContext() && TryGetDefaultContext(out context)) |
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.
Need more time to check if it's safe to remove RequireDefaultContext. Will catch up next week
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.
@YanaXu can you test running some cmdlets that doesn't require a context after clearing the context? They should still work without a context.
Examples are the *DataCollection and ContextAutoSave cmdlets.
isra-fel
left a comment
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.
PR looks good if we verified the above cmdlets
It's for
Content-AzAccount. When it's run, the subscription id and tenant id is not set in context. That's why they are empty in telemetry.This PR is going to set them before recording the telemetry.