terraform { required_providers { azuread = { source = "hashicorp/azuread" } } } provider "azurerm" { features {} # set this to false when running locally use_oidc = true } data "azurerm_kubernetes_cluster" "default" { depends_on = [module.test_aks] # refresh cluster state before reading name = var.cluster_name resource_group_name = var.resource_group_name } provider "helm" { kubernetes { host = data.azurerm_kubernetes_cluster.default.kube_config.0.host client_certificate = base64decode(data.azurerm_kubernetes_cluster.default.kube_config.0.client_certificate) client_key = base64decode(data.azurerm_kubernetes_cluster.default.kube_config.0.client_key) cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.default.kube_config.0.cluster_ca_certificate) } } provider "kubernetes" { host = data.azurerm_kubernetes_cluster.default.kube_config.0.host client_certificate = base64decode(data.azurerm_kubernetes_cluster.default.kube_config.0.client_certificate) client_key = base64decode(data.azurerm_kubernetes_cluster.default.kube_config.0.client_key) cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.default.kube_config.0.cluster_ca_certificate) }