2

I have built a system to store data collected by IoT devices in CosmosDB and display it in a web application. I am looking for a simple way to duplicate the resource group including the resources. The system overview and resources included in the resource group are as follows

System Overview

  • IoT devices collect data and send to IoT Hub
  • IoT Hub calls Azure Function to store data in CosmosDB
  • Display stored data on Web Apps (website)

Resources included in resource group

  • CosmosDB
  • Web Apps
  • IoT Hub
  • Azure Function

Goal

  • Replicate the entire resource as a separate resource, including resources in the resource group
  • Do not use ARM templates

Tried

  • Import resource group exports using ARM templates

Problem

  • Importing the exported template as is causes errors due to duplicate content names, empty values in parameters, etc., which makes modifying the ARM template costly.
  • Functions in Azure Function and resources on the website are not duplicated, so separate duplication work is required.
  • To begin with, exporting/importing a resource group using an ARM template does not include all the information of the resource group from which it was exported, so it cannot be called a duplication.

Thank you in advance for your cooperation with the above.

Go Ozeki
  • 21
  • 1

1 Answers1

0

I have been struggling with this as well. I have found some success with decompiling the ARM templates to Bicep and modifying there. Main thing is to have a consistent naming convention so that you can search and replace "PROD" with "DEV" or "TEST" where appropriate, and search and replace hard-coded subscription and tenant id's with variables created from Bicep functions. Apps usually don't have a set naming standard for the default URL's, so you have to search and replace those manually. Other hard-coded references I replace with resources using the "Existing" keyword

Joe
  • 1
  • 1