Skip to content

Commit

Permalink
{Compute} Set audience when creating LogsQueryClient (#30787)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiasli authored Feb 12, 2025
1 parent 9979299 commit ab64e83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/azure-cli/azure/cli/command_modules/vm/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ def cf_log_analytics_data_plane(cli_ctx, _):
from azure.monitor.query import LogsQueryClient
from azure.cli.core._profile import Profile
profile = Profile(cli_ctx=cli_ctx)
cred, _, _ = profile.get_login_credentials(
resource=cli_ctx.cloud.endpoints.log_analytics_resource_id)
cred, _, _ = profile.get_login_credentials()
api_version = 'v1'
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version)
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version,
audience=cli_ctx.cloud.endpoints.log_analytics_resource_id)


def cf_disk_encryption_set(cli_ctx, _):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ def cf_log_analytics_data_plane(cli_ctx, _):
from azure.monitor.query import LogsQueryClient
from azure.cli.core._profile import Profile
profile = Profile(cli_ctx=cli_ctx)
cred, _, _ = profile.get_login_credentials(
resource=cli_ctx.cloud.endpoints.log_analytics_resource_id)
cred, _, _ = profile.get_login_credentials()
api_version = 'v1'
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version)
return LogsQueryClient(cred, endpoint=cli_ctx.cloud.endpoints.log_analytics_resource_id + '/' + api_version,
audience=cli_ctx.cloud.endpoints.log_analytics_resource_id)


def cf_disk_encryption_set(cli_ctx, _):
Expand Down

0 comments on commit ab64e83

Please sign in to comment.