Terraform warning: Warning: "use_microsoft_graph": [DEPRECATED] This field now defaults to `true` and will be removed in v1.3 of Terraform Core

Viewed 1476

I created a Terraform configuration to create a resource group. This uses a backend provider configuration, so the tfstate file will be created at a shared location and not locally.

When I apply plan terraform plan, I get the following warning.

Warning: "use_microsoft_graph": [DEPRECATED] This field now defaults to true and will be removed in v1.3 of Terraform Core due to the deprecation of ADAL by Microsoft. The config files are as follows.

# Terraform Block
terraform {
  required_version = ">= 1.0.0"
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">= 3.0"
    }
  }

  # Terraform State Storage to Azure Storage Container
  backend "azurerm" {
    resource_group_name  = "storage-rg"
    storage_account_name = "tfstatetrial"
    container_name       = "tfstatefiles"
    key                  = "terraform.tfstate"
  }

}

# Provider Block
provider "azurerm" {
  features {}
}

# Resource-1: Azure Resource Group
resource "azurerm_resource_group" "myrg" {
  name     = "simple-rg"    # local.rg_name
  location = "centralindia" #var.resoure_group_location
}

I looked into this github issue, but could not find an answer.

The warning is because of the backend azurerm block. If I remove that(no remote state), then no warning comes up.

terraform apply with remote state backend

Any ideas what to be done?

1 Answers

This is a known "issue" and has been discussed at hashicorp/terraform#31118. tl;dr (as far as I understood):

The reasoning for this warning is [...] a temporary addition in 1.1, which has been flipped on in 1.2, and will be removed in 1.3

See also here:

use_microsoft_graph - (Optional) Should MSAL be used for authentication instead of ADAL, and should Microsoft Graph be used instead of Azure Active Directory Graph? Defaults to true.

Note: In Terraform 1.2 the Azure Backend uses MSAL (and Microsoft Graph) rather than ADAL (and Azure Active Directory Graph) for authentication by default - you can disable this by setting use_microsoft_graph to false. This setting will be removed in Terraform 1.3, due to Microsoft's deprecation of ADAL.

I know this is not technically a solution to your question or issue, but I think you'll be better off when subscribing and contributing to the GitHub issue instead of waiting for an answer here :)

Related