Add Azure Provider

Next, we'll need to import the azurerm provider so Terraform understands where to look for the definition of the Azure Resources we'll need to create.

provider "azurerm" {
  features {}
}

Update the versions.tf file and add the following code to define the version of Terraform we'll use as well as the Azure Resource Manager version.

terraform {
  required_version = ">= 0.12.28"
  required_providers {
    azurerm = {
      version = "~> 2.12"
    }
  }
}

Terraform versions. You may notice that the version of Terraform that we installed locally may not match with the version of Terraform we are defining here. We need to make sure that any resource configuration that we create is able to run on Terraform Enterprise (remember that even though we may execute Terraform commands locally, it is actually running on the TFE server).

Currently, TFE uses version 12.28 of Terraform. Therefore, we want to make sure our resource configuration is compatibility with versions of Terraform 12.28 and later, otherwise we would not be able to apply Terraform changes locally onto TFE.

This is also wrapped in the terraform section just like the backend configuration to define the state file, as this is configuring Terraform itself and not provisioning infrastructure.