Skip to content

{Graph} Fix linter and style errors#22318

Merged
jiasli merged 11 commits intoAzure:betafrom
jiasli:graph-linter
May 11, 2022
Merged

{Graph} Fix linter and style errors#22318
jiasli merged 11 commits intoAzure:betafrom
jiasli:graph-linter

Conversation

@jiasli
Copy link
Copy Markdown
Member

@jiasli jiasli commented May 9, 2022

Related command

Fix

  • Help messages
  • Linter
  • Style
  • CredScan

Corresponding doc update: MicrosoftDocs/azure-docs-cli#3122

@ghost ghost requested a review from yonzhan May 9, 2022 14:49
@ghost ghost added the Auto-Assign Auto assign by bot label May 9, 2022
@ghost ghost requested a review from wangzelin007 May 9, 2022 14:49
@ghost ghost assigned jiasli May 9, 2022
@ghost ghost added this to the May 2022 (2022-05-24) - For Build milestone May 9, 2022
@ghost ghost added the Graph (doesn't work with label-triggered comments; use Graph.Microsoft instead) az ad label May 9, 2022
@ghost ghost requested review from calvinhzy and evelyn-ys May 9, 2022 14:49
@jiasli jiasli changed the title {Graph} Fix linter and style error {Graph} Fix linter and style errors May 9, 2022
text: |
az ad app create --display-name my-native --native-app --required-resource-accesses @manifest.json
az ad app create --display-name mytestapp
- name: Create an application that can fall back to public client with Microsoft Graph delegated permission Application.Read.All
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated example from using outdated AD Graph permission to MS Graph permission.

}


def set_object_properties(object_type, graph_object, **kwargs):
Copy link
Copy Markdown
Member Author

@jiasli jiasli May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose public method set_object_properties.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 9, 2022

Graph

@jiasli jiasli marked this pull request as ready for review May 10, 2022 05:24
@jiasli jiasli requested a review from DaeunYim as a code owner May 10, 2022 05:24
examples:
- name: Grant a native application with permissions to access an existing API with TTL of 2 years
text: az ad app permission grant --id e042ec79-34cd-498f-9d9f-1234234 --api a0322f79-57df-498f-9d9f-12678
text: az ad app permission grant --id e042ec79-34cd-498f-9d9f-1234234 --api a0322f79-57df-498f-9d9f-12678 --scope Directory.Read.All
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--scope's default value user_impersonation is removed, as user_impersonation is very highly privileged.

examples:
- name: Append a certificate to the service principal with the certificate string.
text: az ad sp credential reset --name myapp --cert "MIICoT..." --append
text: az ad sp credential reset --id myapp --cert "MIICoT..." --append
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

az ad sp credential list and az ad sp credential delete both use --id. Only az ad sp credential reset uses --name, so we unify them.

short-summary: Create an Azure Active Directory user.
parameters:
- name: --force-change-password-next-login
- name: --force-change-password-next-sign-in
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaking change is undocumented in Graph doc (https://github.com/microsoftgraph/microsoft-graph-docs/issues/16819).

raise CLIError("'{}' doesn't exist in graph object '{}'.".format(
key_id, graph_object[ID]))
else:
raise CLIError("No key credential found with keyId as '{}' in graph object '{}'.".format(
Copy link
Copy Markdown
Member Author

@jiasli jiasli May 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same error message as application: removeKey.

'new_mail_nick_name': 'graphusertestupdate',
'group': 'graphusertest_g',
'password': 'Test1234!!',
'password': self.create_random_name(prefix='password-', length=40),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use random password and replace it in recordings to make it more secure.

@jiasli jiasli merged commit 5e3c3bd into Azure:beta May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Graph (doesn't work with label-triggered comments; use Graph.Microsoft instead) az ad Microsoft Graph

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants