diff --git a/src/ssh/azext_ssh/constants.py b/src/ssh/azext_ssh/constants.py index b75c616cf7c..485504bb754 100644 --- a/src/ssh/azext_ssh/constants.py +++ b/src/ssh/azext_ssh/constants.py @@ -5,6 +5,7 @@ from colorama import Fore from colorama import Style +AADSSHLOGINFORLINUX_SERVER_APP_ID = 'ce6ff14a-7fdc-4685-bbe0-f6afdfcfa8e0' AGENT_MINIMUM_VERSION_MAJOR = 1 AGENT_MINIMUM_VERSION_MINOR = 31 CLIENT_PROXY_VERSION = "1.3.026973" diff --git a/src/ssh/azext_ssh/custom.py b/src/ssh/azext_ssh/custom.py index 13baf9e3388..0123fff6121 100644 --- a/src/ssh/azext_ssh/custom.py +++ b/src/ssh/azext_ssh/custom.py @@ -205,18 +205,9 @@ def _do_ssh_op(cmd, op_info, op_call): def _get_and_write_certificate(cmd, public_key_file, cert_file, ssh_client_folder): - cloudtoscope = { - "azurecloud": "https://pas.windows.net/CheckMyAccess/Linux/.default", - "azurechinacloud": "https://pas.chinacloudapi.cn/CheckMyAccess/Linux/.default", - "azureusgovernment": "https://pasff.usgovcloudapi.net/CheckMyAccess/Linux/.default" - } - scope = cloudtoscope.get(cmd.cli_ctx.cloud.name.lower(), None) - if not scope: - raise azclierror.InvalidArgumentValueError( - f"Unsupported cloud {cmd.cli_ctx.cloud.name.lower()}", - "Supported clouds include azurecloud,azurechinacloud,azureusgovernment") - + scope = f'{const.AADSSHLOGINFORLINUX_SERVER_APP_ID}/.default' scopes = [scope] + data = _prepare_jwk_data(public_key_file) from azure.cli.core._profile import Profile profile = Profile(cli_ctx=cmd.cli_ctx)