azure - 地形 : How do I set the value of accessTokenAcceptedVersion to 2 for a Azure Service Principal?

标签 azure terraform terraform-provider-azure azure-service-principal

我已使用以下 terraform 脚本在 Azure 中配置服务主体

resource "azuread_application" "app" {
  display_name = "app"
  owners       = "xxxx"
}

resource "azuread_service_principal" "principal" {
  application_id = azuread_application.app.application_id
}

我可以看到下面提到的 list

enter image description here

但是,我想使用 terraform 将 accessTokenAcceptedVersion 的值设置为 2

如何将 Azure 服务主体的 accessTokenAcceptedVersion 值设置为 2?

最佳答案

However, I want to set the value ofaccessTokenAcceptedVersion to 2 using the terraform.

遗憾的是,Terraform 不支持更改应用程序注册access_token_issued_version的值。按照文档查看arguments are supported在 Terraform 中。

或者,您可以使用 Microsoft Graph 命令将 access_token_issued_version 更改为 2。

Connect-MgGraph -TenantId "TenantID" -Scopes "Application.readwrite.all"
    Import-Module Microsoft.Graph.Applications
    $AppId="Azure AD Application ID"
    $paramets = @{
        Api = @{
            RequestedAccessTokenVersion = 2
        }
    }
    Update-MgApplication -ApplicationId $AppId -BodyParameter $paramets

运行上述代码后,AccessTokenVersion已成功更新。

enter image description here

引用:Terraform azuread_application seems to be missing arguments通过 4c74356b41

关于azure - 地形 : How do I set the value of accessTokenAcceptedVersion to 2 for a Azure Service Principal?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76101536/

相关文章:

terraform - 如何输出使用 count 的数据源?

azure - Terraform 无法创建 64 位 Azure 应用服务(Web 应用)

azure - 如何将数据源中for_each循环的key传递给资源配置?

javascript - 从 Azure IotHub/EventHub 获取 deviceId

entity-framework - VSTS 构建如何为 EF Core 添加更新数据库命令 Code First

amazon-web-services - 运行 Terraform Plan/Apply 时出现 InvalidClientTokenID 错误

amazon-dynamodb - Terraform + DynamoDB : All attributes must be indexed

azure - 使用租户中的资源配置 azure ad b2c

sql - Azure SQL,将数据库的大部分内容复制到现有的(不是新的)同一服务器中

azure - 无法使用 Azure DNS 区域通过 Kubernetes 和 Letsencrypt 创建通配符 (*) 证书