|
15 | 15 | - [ ] Trust ODS code confirmed via the [ODS portal](https://odsportal.nhsbsa.nhs.uk/) |
16 | 16 | - [ ] NHS region confirmed (`nw` | `neyh` | `mids` | `eoe` | `lon` | `se` | `sw`) |
17 | 17 | - [ ] Deployment ring agreed with the programme team |
18 | | -- [ ] `arc-onboarding-spn-client-id` and `arc-onboarding-spn-client-secret` retrieved from Key Vault |
| 18 | +- [ ] `arc-onboarding-spn-client-id` retrieved from Entra ID; new `arc-onboarding-spn-client-secret` generated with 1-day expiry and shared with the hospital trust IT team before the onboarding call |
19 | 19 |
|
20 | 20 | --- |
21 | 21 |
|
@@ -91,32 +91,32 @@ Logs are written to `C:\ArcSetup\ArcSetup.log`. |
91 | 91 |
|
92 | 92 | **Verify**: In the Azure portal, navigate to `rg-mbsgw-<env>-uks-arc-enabled-servers` → Azure Arc machines → `gw-hull-university-teaching-hospitals-nhs-trust-rwa-01`. Status should be **Connected**. |
93 | 93 |
|
94 | | -## Step 3 — Trigger Terraform to provision the Hybrid Connection |
95 | | - |
96 | | -Run the ADO pipeline **Deploy Arc Infrastructure - \<env\>** manually. Terraform discovers the new Arc machine and creates: |
97 | | - |
98 | | -- `hc-gw-hull-university-teaching-hospitals-nhs-trust-rwa-01` in the relay namespace (`relay-manbrs-<env>`) |
99 | | -- `listen` auth rule on that Hybrid Connection |
100 | | - |
101 | | -**Verify**: In the Azure portal, navigate to `relay-manbrs-<env>` → Hybrid Connections → `hc-gw-hull-university-teaching-hospitals-nhs-trust-rwa-01` is present. |
102 | | - |
103 | | -## Step 4 — Grant API access |
| 94 | +## Step 3 — Grant API access |
104 | 95 |
|
105 | 96 | > [!IMPORTANT] |
106 | 97 | > Without this step the gateway services will start but fail to authenticate against the cloud web API. The Arc machine's managed identity must be assigned the `Gateway.Access` app role on `spn-manbrs-web-api-<env>` before the first deployment. |
107 | 98 |
|
108 | 99 | Run from a developer machine with Owner access to the enterprise application: |
109 | 100 |
|
110 | 101 | ```bash |
111 | | -make <env> resource-group-init |
| 102 | +make <env> assign-arc-app-roles |
112 | 103 | ``` |
113 | 104 |
|
114 | 105 | This calls [`scripts/bash/assign_arc_app_roles.sh`](../../../scripts/bash/assign_arc_app_roles.sh) which discovers all Arc machines in `rg-mbsgw-<env>-uks-arc-enabled-servers` and assigns the `Gateway.Access` role to each machine's managed identity. |
115 | 106 |
|
116 | | -> **Why is this manual?** The pipeline managed identity (`mi-mbsgw-<env>-adotoaz-uks`) cannot create app role assignments via the pipeline — Microsoft Graph requires `AppRoleAssignment.ReadWrite.All` in application auth context regardless of SP ownership, and this permission cannot be granted under the organisation's Entra policy. Running `resource-group-init` under a user account with ownership of the enterprise app SP is sufficient. See [Deployment Pipeline — Section 12](../deployment-pipeline.md#12-pipeline-identities-and-permissions) for details. |
| 107 | +> **Why is this manual?** The pipeline managed identity (`mi-mbsgw-<env>-adotoaz-uks`) cannot create app role assignments via the pipeline — Microsoft Graph requires `AppRoleAssignment.ReadWrite.All` in application auth context regardless of SP ownership, and this permission cannot be granted under the organisation's Entra policy. Running `assign-arc-app-roles` under a user account with ownership of the enterprise app SP is sufficient. See [Deployment Pipeline — Section 12](../deployment-pipeline.md#12-pipeline-identities-and-permissions) for details. |
117 | 108 |
|
118 | 109 | **Verify**: In the Azure portal navigate to **Enterprise Applications → spn-manbrs-web-api-\<env\> → Users and groups**. The Arc machine (`gw-hull-university-teaching-hospitals-nhs-trust-rwa-01`) should appear with the `Gateway.Access` role. |
119 | 110 |
|
| 111 | +## Step 4 — Trigger Terraform to provision the Hybrid Connection |
| 112 | + |
| 113 | +Run the ADO pipeline **Deploy Arc Infrastructure - \<env\>** manually. Terraform discovers the new Arc machine and creates: |
| 114 | + |
| 115 | +- `hc-gw-hull-university-teaching-hospitals-nhs-trust-rwa-01` in the relay namespace (`relay-manbrs-<env>`) |
| 116 | +- `listen` auth rule on that Hybrid Connection |
| 117 | + |
| 118 | +**Verify**: In the Azure portal, navigate to `relay-manbrs-<env>` → Hybrid Connections → `hc-gw-hull-university-teaching-hospitals-nhs-trust-rwa-01` is present. |
| 119 | + |
120 | 120 | ## Step 5 — Deploy the gateway application |
121 | 121 |
|
122 | 122 | Run the ADO pipeline **Deploy Gateway - \<env\>** with: |
@@ -172,7 +172,7 @@ Check Log Analytics Workspace for an initial heartbeat within 5 minutes of servi |
172 | 172 | Check `C:\ArcSetup\ArcSetup.log` on the VM. Common causes: |
173 | 173 |
|
174 | 174 | - **Firewall blocking outbound** — confirm the VM can reach `*.arc.azure.com` on port 443 |
175 | | -- **SPN credentials wrong** — verify client ID and secret from Key Vault are current |
| 175 | +- **SPN credentials wrong** — confirm the one-time secret shared before the call has not expired (1-day validity); generate a new one and retry if needed |
176 | 176 | - **VM already registered** — if the machine was previously connected under a different name, disconnect first: `azcmagent disconnect` |
177 | 177 |
|
178 | 178 | ### Script execution blocked |
|
0 commit comments