-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report: management Terraform workspace erroring out after 6.1.0 upgrade #1144
Comments
It seems the data source was introduced in #968, @matt-FFFFFF, any idea? |
Looks like you need to set up auth for the AzAPI provider? |
ohh, @matt-FFFFFF is that a new requirement? we didn't have a provider block for it before. We use managed identities from our TFC workers. |
It's not new, AzAPI has been in the module for a while. It usually takes the same auth configuration as AzureRM, and it doesn't need a provider block like AzureRM does. It is used for MG diag settings too so you could test with that. Managed identity will work, but you need to configure AzAPI to use it. In this case you'll need to add a provider block. See here: https://registry.terraform.io/providers/Azure/azapi/latest/docs#use_msi |
Thanks a lot for the pointer @matt-FFFFFF! Here is how we fixed it, FWIW: Before terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.84"
}
}
}
# Define the provider configuration
provider "azurerm" {
features {}
use_cli = false
tenant_id = var.tenant_id
subscription_id = var.subscription_id_management
skip_provider_registration = true
}
After terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.84"
}
azapi = {
source = "azure/azapi"
version = "~> 1.15"
}
}
}
provider "azapi" {
use_cli = false
tenant_id = var.tenant_id
subscription_id = var.subscription_id_management
skip_provider_registration = true
}
# Define the provider configuration
provider "azurerm" {
features {}
use_cli = false
tenant_id = var.tenant_id
subscription_id = var.subscription_id_management
skip_provider_registration = true
} Terraform Cloud variables for the management workspace (workload identity): |
Nice - yeah for workload identity federation (OIDC) all you need is tenant and client id. |
Also unless you have explicit resources in your root module you don't need the required provider entry. Terraform will get it from the loaded modules. |
@matt-FFFFFF, we don't have explicit |
Fair enough. Glad it's working |
Thanks to you 🙏🏻 |
The text was updated successfully, but these errors were encountered: