Getting Error: Failed to save Arm Templates. Error: { "message": "Sorry, your input was too large to process.

PATEL, SACHIN KUMAR 40 Reputation points
2025-05-30T17:32:34.3266667+00:00

We merged Pull requests which contained many changes in Synapse pipelines and then we were trying to publish the changes and generate a ARM template.

  1. Publish was successful
  2. The generation of ARM template got failed. Generating templates Failed to save Arm Templates. Error: { "message": "Sorry, your input was too large to process. Consider building the tree incrementally, or building the commits you need in a local clone of the repository and then pushing them to GitHub.", "documentation_url": "https://docs.github.com/rest/git/trees#create-a-tree", "status": "422" }

User's image

@s

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,357 questions
{count} votes

Accepted answer
  1. Chandra Boorla 13,620 Reputation points Microsoft External Staff Moderator
    2025-06-09T17:23:26.74+00:00

    @PATEL, SACHIN KUMAR

    ARM Template Generation for Azure Synapse - Bypassing GitHub API Size Limit Using Azure DevOps YAML Pipeline.

    Problem - Publishing from Synapse Studio (linked to GitHub) fails to generate ARM templates due to: Error: { "message": "Sorry, your input was too large to process.", "status": 422 }

    This happens when many artifacts (pipelines, datasets, dataflows) exceed GitHub REST API payload limits.

    Solution - Bypass the GitHub API limitation by generating ARM templates in Azure DevOps using the Synapse workspace deployment@2 task with operation: validate. This generates the templates directly from the repository and stores them as pipeline artifacts.

    Steps to Implement the Working Solution:

    Create a YAML Pipeline File in GitHub

    Create myARMBuildScript.yml in your GitHub repo:

    trigger:
      branches:
        include:
          - release  # Synapse collaboration branch
    
    pool:
      vmImage: 'windows-latest'
    
    steps:
    - checkout: self
      displayName: 'Checkout triggering branch'
      clean: true
      fetchDepth: 0
    
    - task: Synapse workspace deployment@2
      inputs:
        operation: 'validate'
        ArtifactsFolder: '$(System.DefaultWorkingDirectory)'
        azureSubscription: '<Azure service connection name>'
        ResourceGroupName: '<Resource group name>'
        TargetWorkspaceName: '<Synapse workspace name (Dev)>'
    

    Set Up a Build Pipeline in Azure DevOps

    Go to Azure DevOps > Pipelines
    Create a folder - Synapse-BuildPipeline
    Inside it, create a pipeline (e.g., MyBuildPipeline)
    Choose GitHub as the source and point to your myARMBuildScript.yml file
    Save and run the pipeline

    On success, the pipeline will generate:

    • template.json
    • template-parameters-definition.json as published artifacts

    Connect to Classic Release Pipeline

    Go to your classic release pipeline - Add an Artifact with:

    • Source type - Build
    • Pipeline - The one created above
    • Default version - Latest or as needed
    • Source alias - e.g., synapse-arm

    Use Templates in Deployment Stages

    In subsequent stages:

    • Add a Download Artifacts task to fetch the ARM templates
    • Use a Synapse workspace deployment@2 task with operation: deploy
    • Point it to the downloaded template path from the previous step

    This allows full reuse of validated ARM templates in your existing CI/CD release setup without needing to disconnect GitHub or manually export templates.

    Key Benefits

    • Fully bypasses GitHub REST API limits
    • Keeps Git integration intact
    • Automates template generation on PR merge
    • Templates are reusable across environments via release pipelines

    I hope this information helps. Please do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    Thank you.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. PATEL, SACHIN KUMAR 40 Reputation points
    2025-06-05T19:44:06.8+00:00

    Hi Chandra Boorla,

    The script which you provided above does not contained the synapse workspace deployment task and which will have the operation type = "validate" and this will be responsible to validate all the resources in the root directory of Github repository.

    Here is the YAML script which I used to create a Azure Devops YAML pipeline for generating the 2 ARM Templates:

    trigger:
      branches:
        include:
          - release # this should be your collaboration branch, from where you publish in Synapse Studio
    
     
    pool:
      vmImage: 'windows-latest'
    
     
    steps:
      # Checkout the branch that triggered the pipeline (release)
      - checkout: self
        displayName: 'Checkout triggering branch'
        clean: true
        fetchDepth: 0
    
     
      - task: Synapse workspace deployment@2
        inputs:
          operation: 'validate'
          ArtifactsFolder: '$(System.DefaultWorkingDirectory)'
          azureSubscription: '<Your Service Connection for Azure Subsription name>'
          ResourceGroupName: '<Your Resource Group name>'
          TargetWorkspaceName: '<Your Synapse Workspace name for Development Env>'
    
    
    # 
    
    
    
    
    
    

    So here is how I modified my existing Ci/CD pipeline:

    1. Create a myARMBuildScript.yml file in your GitHub repository by a pull request.
    2. Go to Azure DevOps >Pipelines and create a Folder "Synapse-BuildPipeline" and under this folder create a Pipeline "MyBuildPipeline"
    3. Under Connect "Where is Your Code?" you can select GitHub
    4. Under "Select" - select your repository
    5. Under "Configure" - Select existing YAML file from your GitHub repository
    6. You can navigate and select the "myARMBuildScript.yml" from your GitHub repository.
    7. You can run the pipeline to test.
    8. Once the Pipeline run is successful then the 2 ARM Templates will be generated under the Published Artifacts: User's image
    9. Now go to the classic release pipeline and add an Artifact : User's image Then select the Source Type - Build User's image
    10. Your Project details would be auto populated and you have to select the folder name which your created earlier in the Pipeline section
    11. For Version - you can select latest version or any other options which suits you :

    User's image 13. In the Source Alias Box : Please provide an alias for this Source Artifact. Please not this Alias name you would need this in future.

    1. Now you use this Source Artifact in the subsequent Stages where you will have any Powershell task and Synapse workspace deployment task with "deploy" operation type as you have already generated the ARM template.
    2. Please validate the path by running the Download Artifact task then you can use that path for your next steps.

    This week was a learning for me. Thanks Chandra


Your answer

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