Azure / Azure/bicep

Minify ARM JSON for deployments

Open
#8,586 5 comments 2 reactions 0 assignees View on GitHub
enhancement Needs: Upvote
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 2h
Merged PRs (30d)
79

Description

During a recent deployment we got an error that the deployment template exceeded the 4MB size limit. When transpiling the Bicep to ARM, the file did in fact exceed 4 MB in size (likely from all of the module references).

I minified the JSON as such
`$inp = get-content .\deploy.json | convertfrom-json |convertTo-json -Depth 100 -Compress | out-file compressed.json`

which removed the human readable formatting and the file shrunk about 33% and was able to be deployed.

**Describe the solution you'd like**
Minify bicep when deploying, offer a switch when transpiling the Bicep to ARM to compress the output.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Bicep-to-ARM transpilation and deployment entry points described in the issue, then inspect how existing switches are exposed. Confirm the ARM JSON can be emitted in compressed form, with an option available during transpilation or deployment, and verify that the resulting template remains deployable under the size limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, json
Domain
build-system, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.