Management and Governance Bicep premium

Bicep decompile

Bicep decompile is the command that converts an existing ARM JSON template into a Bicep file. It is most useful when a team has older templates, exported portal templates, or vendor-provided JSON and wants to move toward clearer infrastructure code. Decompile gives you a starting point, not a perfect final design. After conversion, engineers should rename symbols, remove noise, add modules, check parameters, and run build, lint, and what-if before trusting it for production. That makes the term easier to recognize during design reviews, pipeline troubleshooting, and postdeployment validation.

Aliases
No aliases mapped yet
Difficulty
intermediate
CLI mappings
5
Last verified
2026-05-11

Microsoft Learn

Bicep decompile converts Azure Resource Manager JSON templates into Bicep files that can be reviewed, refactored, and redeployed. Microsoft Learn places it in Decompile a JSON Azure Resource Manager template to Bicep; operators confirm scope, configuration, dependencies, and production impact.

Microsoft Learn: Decompile a JSON Azure Resource Manager template to Bicep2026-05-11

Technical context

Technically, az bicep decompile reads an ARM template JSON file and writes a .bicep file, normally in the same directory. If the target Bicep file already exists, the force option can overwrite it. The tool translates deployable JSON syntax into Bicep syntax, but it cannot infer every naming convention, module boundary, or architecture decision. Microsoft guidance expects teams to revise the generated Bicep file, then compile it back to ARM JSON and test deployment behavior before rollout.

Why it matters

Bicep decompile matters because many Azure estates still contain years of ARM JSON templates. Those files often work, but they can be hard to read, review, and modernize. Decompilation accelerates migration to Bicep without forcing teams to rewrite everything by hand. It also helps platform teams compare old and new deployment behavior. The practical value comes after cleanup: decompiled files may contain awkward names, duplicated logic, or weak structure. Treat decompile as a migration step that starts refactoring, not as an automatic modernization finish line. This keeps architecture decisions visible for reviewers, helps support teams understand intended behavior, and gives release managers evidence before approving changes.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

You see Bicep decompile in migration projects where old azuredeploy.json files are converted into main.bicep files before refactoring and review. Operators use this evidence during release review.

Signal 02

You see it in CI history when teams compare generated Bicep, rebuilt ARM JSON, and what-if output during infrastructure modernization. Operators use this evidence during release review.

Signal 03

You see decompile cleanup warnings when converted templates contain awkward symbolic names, legacy parameters, or patterns that need manual refactoring. Operators use this evidence during release review.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Standardize Azure infrastructure as code across teams and environments.
  • Reduce manual portal configuration by making deployment behavior reviewable and repeatable.
  • Support CI checks that catch template problems before production changes.
  • Create clearer handoffs between platform modules, application teams, and operations runbooks.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Pharmaceutical ARM template migration

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

Crestline BioPharma had regulated lab environments deployed from old ARM JSON templates that few engineers could safely modify.

Business/Technical Objectives
  • Convert core lab templates to readable Bicep.
  • Preserve deployment behavior during migration.
  • Improve reviewability before adding new security controls.
  • Reduce maintenance time for environment updates.
Solution Using Bicep decompile

The infrastructure team used az bicep decompile to convert each ARM template into a Bicep starting point, then renamed generated symbols, removed noisy exported properties, and split common resources into modules. Each converted file was rebuilt with az bicep build and compared against the original ARM JSON for critical resources. What-if deployments validated behavior in a sandbox before production rollout. Security changes were deferred until after equivalent deployments were proven. The team documented ownership, rollback steps, and approval evidence so operators could distinguish intentional template behavior from configuration drift. Pipeline checks compared expected deployment output with actual Azure inventory before the release was marked complete. Runbooks were updated with validation commands, known failure modes, and the escalation path for production changes.

Results & Business Impact
  • Converted 34 ARM templates over two release cycles.
  • Reduced average template review time from 3.5 hours to 75 minutes.
  • Maintained zero production deployment regressions during migration.
  • Identified 19 outdated secret-handling patterns for a later remediation sprint.
Key Takeaway for Glossary Readers

