Need to turn on 'App Service Authentication' for Active Directory from my terraform script.
When I add the auth_settings section to my azurerm_app_service resource using the client_id of the app_service I am creating I get the error
'self reference not allowed'
Makes sense but then were to I turn on authentication for the item I am creating?
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.