The azure-bicep-github-copilot repository provides essential agent modes, prompt files, and skills specifically designed for Azure Bicep, enhancing development workflows. Perfect for developers looking to streamline their infrastructure as code practices using GitHub Copilot.
claude install johnlokerse/azure-bicep-github-copilotThe azure-bicep-github-copilot skill provides agent modes, prompt files, and tools designed specifically for Azure Bicep development. It integrates with GitHub Copilot to enhance infrastructure as code workflows. This skill is built for developers who want to streamline their Bicep template creation and management practices. It includes pre-configured resources to accelerate Bicep-based infrastructure development.
[{"step":"Define your Bicep resources and parameters","action":"Create a `main.bicep` file in your GitHub repository with the resources you need (e.g., storage accounts, App Services). Use GitHub Copilot to auto-complete the Bicep syntax by describing your infrastructure in comments (e.g., '// Create a storage account with LRS redundancy').","tip":"Use the `bicep` language server in VS Code for real-time validation and IntelliSense."},{"step":"Generate the agent mode configuration","action":"Run the prompt template in GitHub Copilot Chat with placeholders filled in. For example: 'Generate a GitHub Copilot agent mode configuration for my Azure Bicep project that deploys a storage account and App Service to the staging environment. Use https://github.com/acmecorp/azure-infra as the reference repo.'","tip":"Include the `--parameters` file path in the agent mode to ensure environment-specific values are used."},{"step":"Integrate with GitHub Actions","action":"Copy the generated agent mode configuration into `.github/copilot/agent-modes/bicep-deploy.yml`. GitHub Copilot will suggest a corresponding workflow file (e.g., `.github/workflows/deploy.yml`) that automates the deployment pipeline.","tip":"Test the workflow locally using `act` (GitHub Actions runner) before pushing to the repository."},{"step":"Add Prometheus monitoring","action":"After deployment, use the agent mode to generate Prometheus alert rules for your resources. For example, add a rule to monitor storage account availability or App Service response times. Commit these rules to your repository under `.prometheus/rules/`.","tip":"Use the `promtool` CLI to validate alert rules before deployment."},{"step":"Iterate and optimize","action":"Review the deployment logs in GitHub Actions and adjust the Bicep parameters or agent mode configuration as needed. Use GitHub Copilot to suggest optimizations (e.g., 'How can I reduce the cost of my staging App Service Plan?').","tip":"Enable the 'cost_optimization' validation rule in the agent mode to flag potential savings."}]
Automating Azure resource deployment
Generating Bicep templates
Integrating Bicep with CI/CD pipelines
Enhancing code quality with AI suggestions
claude install johnlokerse/azure-bicep-github-copilotgit clone https://github.com/johnlokerse/azure-bicep-github-copilotCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Generate a GitHub Copilot agent mode configuration for [PROJECT_NAME] that automates Azure Bicep deployment workflows. Include [RESOURCE_TYPES] to be provisioned, [ENVIRONMENT] (dev/test/prod), and [GITHUB_REPO_URL] for reference. Ensure the configuration includes validation steps for ARM template compatibility and security best practices.
```yaml
# GitHub Copilot Agent Mode: Azure Bicep Deployment Automation
name: bicep-deploy-pipeline
version: 1.0.0
config:
resource_types:
- Microsoft.Storage/storageAccounts
- Microsoft.Web/serverfarms
- Microsoft.Web/sites
environment: staging
github_repo: https://github.com/acmecorp/azure-infra
validation_rules:
- arm_template_compatibility
- security_best_practices
- cost_optimization
deployment_steps:
- name: Validate Bicep
command: az deployment group validate
params: --resource-group staging-rg --template-file main.bicep
- name: Deploy Infrastructure
command: az deployment group create
params: --resource-group staging-rg --template-file main.bicep --parameters @params.json
- name: Post-Deployment Verification
command: az resource list --resource-group staging-rg --query "[].{Name:name, Type:type}"
expected_output: "Storage account: acmestagingstorage (Microsoft.Storage/storageAccounts)"
```
### Key Features Implemented:
1. **Multi-Resource Deployment**: Automates provisioning of storage accounts and App Service resources with environment-specific parameters.
2. **Validation Pipeline**: Runs ARM template compatibility checks before deployment to catch errors early.
3. **Security Checks**: Embeds security best practices (e.g., storage account encryption, managed identities for App Services).
4. **Cost Optimization**: Flags resources with potential cost savings (e.g., suggests Premium SSD for dev environments).
### Workflow Integration:
- **GitHub Actions**: The agent mode generates a reusable workflow file (`.github/workflows/bicep-deploy.yml`) that GitHub Copilot can auto-complete.
- **Azure CLI**: Uses `az deployment group` commands for idempotent deployments.
- **Prometheus Integration**: After deployment, the agent suggests Prometheus alert rules for monitoring deployed resources (e.g., storage account availability, App Service response times).
### Example Output from Agent:
```
✅ Validation passed for main.bicep in staging environment.
🚀 Deploying resources to staging-rg...
✅ Storage account 'acmestagingstorage' created (SKU: Standard_LRS).
✅ App Service Plan 'acme-staging-plan' deployed (Tier: Basic).
🔍 Post-deployment verification:
- Storage account: acmestagingstorage (Microsoft.Storage/storageAccounts)
- App Service: acme-staging-app (Microsoft.Web/sites)
📊 Suggested Prometheus alerts:
- storage_account_availability{resource_group="staging-rg"}
- app_service_http_5xx_errors{resource_group="staging-rg"}
```Microsoft's cloud platform for compute, storage, AI, and hybrid infrastructure
Orchestrate workloads with multi-cloud support, job scheduling, and integrated service discovery features.
Serverless MySQL database platform
Design, document, and generate code for APIs with interactive tools for developers.
CI/CD automation with build configuration as code
Enhance performance monitoring and root cause analysis with real-time distributed tracing.
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan