Converting an exiting resource group to bicep/IaC

MrFlinstone 481 Reputation points
2024-02-01T23:39:54.2333333+00:00

I have got a resource group ion Azure which has the following resources

  • Azure web app
  • Azure sql database
  • Azure synapse
  • Azure storage account
  • Azure key vault
  • A hub/spoke core network
  • Virtual machines

I would like to understand the process of reverse engineering the stack such that it can be re-written using Bicep.

In this case, the existing resources cannot be deleted, they have to stay but need to be rebuilt from bicep code if required.

How can one go about doing this and what are the required steps ?

Thanks in advance.

Azure Resource Mover
Azure Resource Mover
An Azure service used for moving multiple resources between Azure regions.
203 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 21,336 Reputation points MVP
    2024-02-02T07:13:21.0366667+00:00

    Hi, The easiest way to do that is to use export arm template feature. After that you can use bicep decompile to convert the JSON to Bicep code. You have to keep something in mind though. The export feature is far from perfect. There is possibility that it might not be able to export everything and things that are not ARM resources. Best is once you have the Bicep code is to deploy to with different parameters in another place (subscription/resource group). Compare the two environments and make sure everything is the same according to your preference. If needed make changes to the Bicep code. After that you can apply the Bicep code with the parameters for the production environment.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.