Skip to content

Commit 77aaf4f

Browse files
Update blog 5.4: add UAA role prerequisite with portal steps and condition option guidance
1 parent 4f00fe8 commit 77aaf4f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

blogs/series-5-devops-data/5.4-azure-bicep-infrastructure.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This article is part of the **AngularNetTutorial** series. The full-stack tutori
2929
* **CAF naming convention** — why resources are named `app-talent-api-dev` and not `myapp1`
3030
* **Bicep outputs** — how deployed URLs flow into GitHub Actions workflows
3131
* **GitHub Actions workflow** — how to deploy infrastructure on-demand via `workflow_dispatch`
32+
* **Service principal permissions** — why Contributor alone isn't enough and how to grant role assignment capability
3233
* **Estimated cost**~$23/month for the full dev stack, and how to reduce it to $0
3334

3435
---
@@ -456,6 +457,25 @@ jobs:
456457
* `AZURE_SUBSCRIPTION_ID` — Azure subscription ID
457458
* `SQL_ADMIN_PASSWORD` — SQL administrator password
458459

460+
### ⚠️ One-Time Prerequisite: Grant Role Assignment Permission
461+
462+
The Bicep deployment creates RBAC role assignments (granting each Web App's managed identity access to Key Vault). By default, a service principal with **Contributor** role cannot create role assignments — it also needs **User Access Administrator**.
463+
464+
**Grant it in the Azure Portal:**
465+
466+
1. Go to **portal.azure.com → Resource Groups → rg-talent-dev**
467+
2. Click **Access control (IAM)** in the left menu
468+
3. Click **+ Add → Add role assignment**
469+
4. Select role: **User Access Administrator** → click **Next**
470+
5. Click **+ Select members**, search for your service principal (e.g. `github-angularnettutorial`), select it
471+
6. Click **Next** — Azure shows a role assignment condition dialog with three options:
472+
* Allow user to only assign selected roles to selected principals (fewer privileges)
473+
* **Allow user to assign all roles except privileged administrator roles Owner, UAA, RBAC (Recommended)** ← select this
474+
* Allow user to assign all roles (highly privileged)
475+
7. Click **Review + assign**
476+
477+
**Why the Recommended option?** The Bicep only assigns the `Key Vault Secrets User` role — a standard, non-privileged role. The recommended option allows assigning standard roles while blocking the highest-privilege roles (Owner, User Access Administrator itself, RBAC Administrator). This follows the principle of least privilege — enough permission to wire up managed identities, not enough to escalate to subscription owner.
478+
459479
---
460480

461481
## 💻 Try It Yourself

0 commit comments

Comments
 (0)