Skip to content

Commit b8555d1

Browse files
committed
Add the job compression information
1 parent 56d8ade commit b8555d1

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

articles/azure-resource-manager/troubleshooting/error-job-size-exceeded.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Job size exceeded error
33
description: Describes how to troubleshoot errors for job size exceeded or if the template is too large for deployments using a Bicep file or Azure Resource Manager template (ARM template).
44
ms.topic: troubleshooting
55
ms.custom: devx-track-bicep, devx-track-arm-template
6-
ms.date: 06/20/2024
6+
ms.date: 11/07/2024
77
---
88

99
# Resolve errors for job size exceeded
@@ -16,11 +16,11 @@ When deploying a template, you receive an error stating the deployment has excee
1616

1717
## Cause
1818

19-
You get this error when the deployment exceeds an allowed limit. Typically, you see this error when either your template or the job that runs the deployment is too large.
19+
This error occurs when the deployment exceeds the allowed size limits. It usually appears when the template or the deployment job is too large. Note that templates are compressed before their sizes are verified for deployment, so the effective limits may be larger than the template's actual size.
2020

21-
The deployment job can't exceed 1 MB and that includes metadata about the request. For large templates, the metadata combined with the template might exceed a job's allowed size.
21+
The deployment job size limit is 1 MB after compression, including metadata about the request. For large templates, the combined size of metadata and the template may surpass this limit.
2222

23-
The template can't exceed 4 MB, and each resource definition can't exceed 1 MB. The limits apply to the final state of the template after it has been expanded for resource definitions that use loops to create many instances. The final state also includes the resolved values for variables and parameters.
23+
The compressed template size itself cant exceed 4 MB, and each individual resource definition cant exceed 1 MB after compression. These limits apply to the template's final state after expansion for any resource definitions that use loops to create multiple instances, which includes resolved values for all variables and parameters.
2424

2525
Other template limits are:
2626

@@ -54,6 +54,10 @@ dependsOn: [
5454

5555
---
5656

57+
Complex dependencies (a loop of n resources depending on a loop of n resources leads to us storing O(n * n) data rather each resource in a loop depending on its counterpart in the previous loop (O(n)). This one is surprising, but it adds up extremely fast.
58+
59+
Complex dependencies can quickly consume the data limits. For example, if a loop of *n* resources depends on another loop of *n* resources, it results in storing *O(n²)* data. By contrast, if each resource in one loop only depends on its counterpart in the other loop, it results in *O(n)* data. This difference may seem subtle, but the storage impact grows very quickly.
60+
5761
## Solution 2: Simplify template
5862

5963
# [Bicep](#tab/bicep)
@@ -62,7 +66,6 @@ When your file deploys lots of different resource types, consider dividing it in
6266

6367
You can set other resources as implicit dependencies, and [get values from the output of modules](../bicep/outputs.md#outputs-from-modules).
6468

65-
6669
# [JSON](#tab/json)
6770

6871
When your template deploys lots of different resource types, consider dividing it into [linked templates](../templates/linked-templates.md). Divide your resource types into logical groups and add a linked template for each group. For example, if you need to deploy lots of networking resources, you can move those resources to a linked template.
@@ -82,3 +85,19 @@ Try to shorten the length of the names you use for [parameters](../bicep/paramet
8285
Try to shorten the length of the names you use for [parameters](../templates/parameters.md), [variables](../templates/variables.md), and [outputs](../templates/outputs.md). When these values are repeated through copy loops, a long name gets multiplied many times.
8386

8487
---
88+
89+
## Solution 4: Use template specs
90+
91+
# [Bicep](#tab/bicep)
92+
93+
Use [template specs](../bicep/template-specs.md) rather than [Bicep modules](../bicep/modules.md). Bicep modules are converted into a single ARM template with nested templates.
94+
95+
# [JSON](#tab/json)
96+
97+
Use [template specs](../templates/linked-templates.md#template-specs) rather than [nested templates](../templates/templates/linked-templates.md#nested-template).
98+
99+
---
100+
101+
## Solution 5: Reduce incompressible data
102+
103+
Including large amounts of incompressible data, such as certificates or binaries, or data with a low compression ratio in a template or parameters will quickly consume the size limit.

0 commit comments

Comments
 (0)