Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.97k forks source link

Doc issue: az ad app create how to add notes? #26595

Open TiloGit opened 1 year ago

TiloGit commented 1 year ago

How to add notes when creating and ad app via CLI?

I can enter in the GUI and read it via: az ad app show --id $appid -o json | jq .notes

But how can I set on create of the app or update?

here the GUI for notes (two spots)

sshot-2023-06-02- 10-59-29 sshot-2023-06-02- 11-00-23


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.

MoChilia commented 1 year ago

Hi @TiloGit, You can use az rest to call Create application REST API from MS Graph to add notes when creating an app. Here is an example.

(Bash)
az rest --method post --url 'https://graph.microsoft.com/v1.0/applications' --headers 'Content-Type=application/json' --body '{"displayName": "appName", "notes": "test notes"}'

(PowerShell)
az rest --method post --url 'https://graph.microsoft.com/v1.0/applications' --headers 'Content-Type=application/json' --body '{\"displayName\": \"appName\", \"notes\": \"test notes\"}'

You can also use az rest with Update application REST API by

az rest --method patch --url 'https://graph.microsoft.com/v1.0/applications/{objectId}' --headers 'Content-Type=application/json' --body '{"notes": "notes updated"}'

Or you can use az ad app update to do so. Here is an example.

az ad app update --id $id --set notes="notes updated"