/azure-governance:azure-role-selectorfrom azure-governance
Selects the least-privilege Azure RBAC role for an identity, compares built-in and custom role options, and produces Azure CLI assignment commands or Bicep snippets.
Ships in azure-governance. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Select the minimal Azure RBAC role that grants the requested actions at the narrowest safe scope, then return the matching built-in or custom role option with Azure CLI assignment commands and a Bicep role assignment snippet.
Azure MCP/documentation to find minimal built-in role definitions and confirm Actions, NotActions, DataActions, and NotDataActions.Azure MCP/extension_cli_generate to generate Azure CLI commands and to create a custom role definition when no built-in role matches the required permissions.Azure MCP/bicepschema and Azure MCP/get_bestpractices to produce Bicep role assignment snippets and current Azure best-practice guidance.| Input | Required detail | Examples |
|---|---|---|
| Identity | Principal type and object/principal ID or resolvable name | user, group, service principal, managed identity |
| Scope | Narrowest resource boundary that needs access | management group, subscription, resource group, storage account, Key Vault |
| Permissions | Operations the identity must perform | read metrics, restart web app, pull image, read blobs, manage secrets |
| Plane | Control plane or data plane | Actions for ARM management; DataActions for data access |
| Duration | Permanent, temporary, or Privileged Identity Management workflow | standing assignment, eligible assignment, break-glass |
| Decision | Rule |
|---|---|
| Least privilege | Choose the narrowest built-in role whose allowed operations cover the required actions without broad unrelated permissions. |
| Scope minimization | Assign at the resource scope when possible; move to resource group, subscription, or management group only when the required operation spans that scope. |
| Built-in before custom | Prefer a built-in role when it matches cleanly. Create a custom role only when built-ins are too broad or miss required operations. |
| Control plane vs data plane | Do not confuse ARM management with data access. For example, managing a storage account is different from reading blobs. |
| Wildcards | Treat *, broad Microsoft.Authorization/*, and owner-like roles as high risk unless the request explicitly requires administration. |
| Deny exclusions | Check NotActions and NotDataActions; an apparent match is invalid if exclusions remove a required operation. |
Actions or data-plane DataActions.Azure MCP/documentation and compare candidate built-in roles.Azure MCP/extension_cli_generate to produce a custom role definition containing only the required Actions or DataActions.Azure MCP/extension_cli_generate.Azure MCP/bicepschema and validate it against Azure MCP/get_bestpractices.| Request pattern | Check carefully |
|---|---|
| "Read a resource" | Reader may cover management metadata but not data-plane contents such as blobs, secrets, queues, or database rows. |
| "Deploy resources" | Contributor can create resources but cannot grant access; role assignment requires Microsoft.Authorization/roleAssignments/write. |
| "Manage access" | User Access Administrator grants role assignment management without full Owner permissions. |
| "Use Key Vault" | Separate secret, key, and certificate data operations from vault management operations. |
| "Use Storage" | Separate storage account management from blob, queue, table, or file data access roles. |
| "Pull container images" | Registry pull is narrower than contributor permissions on the registry. |
| "Managed identity access" | The consuming identity needs permissions at the target resource; the app host may also need permission to use or attach the identity. |
| Artifact | Include | Notes |
|---|---|---|
| Azure CLI command | az role assignment create --assignee <principal> --role "<role-name-or-id>" --scope <scope> | Prefer role ID for custom roles or ambiguous names. |
| Custom role JSON | Name, IsCustom, Description, Actions, NotActions, DataActions, NotDataActions, AssignableScopes | Include only when no suitable built-in role exists. |
| Bicep snippet | Microsoft.Authorization/roleAssignments with deterministic guid() name | Role assignment name must be stable for the same principal, role, and scope. |
| Explanation | Why the selected role is least privilege and which broader roles were rejected | Mention major excluded permissions and risk. |
AssignableScopes.## Azure role selection
**Status:** built-in selected | custom role required | blocked
**Identity:** <principal type and identifier>
**Scope:** `<scope>`
**Plane:** control plane | data plane | both
### Recommendation
| Role | Type | Why it matches | Broader roles rejected |
| --- | --- | --- | --- |
| `<role name or custom role name>` | built-in/custom | <required permissions covered> | <roles and reason> |
### Assignment command
```bash
az role assignment create --assignee <principal-id> --role "<role-name-or-id>" --scope <scope>
```
### Bicep
```bicep
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(<scope-id>, '<principal-id>', '<role-definition-id>')
scope: <scope-symbol>
properties: {
principalId: '<principal-id>'
roleDefinitionId: '<role-definition-resource-id>'
principalType: '<User|Group|ServicePrincipal|ForeignGroup|Device>'
}
}
```
### Custom role definition
<include only when no built-in role matches>
Azure MCP/documentation was used to compare built-in role definitions.Actions and data-plane DataActions are not confused.NotActions and NotDataActions do not exclude required permissions.Azure MCP/extension_cli_generate was used for assignment commands and custom role definitions when needed.Azure MCP/bicepschema and Azure MCP/get_bestpractices were used for the Bicep snippet.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin azure-governance6 skills in this plugin
/azure-complianceRun Azure compliance and security audits with azqr plus Key Vault expiration checks, covering best-practice assessment, resource review, policy and compliance validation, and security posture checks. Use when the user asks for a compliance scan or assessment, a security audit, Azure best-practice review, help before running the azqr CLI, Key Vault expiration checks, expired certificates or expiring secrets, or orphaned resource review./azure-entra-agent-idProvision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities through Microsoft Graph, and configure OAuth 2.0 token exchange including fmi_path, on-behalf-of, and cross-tenant flows with the Microsoft Entra SDK for AgentID sidecar. Use when the user works on an Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmi_path token exchange, agent on-behalf-of flows, workload identity federation for agents, polyglot agent authentication, or Microsoft.Identity.Web.AgentIdentities./azure-entra-app-registrationGuide Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. Use when the user wants to create or register an Entra ID application, configure OAuth, set up authentication, add API permissions, generate a service principal, review an MSAL or console app authentication example, or complete Entra ID tenant setup./azure-quotasCheck and manage Azure quotas and usage across resource providers for deployment planning, capacity validation, and region selection. Use when the user asks to check quotas, service limits, or current usage, request a quota increase, resolve a quota exceeded error, validate capacity, confirm regional availability or provisioning limits, or find how many vCPUs are available in a subscription./azure-well-architected-reviewPerform an Azure Well-Architected Framework review of the current workload IaC and architecture, generating findings and GitHub issues for improvements. Use this skill when the user asks for azure well-architected review.Other plugins' skills for the same job