All apps/Azure Export for Terraform

Azure Export for Terraform

aztfexport

A tool to bring existing Azure resources under Terraform's management.

Runs as aztfexport|macOS, Linux|github.com

Command form

ai-draft · 2 tasks · 10 fields

Export a resource group (or single resources) to Terraform configuration and state. Authentication, backend, query and mapping-file modes are left out.

Opens the form; the finished command lands at your prompt, unrun
otty gui aztfexport

aztfexport resource-group

Export a resource group
Export a resource groupExample values, fixed in this page — nothing here reaches a terminal
Basic
Resource group name*
string
Output directory
directory
Advanced
Terraform provider
string
TasksEach one presets the form for one job
Export interactively
resource_groupoutput_dirprovider_name
Generate HCL only, unattended
resource_groupoutput_dirhcl_onlynon_interactiveoverwrite
ParametersOnly these flags are editable in the form
Resource group name
string · positional 0
Output directory
Defaults to the current directory.
path
-o
HCL only (no state)
Generate configuration without importing resources into Terraform state.
boolean
--hcl-only
Non-interactive
boolean
--non-interactive
Append to existing state
Import into the existing state file and keep the output directory contents.
boolean
--append
Overwrite non-empty directory
boolean
--overwrite
Terraform provider
string
--provider-nameazurermazapi
Provider version
string
--provider-version
Cloud environment
string
--envpublicusgovernmentchina
Only generate mapping file
boolean
--generate-mapping-file
SourcesEvery flag above is checked against these
docs
aztfexport resource-group [option] <resource group name> aztfexport resource-group myResourceGroup aztfexport resource -o tempdir --hcl-only <resource_id> For a non-interactive resource, add the --non-interactive flag: aztfexport rg --non-interactive myResourceGroup. The --hcl-only flag specifies to export the configured resources to HCL If the directory in…
manual2026-10-27

learn.microsoft.com

Before it fills your prompt, Otty checks the installed aztfexport against its version. A form that does not match your version is not offered.