gpt4 book ai didi

azure - 如何在 terraform 上使用 azurerm 提供程序创建 appRoles

转载 作者:行者123 更新时间:2023-12-03 02:56:58 25 4
gpt4 key购买 nike

我正在尝试使用 Terraform 设置我的 azure 基础设施,到目前为止非常成功。我们的应用程序开发团队需要在 AzureAD 应用程序的 list 中定义应用程序特定的角色,我们目前通过简单地修改 list 来使用 Azure 门户处理该角色:

"appRoles": [
{
"allowedMemberTypes": [
"Application"
],
"displayName": "SurveyCreator",
"id": "1b4f816e-5eaf-48b9-8613-7923830595ad",
"isEnabled": true,
"description": "Creators can create Surveys",
"value": "SurveyCreator"
}
]

我使用 Terraform 创建了一个 azurerm_azured_application,现在想要相应地修改 list 。

resource "azurerm_azuread_application" "test" {
name = "APP"
homepage = "http://APPHOMEPAGE"
identifier_uris = ["http://APPHOMEPAGE"]
reply_urls = ["http://APPHOMEPAGE/REPLYURL"]
available_to_other_tenants = false
oauth2_allow_implicit_flow = false
}

有没有办法仅使用 Terraform 来实现此目的?

最佳答案

创建App角色可以引用azuread_application_app_role .

resource "azuread_application" "example" {
name = "example"
}

resource "azuread_application_app_role" "example" {
application_object_id = azuread_application.example.id
allowed_member_types = ["User"]
description = "Admins can manage roles and perform all task actions"
display_name = "Admin"
is_enabled = true
value = "administer"
}

关于azure - 如何在 terraform 上使用 azurerm 提供程序创建 appRoles,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52220260/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com