microsoft.insights components/analyticsItems

Bicep resource definition

The components/analyticsItems resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/components/analyticsItems resource, add the following Bicep to your template.

resource symbolicname 'microsoft.insights/components/analyticsItems@2015-05-01' = {
  parent: resourceSymbolicName
  Content: 'string'
  Id: 'string'
  name: 'item'
  Name: 'string'
  Properties: {
    functionAlias: 'string'
  }
  Scope: 'string'
  Type: 'string'
}

Property Values

microsoft.insights/components/analyticsItems

Name Description Value
Content The content of this item string
Id Internally assigned unique id of the item definition. string
name The resource name 'item' (required)
Name The user-defined name of the item. string
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: components
Properties A set of properties that can be defined in the context of a specific item type. Each type may have its own properties. ApplicationInsightsComponentAnalyticsItemProperties
Scope Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. 'shared'
'user'
Type Enum indicating the type of the Analytics item. 'function'
'none'
'query'
'recent'

ApplicationInsightsComponentAnalyticsItemProperties

Name Description Value
functionAlias A function alias, used when the type of the item is Function string

Usage Examples

Bicep Samples

A basic example of deploying Application Insights Analytics Item component.

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource component 'Microsoft.Insights/components@2020-02-02' = {
  name: resourceName
  location: location
  kind: 'web'
  properties: {
    Application_Type: 'web'
    DisableIpMasking: false
    DisableLocalAuth: false
    ForceCustomerStorageForProfiler: false
    RetentionInDays: 90
    SamplingPercentage: 100
    publicNetworkAccessForIngestion: 'Enabled'
    publicNetworkAccessForQuery: 'Enabled'
  }
}

resource analyticsItem 'microsoft.insights/components/analyticsItems@2015-05-01' = {
  parent: component
  name: 'item'
  Content: 'requests #test'
  Name: 'testquery'
  Scope: 'shared'
  Type: 'query'
}

ARM template resource definition

The components/analyticsItems resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/components/analyticsItems resource, add the following JSON to your template.

{
  "type": "microsoft.insights/components/analyticsItems",
  "apiVersion": "2015-05-01",
  "name": "string",
  "Content": "string",
  "Id": "string",
  "Name": "string",
  "Properties": {
    "functionAlias": "string"
  },
  "Scope": "string",
  "Type": "string"
}

Property Values

microsoft.insights/components/analyticsItems

Name Description Value
apiVersion The api version '2015-05-01'
Content The content of this item string
Id Internally assigned unique id of the item definition. string
name The resource name 'item' (required)
Name The user-defined name of the item. string
Properties A set of properties that can be defined in the context of a specific item type. Each type may have its own properties. ApplicationInsightsComponentAnalyticsItemProperties
Scope Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. 'shared'
'user'
type The resource type 'microsoft.insights/components/analyticsItems'
Type Enum indicating the type of the Analytics item. 'function'
'none'
'query'
'recent'

ApplicationInsightsComponentAnalyticsItemProperties

Name Description Value
functionAlias A function alias, used when the type of the item is Function string

Usage Examples

Terraform (AzAPI provider) resource definition

The components/analyticsItems resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/components/analyticsItems resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "microsoft.insights/components/analyticsItems@2015-05-01"
  name = "string"
  parent_id = "string"
  Name = "string"
  body = {
    Content = "string"
    Id = "string"
    Properties = {
      functionAlias = "string"
    }
    Scope = "string"
    Type = "string"
  }
}

Property Values

microsoft.insights/components/analyticsItems

Name Description Value
Content The content of this item string
Id Internally assigned unique id of the item definition. string
name The resource name 'item' (required)
Name The user-defined name of the item. string
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: components
Properties A set of properties that can be defined in the context of a specific item type. Each type may have its own properties. ApplicationInsightsComponentAnalyticsItemProperties
Scope Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component. 'shared'
'user'
type The resource type "microsoft.insights/components/analyticsItems@2015-05-01"
Type Enum indicating the type of the Analytics item. 'function'
'none'
'query'
'recent'

ApplicationInsightsComponentAnalyticsItemProperties

Name Description Value
functionAlias A function alias, used when the type of the item is Function string

Usage Examples

Terraform Samples

A basic example of deploying Application Insights Analytics Item component.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "component" {
  type      = "Microsoft.Insights/components@2020-02-02"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    kind = "web"
    properties = {
      Application_Type                = "web"
      DisableIpMasking                = false
      DisableLocalAuth                = false
      ForceCustomerStorageForProfiler = false
      RetentionInDays                 = 90
      SamplingPercentage              = 100
      publicNetworkAccessForIngestion = "Enabled"
      publicNetworkAccessForQuery     = "Enabled"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

data "azapi_resource_id" "analyticsItem" {
  type      = "microsoft.insights/components/analyticsItems@2015-05-01"
  parent_id = azapi_resource.component.id
  name      = "item"
}

resource "azapi_resource_action" "analyticsItem" {
  type        = "microsoft.insights/components/analyticsItems@2015-05-01"
  resource_id = data.azapi_resource_id.analyticsItem.id
  method      = "PUT"
  body = {
    Content = "requests #test"
    Name    = "testquery"
    Scope   = "shared"
    Type    = "query"
  }
}