Skip to content
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

resourceArmRoleAssignment: Allow /providers/Micrososoft.Capacity, /providers/BillingBenefits and / as scope value #26663

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/services/authorization/role_assignment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ func resourceArmRoleAssignment() *pluginsdk.Resource {
Required: true,
ForceNew: true,
ValidateFunc: validation.Any(
// Elevated access for a global admin is needed to assign roles in this scope:
// Elevated access (aka User Access Administrator role) is needed to assign roles in the following scopes:
// https://docs.microsoft.com/en-us/azure/role-based-access-control/elevate-access-global-admin#azure-cli
// It seems only user account is allowed to be elevated access.
validation.StringMatch(regexp.MustCompile("/"), "Root scope (/) is invalid"),
validation.StringMatch(regexp.MustCompile("/providers/Microsoft.Subscription.*"), "Subscription scope is invalid"),
validation.StringMatch(regexp.MustCompile("/providers/Microsoft.Capacity"), "Capacity scope is invalid"),
validation.StringMatch(regexp.MustCompile("/providers/Microsoft.BillingBenefits"), "BillingBenefits scope is invalid"),

billingValidate.EnrollmentID,
commonids.ValidateManagementGroupID,
Expand Down
Loading