通过 terraform Azure Devops yml 管道的 Azure 应用程序注册创建错误

Azure app registration creation error through terraform Azure Devops yml pipeline

我有非常简单的地形代码。

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=2.46.0"
    }

    azuread = {
      source  = "hashicorp/azuread"
      version = "~> 2.0.0"
    }

  }
}

provider "azurerm" {
  features {}
}

provider "azuread" {
  tenant_id       = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

terraform {
  backend "azurerm" {
      resource_group_name = "xxxx"
      storage_account_name = "xxxxxxxxx"
      container_name = "xxxxxxxxxxxxx"
      key = "xxxxxxxxxxxxxxxxx"
      
    }
 }

data "azuread_client_config" "current" {}

resource "azurerm_resource_group" "test" {
  name     = "test-rg-005"
  location = "East US"
}


resource "azuread_application" "example" {
  display_name = "Example-app"
}

然而,当我 运行 通过 azure devops 上的 yml 管道进行此操作时,我在应用阶段遇到此错误。

Plan: 1 to add, 0 to change, 0 to destroy.

azuread_application.example: Creating...

│ Error: Could not create application
│ 
│   with azuread_application.example,
│   on terraform.tf line 42, in resource "azuread_application" "example":
│   42: resource "azuread_application" "example" {
│ 
│ json.Marshal(): json: error calling MarshalJSON for type
│ msgraph.Application: json: error calling MarshalJSON for type
│ *msgraph.Owners: marshaling Owners: encountered DirectoryObject with nil
│ ODataId

##[error]Error: The process '/opt/hostedtoolcache/terraform/1.0.5/x64/terraform' failed with 
exit code 1

任何线索都会有帮助,不太清楚这个错误是什么?

谢谢。

MSFT 更新后,Azure 活动目录提供程序中存在错误。这会影响任何创建新资源的 azure 广告提供商使用,但它似乎正在处理已部署的资源,即更改和升级 azure ad 中已部署资源的配置。以下是错误更新的link。

https://github.com/hashicorp/terraform-provider-azuread/issues/588