-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{Containerapp} Use get_mgmt_service_client
to create ServiceLinkerManagementClient
#30799
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
resource = cmd.cli_ctx.cloud.endpoints.active_directory_resource_id | ||
profile = Profile(cli_ctx=cmd.cli_ctx) | ||
credential, subscription_id, _ = profile.get_login_credentials( | ||
subscription_id=get_subscription_id(cmd.cli_ctx), resource=resource) |
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.
resource
will be dropped by Track 1 SDK authentication removal (#29631).
get_mgmt_service_client
takes care of passing credential_scopes
.
linker_client = ServiceLinkerManagementClient(credential) | ||
return linker_client | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
return get_mgmt_service_client(cmd.cli_ctx, ServiceLinkerManagementClient) |
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 logic of get_subscription_id
is already covered by get_mgmt_service_client
.
Related command
Description
Mgmt-plane SDK client should be created by
get_mgmt_service_client
, not manually created.