Skip to main content
command

azure-role-selector — Claude Code command for Azure role selection

Finds an Azure role that matches an identity’s required permissions with minimal access, then provides ways to assign it. Useful when setting up access controls.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command azure/azure-role-selector
Open on GitHub

What azure-role-selector does

Describe the permissions an identity needs. The command checks Azure documentation for a matching built-in role; when none fits, it creates a custom role definition. It then generates CLI commands to assign the role and a Bicep snippet for the assignment.

The command uses the Azure MCP tools documentation, extension_cli_generate, bicepschema, and get_bestpractices. A custom role is the suggested route when built-in permissions do not match, so review its access scope before applying it.

What it helps with

  • match an Azure role to required permissions
  • find a built-in role with minimal access
  • create a custom role definition
  • generate CLI commands for a role assignment
  • add a role assignment in Bicep

Example prompts for the agent

  • Find the least-privilege Azure role for an identity that needs read access to storage.
  • Create a custom role for these permissions and give me the command to assign it.
  • Write a Bicep snippet that assigns this role to the identity.

How to install azure-role-selector

1claude-code-templates

npx claude-code-templates@latest --command azure/azure-role-selector

2Manually: put the files in place

.claude/commands/azure-role-selector.md

Call it with /azure-role-selector. For all projects use ~/.claude/commands/

Questions about azure-role-selector

How do I install azure-role-selector in Claude Code?

Run npx claude-code-templates@latest --command azure/azure-role-selector, then use the command at .claude/commands/azure-role-selector.md.

What does azure-role-selector do?

It matches required permissions to a minimal Azure role, then prepares CLI commands and a Bicep snippet to assign that role.

Which tools does azure-role-selector use?

It uses the Azure MCP tools documentation, extension_cli_generate, bicepschema, and get_bestpractices.

Source text

azure-role-selector.md · MIT
---
allowed-tools: Azure MCP/documentation, Azure MCP/bicepschema, Azure MCP/extension_cli_generate, Azure MCP/get_bestpractices
description: When user is asking for guidance for which role to assign to an identity given desired permissions, this agent helps them understand the role that will meet the requirements with least privilege access and how to apply that role.
---

Use 'Azure MCP/documentation' tool to find the minimal role definition that matches the desired permissions the user wants to assign to an identity (If no built-in role matches the desired permissions, use 'Azure MCP/extension_cli_generate' tool to create a custom role definition with the desired permissions). Use 'Azure MCP/extension_cli_generate' tool to generate the CLI commands needed to assign that role to the identity and use the 'Azure MCP/bicepschema' and the 'Azure MCP/get_bestpractices' tool to provide a Bicep code snippet for adding the role assignment.

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Cloud: AWS, Azure, GCP →

From the same set804

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor