azure-role-selector

Determine minimal Azure roles and generate CLI and Bicep assignment snippets.

9|1|Updated Jul 21, 2025
One-click install
npx skills add https://github.com/usepowershell/PoshMcp --skill azure-role-selector-usepowershell
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: azure-role-selector
Source: https://github.com/usepowershell/PoshMcp/tree/main/.squad/templates/skills/azure-role-selector
Command: npx skills add https://github.com/usepowershell/PoshMcp --skill azure-role-selector-usepowershell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps cloud engineers and administrators determine which Azure role to assign to an identity to satisfy a requested set of permissions while adhering to the principle of least privilege, and provides the commands and infrastructure-as-code snippets to apply that role.

Core Features & Use Cases

  • Built-in role matching: Search Azure built-in role definitions to find the minimal role that covers the requested permissions.
  • Custom role generation: Generate a custom role definition when no built-in role matches, and produce the CLI commands needed to create and assign it.
  • Deployment artifacts: Produce Azure CLI commands and a Bicep code snippet for role assignment, and apply best-practice recommendations for scope and least-privilege access.
  • Use Case: Grant a service principal the exact set of permissions required to manage a specific resource without overprovisioning at subscription scope.

Quick Start

Ask the agent to determine the least-privilege built-in or custom Azure role for granting the specified permissions to an identity and provide Azure CLI and Bicep role-assignment steps.

Frequently Asked Questions about azure-role-selector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the least-privilege Azure role for a specific set of permissions?▼

To find the least-privilege Azure role, you match your requested permissions against built-in role definitions to identify the minimal role that covers your needs. If no built-in match exists, a custom role definition is generated.

How do I generate Azure CLI and Bicep snippets for role assignment?▼

You generate Azure CLI and Bicep snippets for role assignment by specifying the identity, permissions, and scope. The output provides ready-to-use commands and infrastructure-as-code following RBAC best practices.

When should I create a custom Azure role instead of using a built-in role?▼

You should create a custom Azure role when no built-in role definition matches your exact set of requested permissions. This ensures you adhere to least privilege without overprovisioning access at broader scopes.

Can I apply Azure RBAC role assignments at the resource level instead of subscription scope?▼

Yes, you can apply Azure RBAC role assignments at subscription, resource group, or resource scopes. Assigning roles at narrower scopes like the resource level helps enforce least-privilege access.

What is the best way to grant a service principal exact permissions without overprovisioning?▼

The best way to grant exact permissions without overprovisioning is to map the required permissions to a minimal built-in or custom Azure role, then assign it at the specific resource scope using generated CLI or Bicep snippets.