|
| 1 | +name: 🔐 Arc Machine API Role Assignment |
| 2 | +description: Request Gateway.Access app role assignment for a newly onboarded Arc-enabled gateway machine |
| 3 | +labels: ['infrastructure', 'entra-id'] |
| 4 | +body: |
| 5 | + - type: markdown |
| 6 | + attributes: |
| 7 | + value: | |
| 8 | + Each Arc-enabled gateway machine has a system-assigned managed identity that must be granted |
| 9 | + the `Gateway.Access` app role on `spn-manbrs-web-api-<env>` before it can authenticate to |
| 10 | + the manbrs cloud API. |
| 11 | +
|
| 12 | + This assignment cannot be automated via Terraform as it requires `AppRoleAssignment.ReadWrite.All` |
| 13 | + at directory level, which is not available to the pipeline identity. Raise this ticket each time |
| 14 | + a new Arc machine is onboarded. |
| 15 | +
|
| 16 | + - type: dropdown |
| 17 | + attributes: |
| 18 | + label: Environment |
| 19 | + options: |
| 20 | + - review |
| 21 | + - preprod |
| 22 | + - prod |
| 23 | + validations: |
| 24 | + required: true |
| 25 | + |
| 26 | + - type: input |
| 27 | + attributes: |
| 28 | + label: Arc machine name |
| 29 | + description: The Arc resource name set during onboarding (e.g. `gw-RVJ-01`). |
| 30 | + placeholder: gw-XXX-01 |
| 31 | + validations: |
| 32 | + required: true |
| 33 | + |
| 34 | + - type: input |
| 35 | + attributes: |
| 36 | + label: Managed identity principal ID |
| 37 | + description: | |
| 38 | + Object ID of the machine's system-assigned managed identity. Retrieve with: |
| 39 | +
|
| 40 | + ``` |
| 41 | + az connectedmachine show \ |
| 42 | + --name <MACHINE_NAME> \ |
| 43 | + --resource-group rg-mbsgw-<env>-uks-arc-enabled-servers \ |
| 44 | + --query identity.principalId -o tsv |
| 45 | + ``` |
| 46 | + placeholder: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| 47 | + validations: |
| 48 | + required: true |
| 49 | + |
| 50 | + - type: markdown |
| 51 | + attributes: |
| 52 | + value: | |
| 53 | + --- |
| 54 | + ## Steps for assignee |
| 55 | +
|
| 56 | + ### Option A — Azure Portal |
| 57 | +
|
| 58 | + 1. Entra ID → Enterprise Applications → `spn-manbrs-web-api-<env>` |
| 59 | + 2. **Users and groups** → **Add user/group** |
| 60 | + 3. Search for the Arc machine name and select its managed identity |
| 61 | + 4. Select the `Gateway.Access` role → **Assign** |
| 62 | +
|
| 63 | + ### Option B — Azure CLI |
| 64 | +
|
| 65 | + ```bash |
| 66 | + MACHINE_NAME=<MACHINE_NAME> |
| 67 | + ENV=<ENV> |
| 68 | + PRINCIPAL_ID=<PRINCIPAL_ID> |
| 69 | +
|
| 70 | + # Get the manbrs SP object ID |
| 71 | + RESOURCE_SP_ID=$(az ad sp show \ |
| 72 | + --display-name "spn-manbrs-web-api-${ENV}" \ |
| 73 | + --query id -o tsv) |
| 74 | +
|
| 75 | + # Get the Gateway.Access role ID |
| 76 | + ROLE_ID=$(az ad sp show \ |
| 77 | + --display-name "spn-manbrs-web-api-${ENV}" \ |
| 78 | + --query "appRoles[?value=='Gateway.Access'].id | [0]" -o tsv) |
| 79 | +
|
| 80 | + # Create the assignment |
| 81 | + az rest --method POST \ |
| 82 | + --uri "https://graph.microsoft.com/v1.0/servicePrincipals/${PRINCIPAL_ID}/appRoleAssignments" \ |
| 83 | + --body "{ |
| 84 | + \"principalId\": \"${PRINCIPAL_ID}\", |
| 85 | + \"resourceId\": \"${RESOURCE_SP_ID}\", |
| 86 | + \"appRoleId\": \"${ROLE_ID}\" |
| 87 | + }" |
| 88 | + ``` |
| 89 | +
|
| 90 | + ### Verification |
| 91 | +
|
| 92 | + Confirm the machine appears under: |
| 93 | + > Entra ID → Enterprise Applications → `spn-manbrs-web-api-<env>` → Users and groups |
| 94 | +
|
| 95 | + with the `Gateway.Access` role assigned. |
| 96 | +
|
| 97 | + - type: checkboxes |
| 98 | + attributes: |
| 99 | + label: Completion checklist |
| 100 | + options: |
| 101 | + - label: App role assignment created in Entra ID |
| 102 | + required: false |
| 103 | + - label: Assignment verified in portal / CLI |
| 104 | + required: false |
| 105 | + |
| 106 | + - type: checkboxes |
| 107 | + attributes: |
| 108 | + label: Sensitive Information Declaration |
| 109 | + description: Do NOT include PII/PID or any other sensitive data in this form. |
| 110 | + options: |
| 111 | + - label: I confirm that neither PII/PID nor sensitive data are included in this form |
| 112 | + required: true |
0 commit comments