r/role_assignment: adding validation for scope
#10438
Merged
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.
This commit introduces validation to the
scope
field, validating that it's either a Management Group ID, Resource Group ID, Subscription ID or otherwise a Resource ID - to workaround the API usability issues identified in #9569.This isn't perfect, but the error messages coming back from the API are particularly unhelpful to users unfamiliar with how the API works.
I've also taken the opportunity to split the tests out, since we can limit them one at a time in TC.
Ignoring one temporary failure due to a conflicting role assignment, the tests pass: