azure-role-selector

Identify least-privilege Azure RBAC roles and generate CLI and Bicep assignment snippets.

242|189|Updated Oct 28, 2024
One-click install
npx skills add https://github.com/microsoft/GitHub-Copilot-for-Azure --skill azure-role-selector-microsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-role-selector
Source: https://github.com/microsoft/GitHub-Copilot-for-Azure/tree/main/plugin/skills/azure-role-selector
Command: npx skills add https://github.com/microsoft/GitHub-Copilot-for-Azure --skill azure-role-selector-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps identify the appropriate Azure RBAC role for a given identity with least privilege in mind, and generates ready-to-run CLI commands and Bicep code to apply the assignment.

Core Features & Use Cases

  • Role discovery: Finds the smallest built-in Azure role that matches requested permissions.
  • Automation of assignments: Generates CLI commands to assign the role to the identity.
  • Bicep code generation: Produces declarative infrastructure code for reproducible deployments.

Quick Start

Use the azure-role-selector to determine a suitable role for a user or service principal and generate the necessary CLI commands and Bicep snippet.

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 RBAC role for a service principal?

To find the least-privilege Azure RBAC role, the Skill locates the smallest built-in role matching your requested permissions for a service principal. It searches Azure documentation and falls back to custom role generation if no built-in role fits.

What's the best way to assign an Azure RBAC role to a managed identity?

The best way to assign an Azure RBAC role to a managed identity is using generated CLI commands or Bicep code. The Skill outputs ready-to-run assignment snippets that apply minimal built-in roles directly to your target identity across Azure resources.

Can I use Bicep to deploy Azure RBAC role assignments?

Yes, you can use Bicep to deploy Azure RBAC role assignments. The Skill generates declarative Bicep infrastructure code for reproducible deployments, allowing you to apply least-privilege role assignments to users, service principals, or managed identities.

How do I create a custom Azure role when no built-in role provides the right permissions?

To create a custom Azure role when built-in roles lack the right permissions, the Skill utilizes the Azure CLI extension to generate a custom role definition. This ensures you maintain least-privilege access when standard built-in roles do not fit your scenario.

Does the Azure role assignment process support both users and automation identities?

Yes, the Azure role assignment process supports both users and automation identities. The Skill applies least-privilege RBAC role discovery and assignment across Azure resources for users, service principals, and managed identities requiring access grants.

When should I use Bicep over CLI commands for Azure RBAC assignments?

You should use Bicep over CLI commands for Azure RBAC assignments when you need reproducible infrastructure deployments. The Skill generates both CLI commands for immediate execution and Bicep snippets for declarative, repeatable role assignment across environments.