Skip to content

{Core} Enrich user-agent for az rest#15472

Merged
houk-ms merged 2 commits intoAzure:devfrom
houk-ms:azrest-useragent
Oct 22, 2020
Merged

{Core} Enrich user-agent for az rest#15472
houk-ms merged 2 commits intoAzure:devfrom
houk-ms:azrest-useragent

Conversation

@houk-ms
Copy link
Contributor

@houk-ms houk-ms commented Oct 10, 2020

Description

This PR adds more properties into az rest user-agent, making it align with the python-sdk based requests. This is suggested by our PM Arun so that we can get the python version and os info from the user agents.

Currently, a common user agent from az rest based requests could be

AZURECLI/2.11.1 (RPM)

a common user agent from python-sdk based requests could be

python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.18 msrest_azure/0.6.3 azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.12.1 (PIP)

The PR adds the following properties into az rest user agents:

  • python-version
  • os detail

These properties won't be added because they are not the dependencies of az rest.

  • msrest version
  • msrest_azure version

Testing Guide

Run the az rest command, e.g,

az rest --method GET --uri 'https://graph.microsoft.com/v1.0/applications/b4e4d2ab-e2cb-45d5-a31a-98eb3f364001' --debug

Previously, the userAgent is

AZURECLI/2.12.1 (PIP)

Now, the userAgent is

python/3.8.2 (Windows-10-10.0.18362-SP0) AZURECLI/2.12.1 (PIP)

This checklist is used to make sure that common guidelines for a pull request are followed.

@houk-ms
Copy link
Contributor Author

houk-ms commented Oct 22, 2020

An exmaple of the az rest UserAgent now: python/3.8.2 (Windows-10-10.0.18362-SP0) AZURECLI/2.12.1 (PIP)

@houk-ms houk-ms merged commit d2d6393 into Azure:dev Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants