@Nitin Parmar-Tss consultancy , Thank you for posting this question.
I see that you already have some resources deployed in one subscription (/resource group) and now would like to deploy them to another subscription (/resource group). You are on the right track and ARM template can be used to export the template and apply them again - to another subscription/Resource Group. Based on the error mentioned in the question, the following are the scenarios:
- Template limit - Based on the error in the first screenshot, the limit of 800 resources/template is being reached. If there are a number of resources in the RG, I would advise doing the deployment in steps. For example, instead of deploying the whole infra at a single go, try to divide it into multiple templates. One way would be to export the template at resource level, instead of the RG level. For that, you would have to ensure that the dependent resources are created before the resources dependent on them. For example, the Virtual Network needs to be created before the VM. You can get the dependent resources by looking at **dependsOn **field in the template.
- The second error indicates that the template/parameter file was not updated properly. It appears that one of the resource's templates (Application Gateway's) still has reference to subscription specific attribute (subscription id). I would suggest reviewing it to ensure that no reference to the existing subscription is available.
I would also suggest reviewing the links below related to Infrastructure as Code (IaC). These are designed specifically for scenarios that you are facing, where you may have to create a copy of environment in different subscription/resource group"
This involves using ARM template, CLI/PS to ensure consistency of resources.
Hope this helps.
If the answer did not help, please add more context/follow-up question for it, and we will help you out. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.