Skip to content

Fix Arc machine RBAC for listBootstrapData - #295

Merged
hbc (bcho) merged 4 commits into
mainfrom
copilot/fix-arc-machine-rbac
Sep 4, 2026
Merged

Fix Arc machine RBAC for listBootstrapData#295
hbc (bcho) merged 4 commits into
mainfrom
copilot/fix-arc-machine-rbac

Conversation

Copilot AI commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Arc-mode E2E node joins consistently failed with HTTP 403 on listBootstrapData (15 min of retries exhausted), while the MSI Flex Node join in the same run succeeded.

Root cause

infra/main.bicep grants the MSI VM identity three built-in AKS roles at the cluster scope (Cluster Admin, Contributor, RBAC Cluster Admin). The Arc machine identity doesn't exist until after azcmagent connect, so it can't be pre-provisioned via bicep — hack/e2e/lib/node-join-arc.sh instead assigns roles at runtime, but only granted Contributor, one of the three roles the MSI identity relies on for the same calls.

Fix

  • hack/e2e/lib/node-join-arc.sh: added the missing Cluster Admin and RBAC Cluster Admin role definition IDs (matching the bicep constants) and loop over all three roles when assigning them to the Arc machine principal, mirroring exactly what the MSI VM gets in infra/main.bicep.
for role_definition_id in \
  "${aksClusterAdminRoleDefinitionID}" \
  "${aksContributorRoleDefinitionID}" \
  "${aksRBACClusterAdminRoleDefinitionID}"; do
  az role assignment create \
    --assignee-object-id "${principal_id}" \
    --assignee-principal-type ServicePrincipal \
    --role "${role_definition_id}" \
    --scope "${cluster_id}" \
    --output none
done

Copilot AI linked an issue Aug 29, 2026 that may be closed by this pull request
Co-authored-by: bcho <1975118+bcho@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix arc machine RBAC for listBootstrapData Fix Arc machine RBAC for listBootstrapData Aug 29, 2026
Copilot AI requested a review from hbc (bcho) August 29, 2026 00:33
Comment thread hack/e2e/lib/node-join-arc.sh Outdated
Co-authored-by: bcho <1975118+bcho@users.noreply.github.com>
Copilot AI requested a review from hbc (bcho) August 30, 2026 06:33
@bcho
hbc (bcho) marked this pull request as ready for review August 30, 2026 06:40
Copilot AI lite review requested due to automatic review settings August 30, 2026 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Arc-mode E2E node-join failures by aligning the Arc machine identity’s RBAC assignments with the MSI Flex Node identity so listBootstrapData and related AKS Machine operations don’t hit HTTP 403 (Issue #294).

Changes:

  • Add missing built-in AKS role definition IDs (Cluster Admin, RBAC Cluster Admin) to the Arc join script.
  • Assign all three required roles to the Arc machine principal at runtime (mirroring the MSI VM assignments in bicep).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread hack/e2e/lib/node-join-arc.sh Outdated
Comment thread hack/e2e/lib/node-join-arc.sh Outdated

@bcho hbc (bcho) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot please address comments

Co-authored-by: bcho <1975118+bcho@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 3, 2026 01:33

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Copilot please address comments

Addressed both comments in 85a90f7: corrected the Bicep path and made role assignment retries tolerate only RoleAssignmentExists while preserving other failures.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is small, directly addresses the documented 403 root cause by matching the MSI node’s RBAC grants, and adds safe idempotent handling for existing assignments.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@bcho
hbc (bcho) merged commit 8ef956a into main Sep 4, 2026
13 checks passed
@bcho
hbc (bcho) deleted the copilot/fix-arc-machine-rbac branch September 4, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix arc machine rbac

5 participants