Bicep decompile accelerates modernization, but the real value comes from disciplined cleanup and equivalence testing.

Case study 02

School district portal export cleanup

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

North Ridge Public Schools exported portal-created ARM templates for classroom analytics resources and needed to bring them into source control.

Business/Technical Objectives
  • Create maintainable Bicep from exported JSON.
  • Remove unnecessary generated properties from portal exports.
  • Train operations staff on repeatable deployments.
  • Prevent accidental changes to student data resources.
Solution Using Bicep decompile

The district decompiled the exported JSON, then had an Azure engineer refactor it into parameterized Bicep modules for storage, analytics, and diagnostics. The team used lint rules to find decompiler cleanup issues and build output to confirm the final ARM template remained deployable. What-if was required against a test resource group before any production change. Sensitive data stores were referenced as existing resources until ownership and backup rules were documented. The team documented ownership, rollback steps, and approval evidence so operators could distinguish intentional template behavior from configuration drift. Pipeline checks compared expected deployment output with actual Azure inventory before the release was marked complete.

Results & Business Impact
  • Moved five portal-built environments into source control in one month.
  • Reduced manual deployment steps from 27 to six.
  • Avoided changes to existing student data storage during the first rollout.
  • Improved operator training completion from 40 percent to 92 percent.
Key Takeaway for Glossary Readers

Decompiling portal exports is a practical first step, not a substitute for refactoring and operational training.

Case study 03

Ecommerce acquisition template rescue

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

BrightCart Commerce acquired a regional marketplace whose Azure resources were deployed from undocumented ARM JSON files.

Business/Technical Objectives
  • Understand inherited infrastructure quickly.
  • Convert deployment assets into a standard Bicep repository.
  • Identify risky legacy settings before integration.
  • Prepare templates for future modular reuse.
Solution Using Bicep decompile

Cloud architects decompiled the inherited JSON templates and grouped the generated Bicep files by application tier. They compared rebuilt ARM JSON with the original, then used lint findings to clean ambiguous symbols and unused variables. Networking and identity resources were temporarily declared as existing resources to avoid accidental replacement. After what-if confirmed no destructive changes, the team modularized app service, database, and monitoring components for the parent platform pipeline. The team documented ownership, rollback steps, and approval evidence so operators could distinguish intentional template behavior from configuration drift. Pipeline checks compared expected deployment output with actual Azure inventory before the release was marked complete. Runbooks were updated with validation commands, known failure modes, and the escalation path for production changes.

Results & Business Impact
  • Completed infrastructure discovery two weeks faster than planned.
  • Found 11 public network exposure settings requiring governance review.
  • Reduced future marketplace environment deployment time by 68 percent.
  • Created reusable modules for three acquired-application patterns.
Key Takeaway for Glossary Readers

Bicep decompile helps acquisition teams turn opaque ARM templates into reviewable infrastructure code.

Why use Azure CLI for this?

CLI commands make decompile repeatable, auditable, and easy to combine with build, lint, and what-if checks in migration pipelines.

CLI use cases

  • Convert an ARM JSON template into a starting Bicep file for migration work.
  • Compile the decompiled file back to ARM JSON and compare important resource declarations.
  • Run lint and what-if to identify cleanup work before using the converted file in production.

Before you run CLI

  • Confirm the active tenant, subscription, resource group, deployment scope, and parameter file before running Bicep commands.
  • Check the installed Bicep CLI version and whether external modules must be restored from a registry.
  • Run commands from the repository folder that should control bicepconfig.json resolution and relative module paths.
  • Make sure the pipeline or user identity has only the permissions needed for restore, what-if, and deployment.

What output tells you

  • Build output shows whether the Bicep source compiles into valid ARM JSON and whether module restore succeeded.
  • Lint output identifies syntax, rule, naming, cleanup, or maintainability issues before a deployment touches Azure.
  • What-if output shows which Azure resources would be created, modified, skipped, or deleted for the current parameters.
  • Deployment output or query results show the resource IDs, endpoints, or module values returned after a completed deployment.

Mapped Azure CLI commands

Bicep decompile validation and operations

