Why Is Azure So Broken?

Mike-E-angelo 501 Reputation points
2022-08-03T19:07:29.327+00:00

I am attempting to use the Template Export to export a resource group. Azure itself is the one that creates this template, not me. When I attempt to deploy or add the template that Azure creates, I get the following error:

   Deployment template validation failed: 'The number of template resources limit exceeded. Limit: '800' and actual: '2829'. Please see https://aka.ms/arm-template/#resources for usage details.'. (Code: InvalidTemplate)  

Why is Azure creating something that will ultimately fail and is invalid from the outset?

Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
297 questions
Azure Resource Mover
Azure Resource Mover
An Azure service used for moving multiple resources between Azure regions.
232 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,757 questions
{count} vote

2 answers

Sort by: Most helpful
  1. ajkuma 26,131 Reputation points Microsoft Employee
    2022-08-04T20:17:50.067+00:00

    Mike, Thanks for posting this question.

    Firstly, apologies for any frustration experience with this issue.

    Just adding to AndreasBaumgarten (thank you!), as mentioned in this documentation, 800 is the # Resource limitation in the template.
    -*-800 resources (including copy count)* (screenshot below)

    yes, you can export an entire resource group ( as you have done already) or specific resources within that resource group (for reusing the template, as per your needs).
    See - Choose the right export option

    As I understand (error message), you have more than 800 Resources' in the Resource Group. If it’s feasible, you may consider restructuring the template to use Nested templates:
    Link templates for deployment - Azure Resource Manager | Microsoft Learn
    Based on your requirement, to deploy complex solutions, you can break your ARM template into many related templates, and then deploy them together through a main template.

    Looks like Andreas’s answer was converted into comment by a moderator, since you’d mentioned it was not helpful. Converting an answer to a comment


  2. Andreas Baumgarten 108.8K Reputation points MVP
    2022-08-04T21:29:31.35+00:00

    Hi @Mike-E-angelo ,

    everything is fine! Don't worry about the answer/comment/whatever issue and your comment!

    If you like to deploy Azure resources again and again, there is maybe a better way to achieve this.
    There are different "Infrastructure As Code" solutions available. For instance Terraform and Bicep.

    With both solutions it's possible to convert the ARM Template (Bicep) or the deployed environment (Terraform) in files that can be deployed again:
    Bicep - Decompile ARM Template to Bicep: https://video2.skills-academy.com/en-us/azure/azure-resource-manager/bicep/decompile?tabs=azure-cli
    Terraform - Azure Terrafy: https://github.com/Azure/aztfy

    Please be aware that in both cases it might be some fine tuning is required. But if this is done you can deploy the same environment more than once.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


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.