需要从我的 terraform 脚本中为 Active Directory 打开“应用服务身份验证”。
当我使用正在创建的 app_service 的 client_id 将 auth_settings 部分添加到我的 azurerm_app_service 资源时,出现错误
'不允许自我引用'
有道理,但我是否要为我正在创建的项目打开身份验证?
name = "${var.prefix}-${var.environment_code}-${var.environment_segment_code}-web"
location = "${azurerm_resource_group.my_resource_group.location}"
resource_group_name = "${azurerm_resource_group.my_resource_group.name}"
app_service_plan_id = "${azurerm_app_service_plan.my_app_service_plan.id}"
app_settings = {
APPINSIGHTS_INSTRUMENTATIONKEY = "${azurerm_application_insights.my_insights.instrumentation_key}"
}
tags = {
my-Environment = "${var.environment}"
my-Location = "${var.country}"
my-Stack = "${var.stack}"
}
lifecycle {
ignore_changes = [
"app_settings"
]
}
auth_settings {
enabled = true
active_directory {
client_id = "${azurerm_app_service.web.client_id}"
}
default_provider = "AzureActiveDirectory"
}
}```
I'd like to have ad authentication enabled for my website when I terraform.
