Hello @B K
From the problem you described, it is possible that the resources you are trying to deploy are not defined in your ARM template, and hence, they are being removed during the deployment.
To avoid this, you can add the resources that you want to keep in your ARM template. Another reason for this issue could be that the resources you are trying to deploy have a different name or location than the existing resources. In this case, the incremental deployment mode will not work as expected, and it will remove the existing resources.
To avoid this, you can try using the complete deployment mode instead of incremental deployment mode. If you are still facing issues, you can try debugging the issue by checking the deployment logs. The logs will give you more information about the resources that are being removed and the reason for their removal.
I'd also suggest to utilize Bicep templates, instead of ARM templates, that may solve not only the above issue, but also make it more manageable. Not to forget, Bicep also has the feature of putting a resource template that already exists
, but you want just a reference in your template to use.