【发布时间】:2021-10-16 01:47:26
【问题描述】:
我让 Terraform 部署 Azure Functions。现在我想用 Terraform 添加健康检查? 怎么开启,加上url和时间?
https://docs.microsoft.com/en-us/azure/app-service/monitor-instances-health-check
【问题讨论】:
我让 Terraform 部署 Azure Functions。现在我想用 Terraform 添加健康检查? 怎么开启,加上url和时间?
https://docs.microsoft.com/en-us/azure/app-service/monitor-instances-health-check
【问题讨论】:
site_config block 下设置path for health check,健康检查 会自动启用。但是没有参数可以从terraform配置load balancing time。
我通过添加带有 health_check_path 的 site_config 块对其进行了测试:
resource "azurerm_function_app" "example" {
name = "terraform-azure-functions"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
storage_account_name = azurerm_storage_account.example.name
storage_account_access_key = azurerm_storage_account.example.primary_access_key
site_config{
health_check_path = "/api/health" # need to configure for enabling Health check
}
}
输出:
【讨论】: