为Azure Function App(Terraform)配置应用程序提示

时间:2018-12-04 12:41:31

标签: azure azure-functions terraform azure-application-insights

使用下面的代码片段,我可以创建应用程序见解和function_app,但是我不确定如何配置function-app以使用创建的应用程序见解。

module "resource_group" {
  source      = "git::ssh://address"
  environment = "${var.environment}"
  application = "${var.application}"
  app_version = "${var.app_version}"
}

module "function_app" {
  source                            = "git::ssh://address"
  environment                       = "${var.environment}"
  application                       = "${var.application}"
  resource_group_name               = "${module.resource_group.name}"
  app_version                       = "${var.app_version}"
  app_service_plan_id               = "${module.app_service_plan.id}"
  storage_primary_connection_string = "${module.storage_account.primary_connection_string}"
}

resource "azurerm_application_insights" "application_insights" {
  name                = "${var.environment}-${var.application}-appInsights"
  location            = "${module.resource_group.location}"
  resource_group_name = "${module.resource_group.name}"
  application_type    = "Web"
}

但是当我访问azure> function_app> Monitor时,它仍然显示要配置application_insights。

configure application insights

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

在此处查看示例:https://www.olivercoding.com/2018-06-24-terraform/。您需要将AppInsights_InstrumentationKey添加到功能应用程序的app_settings中。