【问题标题】:Possible to configure Health Check for Azure Functions with Terraform?可以使用 Terraform 为 Azure Functions 配置运行状况检查吗?
【发布时间】:2021-10-16 01:47:26
【问题描述】:

我让 Terraform 部署 Azure Functions。现在我想用 Terraform 添加健康检查? 怎么开启,加上url和时间?

https://docs.microsoft.com/en-us/azure/app-service/monitor-instances-health-check

【问题讨论】:

    标签: azure-functions terraform


    【解决方案1】:
    如果您在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
      }
    }
    

    输出:

    【讨论】:

      猜你喜欢
      • 2021-12-08
      • 2021-12-26
      • 2020-04-05
      • 2022-08-20
      • 2019-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-14
      相关资源
      最近更新 更多