Our deployments to Azure via Terraform started failing today, seemingly randomly with this error via terraform plan
(terraform init
has been completed successfully at this point):
Error: building account: getting authenticated object ID: listing Service Principals: autorest.DetailedError***Original:(*azure.RequestError)(0xc0015ca900), PackageType:"graphrbac.ServicePrincipalsClient", Method:"List", StatusCode:403
Our Azure Terraform provider is configured like this (yes, I know we are way out of date, we’re working on it):
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.92.0"
}
}
backend "azurerm" {
resource_group_name = "REDACTED"
storage_account_name = "REDACTED"
container_name = "REDACTED"
key = "REDACTED"
}
}
provider "azurerm" {
features {}
}
As far was we can tell, no changes have been made to our App Registration. It has the Contributor and User Access Administrator roles assigned to it on the subscription level. I have verified the client secret is not expired and can be used manually via command line. There have been no changes to our Terraform config.
I also went ahead and assigned these API permissions (they were not assigned before these issues came up today), but this has not helped:
Any help narrowing down this issue would be appreciated.
2 Likes
I am to facing similar issues
1 Like
@anthonyvia Trying updating azurm version = “~>3.0.0”. It helped in my case
1 Like
I ended up upgrading to 2.99 due to this recommendation, and it worked for me too. Glad your issue was resolved too.
1 Like
@anthonyvia - We started seeing same issue since last week. Can you please let me know if you just updated provider “azurerm” version to 2.99 or if you updated terraform version as well? Appreciate your response.
1 Like
@shs-jmic we only upgraded the azurerm provider to 2.99. We run terraform via github actions and we install it via the hashicorp/setup-terraform@v3
action.
1 Like
Thank you @anthonyvia for the quick response. Can you please share the terraform version you are on? I am getting below error when I just update provider version. We are on Terraform version v0.12.21,
e[0me[1mInitializing provider plugins...e[0m
- Checking for available provider plugins...
e[31m
e[0me[1me[31mNo provider "azurerm" plugins meet the constraint ">= 2.99,~>2.99.0".e[0me[31m
The version constraint is derived from the "version" argument within the
provider "azurerm" block in configuration. Child modules may also apply
provider version constraints. To view the provider versions requested by each
module in the current configuration, run "terraform providers".
@shs-jmic To be updated to a later version of terraform, you need to go through the update from 0.13, and I have tested v0.13.7 works with azurerm v2.99.0
1 Like
Thank you. It worked fine after updating terraform version to v0.12.31.