User-Defined Types has increased Template above size limits [hit 4 MB limit] #17623
Replies: 4 comments 1 reply
-
I was wondering @SydneyhSmith is this something where a solution is already in planning? I assume there is no bug, however there might be some way to work around the limit? I guess in short, is there anywhere I can understand more on what the category "scopes" references? I'm interested to continue with my exploration into user-defined types, so interested to determine where I can spend my efforts, without getting blocked. Now that I can define custom types, then reference the type definitions in a bicep file, then reference with 'using' to the Bicep file, in my param file, I'll likely default to bicepparam format for all of my data files and projects (not just Bicep ARM deploys) ... Then compile it to json at run time. This way I get the intellisense and schema validation for parameters across many different project types. I won't ever deploy the Bicep, just use it for schema and data inputs for other projects (to replace anywhere I use json today or psd1 today).
TL;DR Looking forward to hearing more on scopes.?! |
Beta Was this translation helpful? Give feedback.
-
@brwilkinson we don't have a committed plan at this point but are doing a lot of brainstorming on how we could improve a variety of "issues" folks hit in Bicep around scoping rules, module representation and size limitations... we want to make sure to include your scenario as an example thinking through this category of work |
Beta Was this translation helpful? Give feedback.
-
Thank you for the context @SydneyhSmith this is helpful. |
Beta Was this translation helpful? Give feedback.
-
@anthony-c-martin is there anything I could do with local deploy to pre-compile the Bicep + Bicep params locally to get around the template size limit? I was thinking maybe it could build down to the final ARM template, with all parameters and Types already resolved to values, then pass that to ARM? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Bicep version
Bicep CLI version 0.36.177 (09988bb)
Describe the bug
I just spent two days converting a Bicep project that I have to use User-Defined Types. The overall experience was extremely positive, and I was able to do the conversion in two full days of work.
I used the -whatif deployment and linting to work through all issues and ensure i had coverage of using the types etc.
At the end of the day, I have run into an issue with my main.bicep template size.
If i switch to the branch without user-defined types and build the template it shows
If i switch to the new branch with user-defined types and build the template it shows
The thing is that this top-level template only has Modules in it and no Resources.
This is not the actual template, however it's nearly identical
As shown below, only deployments in exist in this top level... so the issue here is not max deployment size, where I can break it down into smaller nested deployment. I am hitting the max template size overall.
Today is day three of this conversion, so I am at the very beginning, and I am still feeling out the custom type definitions. I actually have not got very granular on my types yet. However, I already hit a blocker.
I am sure I can find some ways to review the 122177 lines are json ARM templates and look for some ways to figure out how to make it more efficient. ✅
I will leave it at that for now. I will update if/once I find anything useful..
Beta Was this translation helpful? Give feedback.
All reactions