This requires Bicep installed either locally or on your agent, you can find the steps for various methods here: Install Bicep tools – Azure Resource Manager | Microsoft Learn
1. Run the decompiler
Once installed, open a terminal where your ARM JSON lives and run:
az bicep decompile --file mytemplate.json
This gives you a .bicep file with most of the resources mapped across. Review the output carefully, because the tooling still can’t untangle every parameterisation or nested resource.
2. Untangle and refactor
- Remove dead parameters: ARM is parameter-happy. Bicep simplifies this, so drop anything unused.
- Modularise: Break up massive templates into sensible, reusable Bicep modules (think: networking, compute, storage).
- Rename and Document: ARM resource names are often…garbage. Use this as a chance to bring clear, descriptive naming and decent comments.
3. Validate with What-If
Use Azure’s what-if deployment feature to ensure the converted Bicep will not destroy your platform:
az deployment sub what-if --template-file main.bicep
Catch resource drift or accidental removals before you hit apply, not after.
4. Pipeline-ready
- Add linting: Drop Bicep linter into your pipeline (it’ll catch style and basic errors).
- Automate deployments: Bicep slides right into Azure DevOps or GitHub Actions. Set up CI/CD so no one merges broken code.
- Stage rollouts: Deploy Bicep to a test subscription/management group before taking a swing at prod.