ARM templates have always been powerful but verbose. Azure Bicep is a new DSL that compiles to ARM templates. It’s like TypeScript for ARM. Here’s an early look.
What is Bicep?
Bicep is a domain-specific language that transpiles to ARM JSON. Write cleaner code, get the same deployment artifacts.
ARM vs Bicep
// Bicep - Clean and readable
param location string = resourceGroup().location
param storageAccountName string
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-02-01' = {
name: storageAccountName
location: location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
}
output storageAccountId string = storageAccount.id
Compare to the equivalent ARM JSON – about 50% less code.
Key Benefits
- Type safety: IntelliSense and validation
- Modularity: Import modules easily
- No state: Compiles to ARM, uses Azure’s state
- Transparency: View generated ARM anytime
References
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.