2
votes

I have created separate ARM templates each for the DocumentDB, Azure SQL Server, Storage Account, Azure Key Vault, Azure Batch, HDInsight Cluster.

Using New-AzureRmResourceGroupDeployment powershell command when I deploy above resources in a loop within the same resource group I found a strange behaviour. While deploying DocDB all my previously deployed resources in the resource group vanishes (probably deleted automatically). Same is the case when I deploy Azure SQL Server.

Has anybody encountered the same issue? Is there a fix?

1

1 Answers

5
votes

New-AzureRmResourceGroupDeployment has a -mode parameter which can be set to either complete or incremental

Complete mode will create a resource group exactly as you define it in a template deleting any resource that is not explicitly defined in the template.

Incremental mode will add or modify resources to achieve what is specified by the template. Ignoring any additional resources that are present within the resource group. Incremental mode will modify any pre-existing resources to match what is in the template.