Skip to content

Conversation

@Juliehzl
Copy link
Contributor

@Juliehzl Juliehzl commented Jan 7, 2021

Description

In track2 SDK, we have to configure the client to enable logging. Otherwise cx could not see the rest info.
Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


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

@yonzhan yonzhan added this to the S181 milestone Jan 7, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 7, 2021

Storage

@Juliehzl Juliehzl requested a review from jiasli January 8, 2021 07:15
sas_token = kwargs.pop('sas_token', None)

# Enable NetworkTraceLoggingPolicy which logs all headers (except Authorization) without being redacted
client_kwargs['logging_enable'] = True
Copy link
Member

@jiasli jiasli Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same line is repeated 3 times. Is it possible to extract a common util func?

We can also azure.cli.core.commands.client_factory._prepare_client_kwargs_track2 directly if it is suitable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Juliehzl Juliehzl requested review from evelyn-ys and jiasli January 9, 2021 14:07
token_credential = kwargs.pop('token_credential', None)
sas_token = kwargs.pop('sas_token', None)

client_kwargs.update(_prepare_client_kwargs_track2(cli_ctx))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can simply use client_kwargs = _prepare_client_kwargs_track2(cli_ctx) if there is no modification before this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. updated


from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_data_service_client
from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_data_service_client, \
_prepare_client_kwargs_track2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know _prepare_client_kwargs_track2 is useful for date-plane SDKs.

Copy link
Member

@evelyn-ys evelyn-ys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this pr duplicated with #16474

@Juliehzl
Copy link
Contributor Author

Is this pr duplicated with #16474

No. They are for different kwargs.

@Juliehzl Juliehzl merged commit 785d8f4 into Azure:dev Jan 13, 2021
@Juliehzl Juliehzl deleted the log branch January 13, 2021 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants