Azure Application Insights Application Insights
This page shows how to write Terraform and Azure Resource Manager for Application Insights Application Insights and write them securely.
azurerm_application_insights (Terraform)
The Application Insights in Application Insights can be configured in Terraform with the resource name azurerm_application_insights
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_application_insights" "copy" {
name = format("copy-%s", random_string.copy_function_name.result)
location = random_shuffle.regions-with-az.result[0]
resource_group_name = azurerm_resource_group.resource_group.name
application_type = "java"
depends_on = [azurerm_app_service_plan.primary_plan]
resource "azurerm_application_insights" "appi_flume" {
name = "appi-lc-flume"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
application_type = "web"
}
resource "azurerm_application_insights" "usage" {
name = "tf-test-appinsights"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
application_type = "web"
}
resource "azurerm_application_insights" "panel" {
name = "panel-application-insights"
application_type = "web"
location = var.resource_group_location
resource_group_name = var.resource_group_name
workspace_id = var.panel_id
resource "azurerm_application_insights" "production" {
name = "aggregator-telemetry"
location = azurerm_resource_group.production.location
resource_group_name = azurerm_resource_group.production.name
application_type = "other"
tags = {
resource "azurerm_application_insights" "appService-app_insights" {
name =var.appinsitenameformyrepcenter
resource_group_name = var.resource_group_name
location = var.location
application_type = "web" # Node.JS ,java
resource "azurerm_application_insights" "fail" {
name = "tf-appinsights-fail"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
application_type = "web"
resource "azurerm_application_insights" "appinsight-app" {
name = var.app_name
location = var.location
resource_group_name = var.resource_group_name
application_type = "web"
}
resource "azurerm_application_insights" "usage" {
name = "tf-test-appinsights"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
application_type = "web"
}
resource "azurerm_application_insights" "AppInsightAPI" {
name = "AppInsightforAPI"
location = azurerm_resource_group.RGroup.location
resource_group_name = azurerm_resource_group.RGroup.name
application_type = "web"
}
Parameters
-
app_id
optional computed - string -
application_type
required - string -
connection_string
optional computed - string -
daily_data_cap_in_gb
optional computed - number -
daily_data_cap_notifications_disabled
optional computed - bool -
disable_ip_masking
optional - bool -
id
optional computed - string -
instrumentation_key
optional computed - string -
location
required - string -
name
required - string -
resource_group_name
required - string -
retention_in_days
optional - number -
sampling_percentage
optional - number -
tags
optional - map from string to string -
timeouts
single block
Explanation in Terraform Registry
Manages an Application Insights component.
Microsoft.Insights/components (Azure Resource Manager)
The components in Microsoft.Insights can be configured in Azure Resource Manager with the resource name Microsoft.Insights/components
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appinsights_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"components_az_func_bea_api_prod_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"channels_WebChatChannel_enablePreview": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appinsights_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"components_az_app_insight_ntto_ttsa_prod_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appinsights_name": {
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
Frequently asked questions
What is Azure Application Insights Application Insights?
Azure Application Insights Application Insights is a resource for Application Insights of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Application Insights Application Insights?
For Terraform, the redisgeek/acre-terraform-cron-replication, finn-wa-log-cabin/lc-devops-terraform and gilyas/infracost source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the microsoft/azure-data-services-go-fast-codebase, plzm/azure-deploy and InternationalTradeAdministration/deploying-arm-template-mds-prod source code examples are useful. See the Azure Resource Manager Example section for further details.