Azure bicep deployment fails with: EntitySizeExceeded - The entity cannot be created, size exceeds limit of 1024 KB

Peter de Groot 11 Reputation points
2026-11-17T07:15:40.1666667+00:00

Our organisation requires us to use only specific permissions in Azure custom role definitions, an no wildcards. Since we're trying to create an Owner-like role, with a lot of permissions, we end up with a role definition with around 9000 elements in the actions array.

The file size of the bicep parameter file is about 550KB, the generated json parameter file is 650KB (including formatting).

We try to create the deployment:

az deployment mg create --management-group-id testmg --name "roledeployment-00" --location germanywestcentral --parameter CUSTOM-OWNER-ROLE.bicepparam

And get the following error:

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/providers/Microsoft.Management/managementGroups/testmg/providers/Microsoft.Resources/deployments/roledeployment-00","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details. Correlation ID: d4a6bcf8-e3b7-4527-9046-9ddd370f65af","details":[{"code":"EntitySizeExceeded","message":"The entity cannot be created, size exceeds limit of 1024 KB."}]}}

I assume that the actions array is too large, although I can't find any documentation on array element limitations. It's not mentioned in the Troubleshoot common Azure deployment errors documentation.

The actions array ends up as a template expression in the final deployment template like this:

"actions": "[parameters('actions')]",
                "permissions": [
                    {
                        "actions": "[parameters('actions')]",
                        "notActions": "[parameters('notActions')]",
                        "dataActions": "[parameters('dataActions')]",
                        "notDataActions": "[parameters('notDataActions')]"
                    }
                ]
"actions": "[parameters('actions')]",

Could the EntitySizeExceeded error be caused by the 24,576 characters in a template expression limitation?

Azure Role-based access control
Azure Role-based access control

An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.


1 answer

Sort by: Most helpful
  1. Peter de Groot 11 Reputation points
    2026-11-19T06:31:44.77+00:00

    Hi, Hemant. Thank you for responding to my question.

    To clarify, the deployment that fials is indeed targeted at Microsoft.Authorization/roleDefinitions. I'm afraid that splitting the deployment into multiple parts is not an option, since it only contains just this single roleDefinition and nothing else.

    I downloaded the deployment in Azure Portal, which contains the following deployment_operation.json:

    [
      {
        "id": "/providers/Microsoft.Management/managementGroups/testmg/providers/Microsoft.Resources/deployments/roledeployment-20261117075032/operations/2B58C92E4C507EEC",
        "operationId": "2B58C92E4C507EEC",
        "properties": {
          "provisioningOperation": "Create",
          "provisioningState": "Failed",
          "timestamp": "2026-11-17T06:50:42.4548375Z",
          "duration": "PT1.9754546S",
          "trackingId": "654fe47f-3253-4f94-b76f-c5f607b0bd49",
          "statusCode": "BadRequest",
          "statusMessage": {
            "status": "Failed",
            "error": {
              "code": "EntitySizeExceeded",
              "message": "The entity cannot be created, size exceeds limit of 1024 KB."
            }
          },
         "targetResource": {
            "id": "/providers/Microsoft.Management/managementGroups/testmg/providers/Microsoft.Authorization/roleDefinitions/ed259494-732f-5c01-9b9f-4f639cd41dcf",
            "resourceType": "Microsoft.Authorization/roleDefinitions",
            "resourceName": "ed259494-732f-5c01-9b9f-4f639cd41dcf"
          }
        }
      }
    ]
    

    The deployment.json file in the same download, which contains the entire deployment including parameters, has a size of 646KB (formatted, 547KB when I remove the formatting). If this is what's causing the limit of 1MB, then the documented limit of 1MB isn't really useful information, as the actual deployment operation doesn't come close to it.

    However, I would have expected a JobSizeExceeded error, if that was the limit I was encountering, as per the ARM deployment size limits link you mentioned. Instead, I get a EntitySizeExceeded error. I'm still looking for the limit I'm running into that's giving me that error (and how to avoid it, obviously).

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.