-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Storage} Enable logging for track2 data plane operations #16439
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
|
Storage |
| sas_token = kwargs.pop('sas_token', None) | ||
|
|
||
| # Enable NetworkTraceLoggingPolicy which logs all headers (except Authorization) without being redacted | ||
| client_kwargs['logging_enable'] = True |
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.
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.
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.
done
| token_credential = kwargs.pop('token_credential', None) | ||
| sas_token = kwargs.pop('sas_token', None) | ||
|
|
||
| client_kwargs.update(_prepare_client_kwargs_track2(cli_ctx)) |
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.
We can simply use client_kwargs = _prepare_client_kwargs_track2(cli_ctx) if there is no modification before this line.
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.
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 |
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.
Good to know _prepare_client_kwargs_track2 is useful for date-plane SDKs.
evelyn-ys
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.
Is this pr duplicated with #16474
No. They are for different kwargs. |
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.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.