Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ def _create_identity_instance(cli_ctx, *args, **kwargs):

# PREVIEW: On Windows, use core.allow_broker=true to use broker (WAM) for authentication.
allow_broker = cli_ctx.config.getboolean('core', 'allow_broker', fallback=False)
from .telemetry import set_broker_info
set_broker_info(allow_broker=allow_broker)

return Identity(*args, encrypt=encrypt, use_msal_http_cache=use_msal_http_cache, allow_broker=allow_broker,
**kwargs)
8 changes: 8 additions & 0 deletions src/azure-cli-core/azure/cli/core/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self, correlation_id=None, application=None):
self.suppress_new_event = False
self.poll_start_time = None
self.poll_end_time = None
self.allow_broker = None

def add_event(self, name, properties):
for key in self.instrumentation_key:
Expand Down Expand Up @@ -206,6 +207,7 @@ def _get_azure_cli_properties(self):
set_custom_properties(result, 'PollEndTime', str(self.poll_end_time))
set_custom_properties(result, 'CloudName', _get_cloud_name())
set_custom_properties(result, 'ShowSurveyMessage', str(self.show_survey_message))
set_custom_properties(result, 'AllowBroker', str(self.allow_broker))

return result

Expand Down Expand Up @@ -425,6 +427,12 @@ def set_survey_info(show_survey_message):
_session.show_survey_message = show_survey_message


@decorators.suppress_all_exceptions()
def set_broker_info(allow_broker):
# whether customer has configured `allow_broker` to enable WAM(Web Account Manager) login for authentication
_session.allow_broker = allow_broker


@decorators.suppress_all_exceptions()
def add_dedicated_instrumentation_key(dedicated_instrumentation_key):
if not dedicated_instrumentation_key:
Expand Down