Using values from ARM templates in Terraform

So today I learned about one of those things that you really don’t want to have to do. It’s possible to use a value from an ARM template in terraform if terraform manages the deployment of the ARM template.

To do that we want to create an output in the ARM template for example.

  "outputs": {
    "resourceGroupID": {
      "type": "string",
      "value": "[resourceGroup().id]"
    }

Then we can make it an output in terraform like this.

output "resourceGroupID" {
  value = azurerm_template_deployment.logicApp.outputs["esourceGroupID"]
}