Terrafy Knowledge Share

A little disclaimer here, these are notes from a live demo on 4-28-22 sorry if this doesn’t make sense later.


Azure Terrafy is a new tool currently in preview as of April 27th from Microsoft designed to help you export Azure Resources listed within the AzureRM provider to a terraform main.tf file and maintain a state file.

How To Install It:

  1. To be able to install Terrafy you’ll need to download the binary from the github repo. If you haven’t installed terrform you’ll want to do that as well. Click here for details

  2. Update the Environment variables. Alt

  3. type “aztfy” in your favorite IDE to confirm it working. Alt

User Cases:

Three use cases that come to mind where this tool will be useful.

  1. Working with a team that has no experience with IaC and allowing for them to build their ideal enviroment to the required standards before creating a terraform plan that parameterized, templated and applied to other environments
  2. Assisting a team with moving to IaC that may have hundreds of existing resources that might need to managed as Code going forward.
  3. Extracting a complex resource configurations such SQL MI or VM Scale Sets.


I did a live demo here

Userful Links:

Here are some useful links.

A: Azure Terrafy and AzAPI Terraform Provider Previews Announcement.

B: Azure Terrafy Repo.

C: Terrafy Presentation.

D: Azure Terraform Documentation.