Best way to import the existing infrastructure on Azure to Terraform

Srishti Gawande 0 Reputation points
2023-10-19T19:00:44.2833333+00:00

We have a huge azure infrastructure of nearly 6000 components in place, which were created through az cli / powershell. We want to import all of this in terraform and start using terraform for automation. What should be the best way to do that?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
{count} votes

2 answers

Sort by: Most helpful
  1. Dillon Silzer 60,711 Reputation points Volunteer Moderator
    2023-10-19T19:31:15.11+00:00

    Hi Srishti,

    You can use Azure Export to export resource groups:

    Quickstart: Export your first resources using Azure Export for Terraform

    https://learn.microsoft.com/en-us/azure/developer/terraform/azure-export-for-terraform/export-first-resources?tabs=azure-cli

    Please see the following for limitations:

    Limitations

    https://learn.microsoft.com/en-us/azure/developer/terraform/azure-export-for-terraform/export-terraform-concepts#limitations


    If this is helpful please accept answer.

    0 comments No comments

  2. Stu Mace 0 Reputation points MVP
    2025-03-25T23:16:30.3366667+00:00

    I'd suggest looking at tfazexport if you're looking to bring in lots of resources by subscription or resource group

    https://github.com/Azure/aztfexport

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.