You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/troubleshooting/error-job-size-exceeded.md
+31-22Lines changed: 31 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Job size exceeded error
3
3
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).
@@ -16,11 +16,11 @@ When deploying a template, you receive an error stating the deployment has excee
16
16
17
17
## Cause
18
18
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.
20
20
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.
22
22
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 can’t exceed 4 MB, and each individual resource definition can’t 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.
24
24
25
25
Other template limits are:
26
26
@@ -30,27 +30,15 @@ Other template limits are:
30
30
- 64 output values
31
31
- 24,576 characters in a template expression
32
32
33
-
## Solution 1: Use dependencies carefully
33
+
## Solution 1: Reduce name size
34
34
35
35
# [Bicep](#tab/bicep)
36
36
37
-
Use an [implicit dependency](../bicep/resource-dependencies.md#implicit-dependency) that's created when a resource references another resource by its symbolic name. For most deployments, it's not necessary to use `dependsOn` and create an [explicit dependency](../bicep/resource-dependencies.md#explicit-dependency).
37
+
Try to shorten the length of the names you use for [parameters](../bicep/parameters.md), [variables](../bicep/variables.md), and [outputs](../bicep/outputs.md). When these values are repeated in loops, a long name gets multiplied many times.
38
38
39
39
# [JSON](#tab/json)
40
40
41
-
When using [copy](../templates/copy-resources.md) loops to deploy resources, don't use the loop name as a dependency:
42
-
43
-
```json
44
-
dependsOn: [ "nicLoop" ]
45
-
```
46
-
47
-
Instead, use the instance of the resource from the loop that you need to depend on. For example:
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.
54
42
55
43
---
56
44
@@ -62,23 +50,44 @@ When your file deploys lots of different resource types, consider dividing it in
62
50
63
51
You can set other resources as implicit dependencies, and [get values from the output of modules](../bicep/outputs.md#outputs-from-modules).
64
52
53
+
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.
65
54
66
55
# [JSON](#tab/json)
67
56
68
57
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.
69
58
70
59
You can set other resources as dependent on the linked template, and [get values from the output of the linked template](../templates/linked-templates.md#get-values-from-linked-template).
71
60
61
+
Use [template specs](../templates/linked-templates.md#template-specs) rather than [nested templates](../templates/linked-templates.md#nested-template).
62
+
72
63
---
73
64
74
-
## Solution 3: Reduce name size
65
+
## Solution 3: Use dependencies carefully
75
66
76
67
# [Bicep](#tab/bicep)
77
68
78
-
Try to shorten the length of the names you use for [parameters](../bicep/parameters.md), [variables](../bicep/variables.md), and [outputs](../bicep/outputs.md). When these values are repeated in loops, a long name gets multiplied many times.
69
+
Use an [implicit dependency](../bicep/resource-dependencies.md#implicit-dependency) that's created when a resource references another resource by its symbolic name. For most deployments, it's not necessary to use `dependsOn` and create an [explicit dependency](../bicep/resource-dependencies.md#explicit-dependency).
79
70
80
71
# [JSON](#tab/json)
81
72
82
-
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.
73
+
When using [copy](../templates/copy-resources.md) loops to deploy resources, don't use the loop name as a dependency:
74
+
75
+
```json
76
+
dependsOn: [ "nicLoop" ]
77
+
```
78
+
79
+
Instead, use the instance of the resource from the loop that you need to depend on. For example:
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.
90
+
91
+
## Solution 4: Reduce incompressible data
92
+
93
+
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