Skip to content

Commit 99d7967

Browse files
committed
service_management_reference
1 parent 6f3fa67 commit 99d7967

File tree

5 files changed

+604
-2
lines changed

5 files changed

+604
-2
lines changed

src/azure-cli/azure/cli/command_modules/role/_help.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@
516516

517517
helps['ad sp create-for-rbac'] = """
518518
type: command
519-
short-summary: Create a service principal and configure its access to Azure resources.
519+
short-summary: >
520+
Create an application and its associated service principal, optionally configure its RBAC role assignments.
520521
long-summary: >-
521522
The output includes credentials that you must protect. Be sure that you do not include these credentials
522523
in your code or check the credentials into your source control. As an alternative, consider using

src/azure-cli/azure/cli/command_modules/role/_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ def load_arguments(self, _):
198198
deprecate_info=c.deprecate(target='--sdk-auth'),
199199
help='Output service principal credential along with cloud endpoints in JSON format. ',
200200
arg_type=get_three_state_flag())
201+
c.argument('service_management_reference',
202+
help='Set the serviceManagementReference property of the created application. '
203+
'Reference application or service contact information from a Service or Asset Management '
204+
'database.')
201205

202206
with self.argument_context('ad sp owner list') as c:
203207
c.argument('identifier', options_list=['--id'], help='service principal name, or object id or the service principal')

src/azure-cli/azure/cli/command_modules/role/custom.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,9 @@ def list_service_principal_owners(client, identifier):
12051205
# pylint: disable=inconsistent-return-statements
12061206
def create_service_principal_for_rbac(
12071207
# pylint:disable=too-many-statements,too-many-locals, too-many-branches, unused-argument
1208-
cmd, display_name=None, years=None, create_cert=False, cert=None, scopes=None, role=None,
1208+
cmd, display_name=None,
1209+
service_management_reference=None,
1210+
years=None, create_cert=False, cert=None, scopes=None, role=None,
12091211
show_auth_in_json=None, skip_assignment=False, keyvault=None):
12101212
import time
12111213

@@ -1249,6 +1251,7 @@ def create_service_principal_for_rbac(
12491251
aad_application = create_application(cmd,
12501252
graph_client,
12511253
app_display_name,
1254+
service_management_reference=service_management_reference,
12521255
key_value=public_cert_string,
12531256
start_date=app_start_date,
12541257
end_date=app_end_date)

0 commit comments

Comments
 (0)