Skip to content

Commit 65e9473

Browse files
feat(DTOSS-13037): replace Terraform automation with manual assignment process
Remove app_role.tf and related variables — AppRoleAssignment.ReadWrite.All at directory level is unavailable to the pipeline identity, so the assignment cannot be automated. Add a GitHub issue template to standardise the manual request process when onboarding each new Arc-enabled machine.
1 parent ffd3f8f commit 65e9473

3 files changed

Lines changed: 112 additions & 31 deletions

File tree

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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

infrastructure/modules/arc-infra/app_role.tf

Lines changed: 0 additions & 25 deletions
This file was deleted.

infrastructure/modules/arc-infra/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,3 @@ variable "static_arc_machine_names" {
2828
type = list(string)
2929
default = []
3030
}
31-
32-
variable "manbrs_api_app_role_value" {
33-
description = "Value of the app role on spn-manbrs-web-api-<env> to assign to each Arc machine managed identity. Must match a role declared on that application registration."
34-
type = string
35-
default = "Gateway.Access"
36-
}

0 commit comments

Comments
 (0)