Azure / azure-powershell-common

Microsoft Azure PowerShell common components
Other
35 stars 56 forks source link

set subscription id and tenant id in telemetry if it's null #427

Closed YanaXu closed 3 weeks ago

YanaXu commented 1 month ago

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.

YanaXu commented 1 month ago

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.