-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Compute] BREAKING CHANGE: az vm/vmss create: Remove the default value Contributor of parameter --role
#21474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Compute] BREAKING CHANGE: az vm/vmss create: Remove the default value Contributor of parameter --role
#21474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we put this in the command help? Otherwise, we have to have this text for both --scope and --role.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiasli Since az vm create and az vmss create commands have too many other parameters and examples, I think it might be a good idea to add the description to both --scope and --role parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we can not include this information in the help description, because we already have verification logic that will tell users that those two parameters need to be passed in at the same time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication is bad. ad sp create-for-rbac puts this information in command help:
But I am open to this topic. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The situation of these two commands may be different, az vm create command has nearly 100 parameters and too much help information. 😂
Since the --scope and --role are only one of many usage scenarios, I'm not sure whether it's appropriate to put them in a global position in this case. And the help information printed by this command is too long, so users may not notice the description from the command level every time
In order to avoid duplicated prompts, I personally think maybe I can remove this information in the help description, because we already have the verification to tell users that --scope and --role parameters need to be passed in at the same time. What do you think of this idea?
|
Compute |
24a817b to
4f62783
Compare
az vm/vmss create: Remove the default value Contributor of parameter --roleaz vm/vmss create: Remove the default value Contributor of parameter --role
a0290a5 to
ad46d3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Together with L1232, for simplicity, why don't we say:
Usage error: To create role assignments, specify both --role and --scopes.
just like #21323
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I wanted to be consistent with the error message that the --scope parameter was not passed in the original code https://github.com/Azure/azure-cli/pull/21474/files#r826612256
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace.identity_role will never have is_default now, won't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When from_set_command is True, it indicates that the command is az vm identity assign. At this time, the --role parameter still has the default value Contributor.
Therefore, when the user does not specify the --role parameter, this judgment getattr(namespace.identity_role, 'is_default', None) will be True, otherwise it will be None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this time, the
--roleparameter still has the default valueContributor.
This is definitely not secure. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the error message that --scope parameter is not passed in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, I don't like this message either. It is hard to understand.
ad46d3d to
b0ff664
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
b0ff664 to
6b3e25d
Compare
| if (namespace.identity_scope and not namespace.identity_role) or \ | ||
| (not namespace.identity_scope and namespace.identity_role): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For operator precedence, not > and > or, so parentheses are not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, actually I know this. I put parentheses here just for clearer readability~
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Description
As mentioned in PR #20924 and #21326, we need to remove the default value
Contributorof--role.Testing Guide
Wait for PR #21369 to fix the problems of existing tests, then add tests and re-record related tests
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.