Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/azure-cli/azure/cli/command_modules/role/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@

helps['ad sp create-for-rbac'] = """
type: command
short-summary: Create a service principal and configure its access to Azure resources.
short-summary: >
Create an application and its associated service principal, optionally configure the service principal's
RBAC role assignments.
long-summary: >-
The output includes credentials that you must protect. Be sure that you do not include these credentials
in your code or check the credentials into your source control. As an alternative, consider using
Expand Down
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/role/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ def load_arguments(self, _):
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())
c.argument('service_management_reference',
help='Set the serviceManagementReference property of the created application. '
'Reference application or service contact information from a Service or Asset Management '
'database.')

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')
Expand Down
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/role/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,9 @@ def list_service_principal_owners(client, identifier):
# pylint: disable=inconsistent-return-statements
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,
cmd, display_name=None,
service_management_reference=None,
years=None, create_cert=False, cert=None, scopes=None, role=None,
show_auth_in_json=None, skip_assignment=False, keyvault=None):
import time

Expand Down Expand Up @@ -1249,6 +1251,7 @@ def create_service_principal_for_rbac(
aad_application = create_application(cmd,
graph_client,
app_display_name,
service_management_reference=service_management_reference,
key_value=public_cert_string,
start_date=app_start_date,
end_date=app_end_date)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ ad app federated-credential delete:
federated_identity_credential_id_or_name:
rule_exclusions:
- option_length_too_long
ad sp create-for-rbac:
parameters:
service_management_reference:
rule_exclusions:
- option_length_too_long
role assignment list:
parameters:
fill_role_definition_name:
Expand Down
Loading