我想使用 Azuread Provider 创建一个应用注册,并将 applictionid 输出用于我的 appservice 中的配置。每次我计划时,我都会收到一条错误消息。如果我删除配置行,一切正常。
我试图将 App-Registration 放在一个模块中并使用输出,但我得到了同样的错误。
有人有建议吗?
//Azure App Registration
resource "azuread_application" "appregistration" {
name = "${var.state}Site-${var.typ}-ar"
reply_urls = ["https://${azurerm_app_service.appservice.default_site_hostname}/signin-callback"]
available_to_other_tenants = false
oauth2_allow_implicit_flow = true
}
resource "azuread_application_password" "AppRegistrationPwd" {
application_object_id = "${azuread_application.appregistration.id}"
value = "SOMECODE"
end_date = "2020-01-01T01:02:03Z"
}
resource "azuread_service_principal" "serviceprincipal" {
application_id = "${azuread_application.appregistration.application_id}"
app_role_assignment_required = false
}
应用服务
resource "azurerm_app_service" "appservice" {
name = "${var.state}-Site-${var.typ}-as"
location = "${var.location}"
resource_group_name = "${azurerm_app_service_plan.serviceplan.resource_group_name}"
app_service_plan_id = "${azurerm_app_service_plan.serviceplan.id}"
site_config {
dotnet_framework_version = "v4.0"
scm_type = "LocalGit"
}
app_settings = {
"AzureAd:ClientId" = "${azuread_service_principal.serviceprincipal.application_id}"
}
}
错误:
Error: Cycle: module.devcentralhub.azuread_service_principal.serviceprincipal, module.devcentralhub.azurerm_app_service.appservice, module.devcentralhub.azuread_application.appregistration