azure-role-selector
Skill274 starsChanged 28 days agoMITView on GitHub
Recommend least-privilege Azure RBAC roles for deployed resources. Finds minimal built-in roles matching desired permissions or creates custom role definitions. Use during security analysis or when configuring access for service principals and managed identities.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- vinayaklatthe/microsoft-security-skillstheir own version, first seen Nov 1, 2026
- github/awesome-copilottheir own version, first seen Oct 25, 2026
- Tyler-R-Kendrick/agent-skillstheir own version, first seen Feb 10, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- github/awesome-copilot★ 41ksame name
- vinayaklatthe/microsoft-security-skills★ 179same name
- Tyler-R-Kendrick/agent-skills★ 11same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- website/docs/authoring/agents.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .github/skills/git-ape-onboarding/templates/copilot-instructions.mdCopilot instructions
- aws-api-gatewaySkill
- aws-bedrockSkill
- aws-cloudformationSkill
- aws-cloudwatchSkill
- aws-cognitoSkill
- aws-cost-estimatorSkill
- aws-dynamodbSkill
- aws-ec2Skill
- aws-ecsSkill
- aws-eksSkill
- aws-eventbridgeSkill
- aws-iamSkill
- aws-lambdaSkill
- aws-naming-researchSkill
- aws-rdsSkill
- aws-s3Skill
- aws-secrets-managerSkill
- aws-security-analyzerSkill
- aws-snsSkill
- aws-sqsSkill
- aws-step-functionsSkill
- csd-assessment-reportSkill
- deployment-blueprintsSkill
- fulfillment-and-meteringSkill
- isv-landing-zone-foundationSkill
- marketplace-offer-typesSkill
- marketplace-onboardingSkill
- multi-tenant-saasSkill
- onboard-to-marketplaceSkill
- saas-accelerator-bootstrapSkill
- saas-assessment-reportSkill
- scale-and-sreSkill
- security-and-complianceSkill
- tenant-isolation-modelsSkill
- tenant-lifecycle-automationSkill
- azure-cost-estimatorSkill
- azure-deployment-preflightSkill
- azure-drift-detectorSkill
- azure-integration-testerSkill
- azure-naming-researchSkill
- azure-policy-advisorSkill
- azure-resource-availabilitySkill
- azure-resource-visualizerSkill
- azure-rest-api-referenceSkill
- azure-security-analyzerSkill
- azure-stack-deploySkill
- azure-stack-destroySkill
- git-ape-onboardingSkill
- git-ape-skillsSkill
- prereq-checkSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
When deploying resources that need RBAC assignments
- Distinctive: line 18
When configuring managed identity access between resources
- Distinctive: line 19
When setting up service principals for CI/CD pipelines
- Distinctive: line 21
When user asks "what role do I need for X?"
- Distinctive: line 27
Ask the user what actions they need to perform:
- Distinctive: line 40
Use Azure MCP documentation tools to find matching built-in roles:
- Distinctive: line 120
If no built-in role matches the exact permissions needed:
- Distinctive: line 159
When the template generator creates resources with managed identities, invoke this skill to:
- Distinctive: line 161
Add role assignment resources to the ARM template
- Distinctive: line 162
Follow least-privilege principle automatically
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Azure Role Selector
Recommend the most appropriate Azure RBAC roles following the principle of least privilege. Find minimal built-in roles or define custom roles when needed.
Adapted from github/awesome-copilot azure-role-selector skill.
When to Use
- When deploying resources that need RBAC assignments
- When configuring managed identity access between resources
- When setting up service principals for CI/CD pipelines
- During security analysis to verify correct role assignments
- When user asks "what role do I need for X?"
Procedure
1. Understand Required Permissions
Ask the user what actions they need to perform:
What permissions do you need? Examples:
- "Read and write blobs in a storage account"
- "Deploy code to a Function App"
- "Read secrets from Key Vault"
- "Manage SQL databases"
- "Full access to a resource group"2. Search for Built-In Roles
Use Azure MCP documentation tools to find matching built-in roles:
# List relevant built-in roles
az role definition list \
--query "[?contains(roleName, '{keyword}')].{Name:roleName, Description:description, Id:name}" \
--output table
# Get detailed permissions for a role
az role definition list \
--name "{role-name}" \
--output jsonCross-reference with Microsoft Docs for the latest role definitions.
3. Recommend Least-Privilege Role
Present the recommended role(s) in order of least privilege:
## Role Recommendation
**Desired:** Read and write blobs in storage account starnwkdhk
### Recommended Role (Least Privilege)
| Property | Value |
|----------|-------|
| **Role** | Storage Blob Data Contributor |
| **ID** | ba92f5b4-2d11-453d-a403-e96b0029c9fe |
| **Scope** | Storage Account level |
| **Permissions** | Read, write, delete blobs and containers |
### Alternatives (More Permissive)
| Role | Extra Permissions | Use When |
|------|-------------------|----------|
| Storage Account Contributor | Full account management | Need to manage account settings too |
| Contributor | Full resource management | Need broad access (not recommended) |
### ⚠️ Avoid These (Over-Privileged)
- **Owner** — Grants RBAC management, not needed for data access
- **Contributor** at subscription level — Too broad for storage-only needs4. Generate Assignment Commands
Provide ready-to-use commands:
Azure CLI:
# Assign role to managed identity
az role assignment create \
--assignee {principal-id} \
--role "Storage Blob Data Contributor" \
--scope /subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{name}
# Assign role to service principal
az role assignment create \
--assignee {app-id} \
--role "Storage Blob Data Contributor" \
--scope {resource-id}ARM Template (for inclusion in deployment):
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2022-04-01",
"name": "[guid(resourceId('Microsoft.Storage/storageAccounts', '{name}'), '{principal-id}', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
"scope": "[resourceId('Microsoft.Storage/storageAccounts', '{name}')]",
"properties": {
"roleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
"principalId": "{principal-id}",
"principalType": "ServicePrincipal"
}
}5. Custom Role (If No Built-In Matches)
If no built-in role matches the exact permissions needed:
# Create custom role definition
az role definition create --role-definition '{
"Name": "Custom Storage Reader Writer",
"Description": "Can read and write blobs but not delete",
"Actions": [
"Microsoft.Storage/storageAccounts/blobServices/containers/read",
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read",
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
],
"NotActions": [],
"DataActions": [
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read",
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
],
"NotDataActions": [],
"AssignableScopes": ["/subscriptions/{sub-id}"]
}'Common Role Mappings
| Resource | Action | Recommended Role |
| Storage | Read/write blobs | Storage Blob Data Contributor |
| Storage | Read blobs only | Storage Blob Data Reader |
| Key Vault | Read secrets | Key Vault Secrets User |
| Key Vault | Manage secrets | Key Vault Secrets Officer |
| SQL Database | Read data | SQL DB Contributor |
| Function App | Deploy code | Website Contributor |
| App Service | Deploy code | Website Contributor |
| Cosmos DB | Read/write data | Cosmos DB Account Reader Role |
| Resource Group | Full management | Contributor (scoped to RG) |
| Monitoring | Read metrics | Monitoring Reader |
Integration with Git-Ape
When the template generator creates resources with managed identities, invoke this skill to:
- Identify what roles the managed identity needs
- Add role assignment resources to the ARM template
- Follow least-privilege principle automatically
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

