Skip to content

Commit ab64e83

Browse files
authored
{Compute} Set audience when creating LogsQueryClient (#30787)
1 parent 9979299 commit ab64e83

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/azure-cli/azure/cli/command_modules/vm/_client_factory.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ def cf_log_analytics_data_plane(cli_ctx, _):
126126
from azure.monitor.query import LogsQueryClient
127127
from azure.cli.core._profile import Profile
128128
profile = Profile(cli_ctx=cli_ctx)
129-
cred, _, _ = profile.get_login_credentials(
130-
resource=cli_ctx.cloud.endpoints.log_analytics_resource_id)
129+
cred, _, _ = profile.get_login_credentials()
131130
api_version = 'v1'
132-
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version)
131+
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version,
132+
audience=cli_ctx.cloud.endpoints.log_analytics_resource_id)
133133

134134

135135
def cf_disk_encryption_set(cli_ctx, _):

src/azure-cli/azure/cli/command_modules/vm/azure_stack/_client_factory.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ def cf_log_analytics_data_plane(cli_ctx, _):
126126
from azure.monitor.query import LogsQueryClient
127127
from azure.cli.core._profile import Profile
128128
profile = Profile(cli_ctx=cli_ctx)
129-
cred, _, _ = profile.get_login_credentials(
130-
resource=cli_ctx.cloud.endpoints.log_analytics_resource_id)
129+
cred, _, _ = profile.get_login_credentials()
131130
api_version = 'v1'
132-
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version)
131+
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version,
132+
audience=cli_ctx.cloud.endpoints.log_analytics_resource_id)
133133

134134

135135
def cf_disk_encryption_set(cli_ctx, _):

0 commit comments

Comments
 (0)