direct
az bicep version
az bicepdiscoverManagement and Governance
az bicep build --file main.bicep
az bicepprovisionManagement and Governance
az bicep lint --file main.bicep
az bicepdiscoverManagement and Governance
az deployment group what-if --resource-group <resource-group> --template-file main.bicep
az deployment groupdiscoverManagement and Governance
az bicep decompile --file azuredeploy.json
az bicepdiscoverManagement and Governance

Architecture context

Technically, az bicep decompile reads an ARM template JSON file and writes a .bicep file, normally in the same directory. If the target Bicep file already exists, the force option can overwrite it. The tool translates deployable JSON syntax into Bicep syntax, but it cannot infer every naming convention, module boundary, or architecture decision. Microsoft guidance expects teams to revise the generated Bicep file, then compile it back to ARM JSON and test deployment behavior before rollout.

Security

Security review is critical after decompilation because the converted file may preserve old patterns that were acceptable years ago but risky now. Check parameters for hardcoded secrets, weak defaults, overly broad network access, missing diagnostic settings, and unmanaged identities. Rename symbols so reviewers understand which resources control sensitive paths. Add secure decorators where appropriate and keep secrets out of outputs. Run lint and policy-aware what-if checks before deployment. A clean Bicep syntax file can still describe insecure infrastructure if old JSON did. Security teams should pair the pattern with least privilege, policy checks, repository review, and controlled parameters in shared pipelines.

Cost

Cost impact comes from modernization choices made after decompile. The conversion itself is local, but the resulting template can recreate expensive SKUs, regional replicas, diagnostics, or retention settings inherited from old JSON. Review cost-sensitive properties while refactoring, and compare what-if output with expected inventory. Decompile can reduce long-term cost by making oversized defaults easier to spot and standardize. It can also create surprise spend if engineers redeploy old templates broadly without checking current pricing, regions, or environment-specific parameters. Cost owners should review defaults, environment parameters, and what-if output because small template changes can multiply across many deployments. Cost owners should review defaults, environment parameters, and what-if output because small template changes can multiply across many deployments.

Reliability

Reliability depends on proving that the decompiled Bicep behaves like the original template while improving maintainability. Compile the new file back to ARM JSON, compare important resources, and run what-if against safe scopes. Validate parameters, dependencies, copy loops, outputs, and nested templates carefully because conversions can expose design problems. Refactor gradually into modules and keep rollback paths to the original template until tests pass. Do not combine decompile migration with unrelated production changes unless the release plan can absorb troubleshooting time. Reliable teams also rehearse rollback, check generated resources after deployment, and document how downstream modules behave when the pattern changes.

Performance

Performance considerations include conversion speed, pipeline time, and the runtime behavior of resources described by the converted template. Decompile may produce valid but verbose Bicep that is harder to read and slower to review. Refactoring into modules, variables, and clearer parameters can improve maintainability without changing runtime performance. Run build and what-if after cleanup to verify generated ARM JSON stays manageable. For large templates, migrate in slices so editor tooling, linting, and deployment validation remain responsive during the project. Performance reviewers should compare pipeline duration, provider throttling, generated template size, and runtime impact before scaling the pattern broadly. Performance reviewers should compare pipeline duration, provider throttling, generated template size, and runtime impact before scaling the pattern broadly.

Operations

Operationally, decompile should be handled as a migration workflow with inventory, conversion, cleanup, testing, and adoption steps. Start with a small set of templates, document naming decisions, and keep generated files in source control. CI should run az bicep build and lint on every converted file. Operators should record what changed between original JSON and final Bicep. When portal-exported templates include unnecessary properties, remove them deliberately and explain why. Update runbooks so future deployments use Bicep consistently. Operators should keep examples, expected outputs, owner contacts, and troubleshooting steps near the repository that deploys the template. Operators should keep examples, expected outputs, owner contacts, and troubleshooting steps near the repository that deploys the template.

Common mistakes

  • Treating decompiled Bicep as production-ready without cleanup, naming review, or what-if testing.
  • Overwriting an existing Bicep file with force before saving the previous version.
  • Migrating old JSON and changing live infrastructure in the same unreviewed release.