|
| 1 | +# Azure Administration Skill |
| 2 | + |
| 3 | +Comprehensive Azure administration capabilities for Claude Code, covering identity management, resource orchestration, CLI tooling, and DevOps automation. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +This skill enables Claude Code to assist with: |
| 8 | + |
| 9 | +- **Identity & Access Management**: User provisioning, RBAC, service principals, managed identities |
| 10 | +- **Resource Management**: Subscriptions, resource groups, ARM templates, Bicep deployments |
| 11 | +- **CLI & Tooling**: az CLI patterns, azd workflows, JMESPath queries |
| 12 | +- **MCP Integration**: Azure MCP server for AI-powered Azure operations |
| 13 | +- **DevOps Automation**: CI/CD pipelines, infrastructure as code, deployment strategies |
| 14 | +- **Cost & Governance**: Budget management, policy enforcement, compliance |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +### Required |
| 19 | + |
| 20 | +1. **Azure Subscription**: Active Azure subscription with appropriate permissions |
| 21 | +2. **Azure CLI**: Installed and authenticated |
| 22 | + ```bash |
| 23 | + # Install (macOS) |
| 24 | + brew install azure-cli |
| 25 | + |
| 26 | + # Install (Linux) |
| 27 | + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash |
| 28 | + |
| 29 | + # Verify |
| 30 | + az --version |
| 31 | + az login |
| 32 | + ``` |
| 33 | + |
| 34 | +3. **Permissions**: Minimum required permissions depend on operations: |
| 35 | + - **User management**: User Administrator or Global Administrator |
| 36 | + - **RBAC assignments**: Owner or User Access Administrator |
| 37 | + - **Resource management**: Contributor or higher |
| 38 | + - **Read-only operations**: Reader role sufficient |
| 39 | + |
| 40 | +### Optional (Enhanced Capabilities) |
| 41 | + |
| 42 | +1. **Azure Developer CLI (azd)**: |
| 43 | + ```bash |
| 44 | + # Install (macOS) |
| 45 | + brew tap azure/azd && brew install azd |
| 46 | + |
| 47 | + # Install (Linux) |
| 48 | + curl -fsSL https://aka.ms/install-azd.sh | bash |
| 49 | + |
| 50 | + # Verify |
| 51 | + azd version |
| 52 | + ``` |
| 53 | + |
| 54 | +2. **Azure MCP Server** (for AI-powered workflows): |
| 55 | + ```bash |
| 56 | + # Install globally |
| 57 | + npm install -g @modelcontextprotocol/server-azure |
| 58 | + |
| 59 | + # Configure in Claude Code MCP settings (~/.config/claude-code/mcp.json) |
| 60 | + { |
| 61 | + "mcpServers": { |
| 62 | + "azure": { |
| 63 | + "command": "npx", |
| 64 | + "args": ["-y", "@modelcontextprotocol/server-azure"], |
| 65 | + "env": { |
| 66 | + "AZURE_SUBSCRIPTION_ID": "your-subscription-id" |
| 67 | + } |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | + ``` |
| 72 | + |
| 73 | +3. **Bicep CLI** (for infrastructure as code): |
| 74 | + ```bash |
| 75 | + # Bicep is included with Azure CLI 2.20.0+ |
| 76 | + az bicep install |
| 77 | + az bicep version |
| 78 | + ``` |
| 79 | + |
| 80 | +4. **Azure PowerShell** (Windows environments): |
| 81 | + ```powershell |
| 82 | + Install-Module -Name Az -Repository PSGallery -Force |
| 83 | + Connect-AzAccount |
| 84 | + ``` |
| 85 | + |
| 86 | +## Installation |
| 87 | + |
| 88 | +1. **Verify Azure CLI authentication**: |
| 89 | + ```bash |
| 90 | + az login |
| 91 | + az account show |
| 92 | + ``` |
| 93 | + |
| 94 | +2. **Set default subscription** (if you have multiple): |
| 95 | + ```bash |
| 96 | + az account set --subscription "My Subscription Name" |
| 97 | + ``` |
| 98 | + |
| 99 | +3. **Test access**: |
| 100 | + ```bash |
| 101 | + # List resource groups |
| 102 | + az group list --output table |
| 103 | + |
| 104 | + # Check current user |
| 105 | + az ad signed-in-user show |
| 106 | + ``` |
| 107 | + |
| 108 | +4. **Optional: Install Azure MCP** (see Optional section above) |
| 109 | + |
| 110 | +5. **Skill is ready**: Claude Code will auto-activate this skill when you use Azure-related keywords in your requests. |
| 111 | + |
| 112 | +## Quick Start |
| 113 | + |
| 114 | +### Basic Operations |
| 115 | + |
| 116 | +**List resources:** |
| 117 | +``` |
| 118 | +Show me all VMs in my subscription |
| 119 | +``` |
| 120 | + |
| 121 | +**Create resource group:** |
| 122 | +``` |
| 123 | +Create a resource group named 'my-app-rg' in East US |
| 124 | +``` |
| 125 | + |
| 126 | +**Deploy infrastructure:** |
| 127 | +``` |
| 128 | +Deploy the Bicep template in ./infra/main.bicep to resource group 'my-app-rg' |
| 129 | +``` |
| 130 | + |
| 131 | +### Identity Management |
| 132 | + |
| 133 | +**Create user:** |
| 134 | +``` |
| 135 | +Create a new Entra ID user named Jane Doe with email jane@contoso.com |
| 136 | +``` |
| 137 | + |
| 138 | +**Assign RBAC role:** |
| 139 | +``` |
| 140 | +Give jane@contoso.com Reader access to resource group 'my-app-rg' |
| 141 | +``` |
| 142 | + |
| 143 | +**Create service principal:** |
| 144 | +``` |
| 145 | +Create a service principal with Contributor role for my CI/CD pipeline |
| 146 | +``` |
| 147 | + |
| 148 | +### DevOps Workflows |
| 149 | + |
| 150 | +**Setup environment:** |
| 151 | +``` |
| 152 | +Use azd to create a new development environment for a Node.js app |
| 153 | +``` |
| 154 | + |
| 155 | +**Run deployment:** |
| 156 | +``` |
| 157 | +Deploy my application to Azure using the existing Bicep templates |
| 158 | +``` |
| 159 | + |
| 160 | +## File Structure |
| 161 | + |
| 162 | +``` |
| 163 | +azure-admin/ |
| 164 | +├── SKILL.md # Main skill content (auto-loaded) |
| 165 | +├── README.md # This file |
| 166 | +├── tools/ # Helper scripts |
| 167 | +│ ├── bulk-operations.sh # Batch user/resource operations |
| 168 | +│ ├── cost-report.sh # Generate cost reports |
| 169 | +│ └── compliance-check.sh # Verify policy compliance |
| 170 | +├── docs/ # Deep-dive documentation |
| 171 | +│ ├── user-management.md # Identity and user operations |
| 172 | +│ ├── role-assignments.md # RBAC patterns and custom roles |
| 173 | +│ ├── resource-management.md # Resource lifecycle and advanced patterns |
| 174 | +│ ├── mcp-integration.md # Azure MCP tools and workflows |
| 175 | +│ ├── cli-patterns.md # Advanced CLI scripting and queries |
| 176 | +│ ├── devops-automation.md # CI/CD and GitOps patterns |
| 177 | +│ ├── cost-optimization.md # Cost management and optimization |
| 178 | +│ └── troubleshooting.md # Common issues and solutions |
| 179 | +├── examples/ # Concrete workflow examples |
| 180 | +│ ├── bulk-user-onboarding.md # Automated user provisioning |
| 181 | +│ ├── environment-setup.md # Complete environment deployment |
| 182 | +│ ├── role-audit.md # RBAC compliance auditing |
| 183 | +│ └── mcp-workflow.md # AI-powered Azure operations |
| 184 | +└── references/ # External learning resources |
| 185 | + ├── microsoft-learn.md # Official learning paths |
| 186 | + ├── az-104-guide.md # AZ-104 certification guide |
| 187 | + └── api-references.md # API and SDK documentation |
| 188 | +``` |
| 189 | + |
| 190 | +## Common Use Cases |
| 191 | + |
| 192 | +### Scenario 1: New Team Member Onboarding |
| 193 | + |
| 194 | +``` |
| 195 | +I need to onboard 10 new engineers to our Azure environment. They should: |
| 196 | +- Have Entra ID accounts |
| 197 | +- Be added to the 'Engineering' security group |
| 198 | +- Get Contributor access to the 'dev-*' resource groups |
| 199 | +- Have MFA enabled |
| 200 | +
|
| 201 | +Use the template in examples/bulk-user-onboarding.md |
| 202 | +``` |
| 203 | + |
| 204 | +### Scenario 2: Environment Provisioning |
| 205 | + |
| 206 | +``` |
| 207 | +Setup a new production environment for our web application with: |
| 208 | +- Resource group in East US 2 |
| 209 | +- App Service Plan (P1v3) |
| 210 | +- Azure SQL Database (S1 tier) |
| 211 | +- Application Insights |
| 212 | +- Key Vault for secrets |
| 213 | +- All resources properly tagged |
| 214 | +
|
| 215 | +Use azd and Bicep templates from examples/environment-setup.md |
| 216 | +``` |
| 217 | + |
| 218 | +### Scenario 3: Cost Optimization Audit |
| 219 | + |
| 220 | +``` |
| 221 | +Analyze our current Azure spending and provide recommendations: |
| 222 | +- Identify idle resources |
| 223 | +- Check for oversized VMs |
| 224 | +- Find untagged resources |
| 225 | +- Calculate reserved instance savings opportunities |
| 226 | +- Generate cost report for management |
| 227 | +
|
| 228 | +Reference docs/cost-optimization.md for patterns |
| 229 | +``` |
| 230 | + |
| 231 | +### Scenario 4: RBAC Compliance Review |
| 232 | + |
| 233 | +``` |
| 234 | +Audit all role assignments in our subscription: |
| 235 | +- List users with Owner or Contributor roles |
| 236 | +- Find role assignments that haven't been reviewed in 90+ days |
| 237 | +- Identify service principals with excessive permissions |
| 238 | +- Generate compliance report |
| 239 | +
|
| 240 | +Use examples/role-audit.md workflow |
| 241 | +``` |
| 242 | + |
| 243 | +## Troubleshooting |
| 244 | + |
| 245 | +### Authentication Issues |
| 246 | + |
| 247 | +**Problem**: `az login` fails or credentials expired |
| 248 | + |
| 249 | +**Solution**: |
| 250 | +```bash |
| 251 | +# Clear cached credentials |
| 252 | +az logout |
| 253 | +az account clear |
| 254 | + |
| 255 | +# Re-authenticate |
| 256 | +az login --use-device-code |
| 257 | + |
| 258 | +# Verify |
| 259 | +az account show |
| 260 | +``` |
| 261 | + |
| 262 | +### Permission Denied Errors |
| 263 | + |
| 264 | +**Problem**: "Insufficient privileges" or "Forbidden" errors |
| 265 | + |
| 266 | +**Solution**: |
| 267 | +```bash |
| 268 | +# Check your current role assignments |
| 269 | +az role assignment list --assignee $(az ad signed-in-user show --query id -o tsv) |
| 270 | + |
| 271 | +# Verify subscription context |
| 272 | +az account show |
| 273 | + |
| 274 | +# Request proper access from subscription administrator |
| 275 | +``` |
| 276 | + |
| 277 | +### MCP Server Not Working |
| 278 | + |
| 279 | +**Problem**: Azure MCP tools not available in Claude Code |
| 280 | + |
| 281 | +**Solution**: |
| 282 | +1. Verify Node.js 18+ installed: `node --version` |
| 283 | +2. Reinstall MCP server: `npm install -g @modelcontextprotocol/server-azure` |
| 284 | +3. Check MCP configuration in `~/.config/claude-code/mcp.json` |
| 285 | +4. Restart Claude Code |
| 286 | +5. Test: Ask "List my Azure resource groups" |
| 287 | + |
| 288 | +### Resource Not Found |
| 289 | + |
| 290 | +**Problem**: Can't find expected Azure resources |
| 291 | + |
| 292 | +**Solution**: |
| 293 | +```bash |
| 294 | +# Verify subscription context |
| 295 | +az account show |
| 296 | + |
| 297 | +# List all subscriptions |
| 298 | +az account list --output table |
| 299 | + |
| 300 | +# Switch to correct subscription |
| 301 | +az account set --subscription "My Subscription" |
| 302 | + |
| 303 | +# Search across all subscriptions |
| 304 | +az resource list --name "myResourceName" |
| 305 | +``` |
| 306 | + |
| 307 | +## Learning Path |
| 308 | + |
| 309 | +1. **Start Here**: Read SKILL.md for overview and quick reference |
| 310 | +2. **Core Operations**: Study docs/user-management.md and docs/resource-management.md |
| 311 | +3. **Security**: Review docs/role-assignments.md for RBAC patterns |
| 312 | +4. **Automation**: Explore docs/devops-automation.md and examples/ |
| 313 | +5. **Advanced**: MCP integration (docs/mcp-integration.md) and custom solutions |
| 314 | +6. **Certification**: Follow references/az-104-guide.md for AZ-104 preparation |
| 315 | + |
| 316 | +## Support and Resources |
| 317 | + |
| 318 | +### Official Microsoft Resources |
| 319 | +- Azure Documentation: https://docs.microsoft.com/azure |
| 320 | +- Azure CLI Reference: https://docs.microsoft.com/cli/azure |
| 321 | +- Microsoft Learn: https://learn.microsoft.com/azure |
| 322 | +- Azure Updates: https://azure.microsoft.com/updates |
| 323 | + |
| 324 | +### Community Resources |
| 325 | +- Azure Tech Community: https://techcommunity.microsoft.com/azure |
| 326 | +- Stack Overflow: https://stackoverflow.com/questions/tagged/azure |
| 327 | +- GitHub Issues: https://github.com/Azure/azure-cli/issues |
| 328 | + |
| 329 | +### Skill-Specific Resources |
| 330 | +- See references/ directory for curated learning paths |
| 331 | +- Check examples/ for real-world workflow templates |
| 332 | +- Review docs/ for deep technical content |
| 333 | + |
| 334 | +## Contributing |
| 335 | + |
| 336 | +To enhance this skill: |
| 337 | + |
| 338 | +1. **Add new patterns**: Update relevant docs/ files |
| 339 | +2. **Share examples**: Create new workflow examples in examples/ |
| 340 | +3. **Update references**: Keep reference materials current |
| 341 | +4. **Report issues**: Document problems in docs/troubleshooting.md |
| 342 | + |
| 343 | +## Version History |
| 344 | + |
| 345 | +- **1.0.0** (2025-01-22): Initial release with comprehensive Azure administration coverage |
| 346 | + |
| 347 | +## License |
| 348 | + |
| 349 | +This skill is part of the amplihack framework and follows the same license terms. |
0 commit comments