hashicorp / terraform-provider-azuread

Terraform provider for Azure Active Directory
https://registry.terraform.io/providers/hashicorp/azuread/latest/docs
Mozilla Public License 2.0
415 stars 280 forks source link

OData suddenly failing with "Exception of type 'Microsoft.Graph.AGS.Contracts.ClaimsChallengeRequiredException' was thrown." #1410

Closed SeanKilleen closed 3 weeks ago

SeanKilleen commented 3 weeks ago

Community Note

Terraform (and AzureAD Provider) Version

Terraform v1.8.5 on windows_amd64

Affected Resource(s)

Terraform Configuration Files

A minimal reproduction looks to include --

providers.tf:

terraform {
  required_providers {
    azuread = {
      source  = "hashicorp/azuread"
      version = "2.51.0"
    }
  }
}

provider "azuread" {
  tenant_id = var.sct_azure_tenant_id
}

getting the users in main.tf

data "azuread_user" "vm_users" {
  for_each            = var.vm_users
  user_principal_name = each.value
}

To be clear, this has worked for some time and has not been recently changed.

Debug Output

Relevant portion of the Request/response from the debug log is here: https://gist.github.com/SeanKilleen/7d8022776fbb360c9feac86cb2fbb791

Panic Output

Expected Behavior

Pull the users like normal using the data source

Actual Behavior

For each user in that data source, I see:

UsersClient.BaseClient.Get(): unexpected status 401 with OData error: InvalidAuthenticationToken: Exception of type 'Microsoft.Graph.AGS.Contracts.ClaimsChallengeRequiredException' was thrown

I attempted to run az logout and az login from the CLI. Those operations were successful but I still received the error.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

SeanKilleen commented 3 weeks ago

This must have been a transient issue -- after multiple rounds of az logout and az login, it resolved itself.

The exact steps I took before it was fixed (though I don't believe they influenced the outcome):

I'm going to close this but wanted to put the information here in case others can benefit.

manicminer commented 3 weeks ago

Hi @SeanKilleen, thanks for reporting. This appears to be either an API issue/outage, or an Azure CLI bug, so I don't believe there would be anything for us to do here.