πΉ Feature: Bicep CLI β and Especially the Bicep Console
πΉ What It Does: The Bicep CLI is so much more than just a compiler to ARM JSON. It builds, lints, restores, decompiles, formats, snapshots, and offers JSON-RPC β but the standout feature is bicep console, a fully interactive REPL where you can type Bicep expressions and instantly see the results. A safe, local playground for your infrastructure code. π§ͺ
What Is It Giving You:
β
Instant Expression Evaluation: Type any valid Bicep expression and see the output immediately β no build, no deploy, no Azure round-trip. Learning a new function? Test it live.
β
Variables + Multi-Line Support: Declare variables using var and reuse them. Multi-line complex expressions are supported with automatic structural detection.
β
Real-Time Syntax Highlighting: Input and output are colorized so you catch mistakes before they reach a template. Supports nearly all Bicep functions.
β
Unit-Test Your User-Defined Functions: Validate your UDFs return exactly what you intend β no deployment required. Prototype, verify, and then commit.
β
Validate AI-Generated Code Safely: Paste Copilot-generated Bicep functions into the console to confirm correctness before trusting them in production.
β
Automation-Ready stdin/stdout: Since v0.40.2, piping input and output is supported. Use it in scripts or CI to auto-test functions without hacks.
β
Already in Your Toolbox: Azure CLI 2.20.0+ includes Bicep CLI automatically. Launch the REPL with bicep console (v0.42.1+ required).
The Full Bicep CLI Lineup:
π§ build β compile Bicep to ARM JSON
π§ lint β catch errors and linter-rule violations
π§ restore β pull external modules to local cache
π§ snapshot β offline diff of your infra logic
π§ jsonrpc β programmatic JSON-RPC interface
π§ console β the interactive REPL playgrounde REPL playground
π The shift: Stop creating throwaway test deployments just to see what a function does. Open the console and get your answer in one line.
πsnapshot β generate a normalized JSON of your infra to diff offline, perfect for comparing environments (DEV vs TEST vs PROD) or catching unintended logic drift between two versions of your templates without ever touching Azure
π https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-cli
π https://github.com/Azure/bicep/blob/main/docs/experimental/console-command.md