» azurerm_application_insights

Manages an Application Insights component.

» Example Usage

resource "azurerm_resource_group" "example" {
  name     = "tf-test"
  location = "West Europe"

resource "azurerm_application_insights" "example" {
  name                = "tf-test-appinsights"
  location            = "West Europe"
  resource_group_name = "${azurerm_resource_group.example.name}"
  application_type    = "web"

output "instrumentation_key" {
  value = "${azurerm_application_insights.example.instrumentation_key}"

output "app_id" {
  value = "${azurerm_application_insights.example.app_id}"

» Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Application Insights component. Changing this forces a new resource to be created.

  • resource_group_name - (Required) The name of the resource group in which to create the Application Insights component.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • application_type - (Required) Specifies the type of Application Insights to create. Valid values are ios for iOS, java for Java web, MobileCenter for App Center, Node.JS for Node.js, other for General, phone for Windows Phone, store for Windows Store and web for ASP.NET. Please note these values are case sensitive; unmatched values are treated as ASP.NET by Azure. Changing this forces a new resource to be created.

  • sampling_percentage - (Optional) Specifies the percentage of the data produced by the monitored application that is sampled for Application Insights telemetry.

  • tags - (Optional) A mapping of tags to assign to the resource.

» Attributes Reference

The following attributes are exported:

  • id - The ID of the Application Insights component.

  • app_id - The App ID associated with this Application Insights component.

  • instrumentation_key - The Instrumentation Key for this Application Insights component.

» Import

Application Insights instances can be imported using the resource id, e.g.

terraform import azurerm_application_insights.instance1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.insights/components/instance1