[AD] az ad app/sp update: Add --parameters to replace generic update arguments#23490
Draft
[AD] az ad app/sp update: Add --parameters to replace generic update arguments#23490
az ad app/sp update: Add --parameters to replace generic update arguments#23490Conversation
az ad app/sp update: Add --parameters to replace generic update argumentsaz ad app/sp update: Add --parameters to replace generic update arguments
Collaborator
|
AD |
324ed6b to
5b3c524
Compare
|
@jiasli this looks great!
|
Member
Author
I don't think it will be possible to implement setting "deep" properties, because Azure CLI doesn't keep a model of the app object, so it can't build the JSON only from the path and value that are given.
Yes, this will be doable. I will revisit this PR when it gets planned. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
During Microsoft Graph migration (#22432), Azure CLI switched to a lightweight model-less
GraphClientfor Microsoft Graph interaction because:Even though this architecture enables Azure CLI to freely call Graph service, it is not compatible with generic update, because the schema of the object is unknown. The best we can do is to allow calling
--seton root-level properties (#22798). For other unsupported operations--add,--remove, the current workaround is to useaz restwhich is not very friendly to those who are not familiar with the underlying REST API.This PR proposes a more powerful way to update a Graph object - using
--parametersto update Graph objects directly with a JSON, similar toaz restbut without HTTP protocol details. We experimented with this approach inaz ad app federated-credential create/updatecommands and customers' feedback is positive.Unlike ARM which uses
PUTfor creating and updating, Graph API usesPOSTandPATCHfor creating and updating, thus not idempotent, such asThis enables us to update the application without getting it first.
For the original generic update argument:
--seton root properties are preserved.--removeand--addare removed. Actually, they stopped working since MS Graph migration (2.37.0) (as documented in Known issues), and we received very few complaints, so we can assume its usage is not necessary.Testing Guide
TODO
--setand--parametersare only supported onaz ad app/sp update. Other Graph object typeuser,groupdon't support generic update from the beginning.--setand--parameterstocreatecommands.