diff --git a/src/azure-cli-core/azure/cli/core/_profile.py b/src/azure-cli-core/azure/cli/core/_profile.py index 58aa33340b4..69cee2da36d 100644 --- a/src/azure-cli-core/azure/cli/core/_profile.py +++ b/src/azure-cli-core/azure/cli/core/_profile.py @@ -640,8 +640,8 @@ def refresh_accounts(self): self._set_subscriptions(result, merge=False) def get_sp_auth_info(self, subscription_id=None, name=None, password=None, cert_file=None): - """Generate a JSON for --sdk-auth argument when used in: - - az ad sp create-for-rbac --sdk-auth + """Generate a JSON for --json-auth argument when used in: + - az ad sp create-for-rbac --json-auth """ from collections import OrderedDict account = self.get_subscription(subscription_id) diff --git a/src/azure-cli/azure/cli/command_modules/role/_params.py b/src/azure-cli/azure/cli/command_modules/role/_params.py index 101fc5219c2..8ca8ff36242 100644 --- a/src/azure-cli/azure/cli/command_modules/role/_params.py +++ b/src/azure-cli/azure/cli/command_modules/role/_params.py @@ -179,8 +179,10 @@ def load_arguments(self, _): help='Role of the service principal.') c.argument('skip_assignment', arg_type=get_three_state_flag(), deprecate_info=c.deprecate(target='--skip-assignment', hide=True), help='No-op.') - c.argument('show_auth_for_sdk', options_list='--sdk-auth', deprecate_info=c.deprecate(target='--sdk-auth'), - help='output result in compatible with Azure SDK auth file', arg_type=get_three_state_flag()) + c.argument('show_auth_in_json', options_list=['--sdk-auth', '--json-auth'], + deprecate_info=c.deprecate(target='--sdk-auth'), + help='Output service principal credential along with cloud endpoints in JSON format. ', + arg_type=get_three_state_flag()) with self.argument_context('ad sp owner list') as c: c.argument('identifier', options_list=['--id'], help='service principal name, or object id or the service principal') diff --git a/src/azure-cli/azure/cli/command_modules/role/custom.py b/src/azure-cli/azure/cli/command_modules/role/custom.py index fe1fa3bc347..9f52c478517 100644 --- a/src/azure-cli/azure/cli/command_modules/role/custom.py +++ b/src/azure-cli/azure/cli/command_modules/role/custom.py @@ -1157,7 +1157,7 @@ def list_service_principal_owners(client, identifier): def create_service_principal_for_rbac( # pylint:disable=too-many-statements,too-many-locals, too-many-branches, unused-argument cmd, display_name=None, years=None, create_cert=False, cert=None, scopes=None, role=None, - show_auth_for_sdk=None, skip_assignment=False, keyvault=None): + show_auth_in_json=None, skip_assignment=False, keyvault=None): import time if role and not scopes or not role and scopes: @@ -1272,7 +1272,7 @@ def create_service_principal_for_rbac( logger.warning(CREDENTIAL_WARNING) - if show_auth_for_sdk: + if show_auth_in_json: from azure.cli.core._profile import Profile profile = Profile(cli_ctx=cmd.cli_ctx) result = profile.get_sp_auth_info(scopes[0].split('/')[2] if scopes else None,