Edit

Overview of the Azure Terraform Resource Provider

The Azure Terraform Resource Provider (preview) enables Azure Terraform workflows like exporting in the Azure portal. Currently, it supports only an export workflow, but planned additions to the resource provider accelerate deployment workflows in Terraform on Azure. This resource provider is only available in the Azure public cloud.

Registration

Registration might take a few minutes to complete. Check your registration status by using az provider show -n Microsoft.AzureTerraform.

Terraform

Use the azurerm_provider_registration resource:

resource "azurerm_resource_provider_registration" "azureterraform" {
  name = "Microsoft.AzureTerraform"
}

You need to configure your azurerm provider as well for the run to succeed.

Terminal

Register the provider by using az provider register -n Microsoft.AzureTerraform. Wait until the az provider show -n Microsoft.AzureTerraform result shows the registrationState is Registered.

Portal

Register the provider by using the Azure Resource Manager guide. Search for Microsoft.AzureTerraform in step 5.

Export

Export functionality is based on the preexisting Azure Export for Terraform tool. The resource provider exposes these capabilities. To export resources, choose your tool of choice:

Portal

To export resources to Terraform, see the quickstart article to export resources to Terraform using Azure portal.

Azure CLI

See the Azure CLI guide.

Azure PowerShell

See the Azure PowerShell guide.

REST

See the REST API reference.

Go SDK

See the Go SDK reference.

Export Limitations

As the export experience is based on Azure Export for Terraform aztfexport, its limitations are nearly identical to the binary. Refer to the limitations section of the binary documentation.

However, there are some additional limitations for the resource provider as listed below.

  • Some specific resources not supported by the resource provider. These resources aren't supported to ensure security from a usage standpoint. Two types of roles aren't supported:

    • POST roles. They're mostly used for listing credentials.
    • Data plane roles. These roles are used to access user content.

    We're planning to keep these limitations in place to ensure security for users. If customers wish to export these types of resources, use the aztfexport tool instead.

  • There's a limit of 1000 resources in the resource group when exporting in the resource group mode. In this case, you can use .excludeAzureResource and/or .excludeTerraformResource to filter out uninterested resources.

Next steps