Open
Description
Terraform Version
1.11.2
Terraform Configuration Files
backend "azurerm" {
subscription_id = "xxx"
resource_group_name = "xxx"
storage_account_name = "xxx"
container_name = "xxx"
key = "terraform.tfstate"
use_azuread_auth = true
}
}
# Configure the Azure provider
provider "azurerm" {
features {}
subscription_id = var.subscription_id
tenant_id = var.tenant_id
storage_use_azuread = true
}
Debug Output
│ Error: error loading state: executing request: unexpected status 401 (401 Server failed to authenticate the request. Please refer to the information in the www-authenticate header.) with InvalidAuthenticationInfo: Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
│ RequestId:9b2503f8-501e-0052-2696-99b6f3000000
│ Time:2025-03-20T12:48:14.1906967Z
Expected Behavior
Terraform 1.10.x worked fine.
Actual Behavior
Authentication fails when Terraform plan is run.
│ Error: error loading state: executing request: unexpected status 401 (401 Server failed to authenticate the request. Please refer to the information in the www-authenticate header.) with InvalidAuthenticationInfo: Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
│ RequestId:9b2503f8-501e-0052-2696-99b6f3000000
│ Time:2025-03-20T12:48:14.1906967Z
Steps to Reproduce
terraform init -backend-config=container_name=test
terraform plan
Additional Context
Terraform back is in a storage account in a different Azure tenant. The Azurem provider is configured to deploy the resources in a different Azure tenant. This worked fine with Terraform 1.10.x. After the upgrade to 1.11.2 this starts to fail
References
No response
Generative AI / LLM assisted development?
No response