Generate Bicep Infrastructure as Code Templates
An Azure Bicep skill for production IaC templates - secure Key Vault config, module patterns, resource loops, and cost/deployment optimization.
Why it matters
Automate the creation of secure, maintainable, and production-ready Azure Bicep templates for Infrastructure as Code. Ensure adherence to best practices for resource configuration, security, and cost optimization.
Outcomes
What it gets done
Create Bicep templates with clear parameter definitions and variable usage.
Implement security best practices including Key Vault integration and Managed Identities.
Structure templates using modules for reusability and conditional resource creation.
Optimize deployments for performance and cost, including resource scheduling and appropriate SKUs.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-bicep-template-creator | bash Overview
Bicep Template Creator Agent
An Azure Bicep skill for writing production IaC templates with validated parameters, secure Key Vault and managed identity resources, and reusable module patterns. It covers conditional and looped resource creation, custom exported types, and validation via az bicep build and --what-if previews. Use it when writing production Azure infrastructure templates that need real security, reusability, and pre-deployment validation - not for throwaway single-resource templates deployed without testing.
What it does
This skill is expert in creating Azure Bicep templates for Infrastructure as Code, writing clean, maintainable, production-ready templates that follow Azure best practices, security configurations, and cost/performance optimization. Its template structure principles call for clear parameter definitions with types and validation, proper variable usage for computed values, structured outputs for pipeline integration, kebab-case naming conventions, and modules for complex-template reusability. Its resource configuration principles require explicit API versions for stability, symbolic-name dependency management, conditions and loops for dynamic resources, and tagging for management and cost control. It covers parameter patterns with @allowed value lists, @minLength/@maxLength validation, and @secure() for sensitive values like admin passwords, security patterns like a Key Vault with RBAC authorization, soft-delete and purge protection enabled, and default-deny network ACLs, plus a managed identity resource for credential-free service authentication.
When to use - and when NOT to
Use this skill when writing production Azure infrastructure templates that need real security and reusability patterns, not throwaway single-resource templates. It covers a module pattern for encapsulating a storage account with HTTPS-only traffic, TLS 1.2 minimum, and public blob access disabled; conditional resource creation using an if expression tied to a boolean parameter; resource loops iterating over an array of VM configs; custom exported types constraining SKU names to an allowed set; and the @batchSize() decorator for controlling parallelism when looping over many resources like per-subnet network security groups. It is not meant to skip validation before deployment - its testing guidance requires az bicep build validation, --what-if previews, environment-specific parameter files, and testing with minimally privileged service principals, not deploying templates straight to production untested.
Inputs and outputs
// Key Vault integration
resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' = {
name: '${namePrefix}-kv'
location: location
properties: {
sku: {
family: 'A'
name: 'standard'
}
tenantId: tenant().tenantId
enableRbacAuthorization: true
enableSoftDelete: true
softDeleteRetentionInDays: 90
purgeProtectionEnabled: true
networkAcls: {
defaultAction: 'Deny'
ipRules: []
virtualNetworkRules: []
}
}
}
Given an infrastructure requirement, the skill produces complete Bicep templates: validated parameter blocks, secure resources like the Key Vault above, reusable modules with typed inputs and outputs, conditional and looped resource declarations, custom exported types, assert-based validation checks for naming constraints, and cost-optimization guidance (automatic dev VM shutdown, environment-appropriate SKUs, storage lifecycle management).
Who it's for
Cloud and platform engineers writing Azure Infrastructure as Code who need production-grade security and reusability patterns built in from the start - RBAC-based Key Vault access, network ACL defaults, and validated parameters - rather than assembling them ad hoc. It suits teams following the Azure Well-Architected Framework who want modular templates with parallel-deployment-aware resource loops, and who validate every template with az bicep build and --what-if previews before it reaches a CI/CD pipeline.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.