terraform -v
Terraform v0.12.26
+ provider.azurerm v2.19.0
azurerm_client_config Dataprovider "azurerm" {
version = "~> 2.0"
features {}
}
data azurerm_client_config current {}
output current_client_config {
value = data.azurerm_client_config.current
}
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
current_client_config = {
"client_id" = "00000000-0000-0000-0000-000000000000"
"id" = "2020-07-16 19:32:04.738092599 +0000 UTC"
"object_id" = "00000000-0000-0000-0000-000000000000"
"subscription_id" = "00000000-0000-0000-0000-000000000000"
"tenant_id" = "00000000-0000-0000-0000-000000000000"
}
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
current_client_config = {
"client_id" = ""
"id" = "2020-07-16 19:32:04.738092599 +0000 UTC"
"object_id" = ""
"subscription_id" = "00000000-0000-0000-0000-000000000000"
"tenant_id" = ""
}
export ARM_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000 ARM_USE_MSI=true terraform initterraform apply
The azure_client_config data provider becomes useless since you're not able to retrieve any useful information.
Hi @gevorg15 thanks for this issue and sorry for the delay of response.
According to this document, to get the MSI authentication working, you will have to set ARM_SUBSCRIPTION_ID, ARM_USE_MSI=true and ARM_TENANT_ID or configurate them in the provider block like this:
provider "azurerm" {
features {}
use_msi = true
subscription_id = "..."
tenant_id = "..."
}
The MSI works fine (can manage resources) but if you want to access these (client_id and object_id) keys under azurerm_client_config, the values are missing/empty.
Terraform 0.13.5
Provider 2.38.0
Most helpful comment
The MSI works fine (can manage resources) but if you want to access these (
client_idandobject_id) keys underazurerm_client_config, the values are missing/empty.Terraform
0.13.5Provider
2.38.0