1. Packages
  2. Azure Native
  3. API Docs
  4. insights
  5. AnalyticsItem
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi

azure-native.insights.AnalyticsItem

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi

    Properties that define an Analytics item that is associated to an Application Insights component. Azure REST API version: 2015-05-01. Prior API version in Azure Native 1.x: 2015-05-01.

    Example Usage

    AnalyticsItemPut

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var analyticsItem = new AzureNative.Insights.AnalyticsItem("analyticsItem", new()
        {
            Content = @"let newExceptionsTimeRange = 1d;
    let timeRangeToCheckBefore = 7d;
    exceptions
    | where timestamp < ago(timeRangeToCheckBefore)
    | summarize count() by problemId
    | join kind= rightanti (
    exceptions
    | where timestamp >= ago(newExceptionsTimeRange)
    | extend stack = tostring(details[0].rawStack)
    | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  
    ) on problemId 
    | order by  count_ desc
    ",
            Name = "Exceptions - New in the last 24 hours",
            ResourceGroupName = "my-resource-group",
            ResourceName = "my-component",
            Scope = AzureNative.Insights.ItemScope.Shared,
            ScopePath = "analyticsItems",
            Type = AzureNative.Insights.ItemType.Query,
        });
    
    });
    
    package main
    
    import (
    	insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := insights.NewAnalyticsItem(ctx, "analyticsItem", &insights.AnalyticsItemArgs{
    			Content: pulumi.String(`let newExceptionsTimeRange = 1d;
    let timeRangeToCheckBefore = 7d;
    exceptions
    | where timestamp < ago(timeRangeToCheckBefore)
    | summarize count() by problemId
    | join kind= rightanti (
    exceptions
    | where timestamp >= ago(newExceptionsTimeRange)
    | extend stack = tostring(details[0].rawStack)
    | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  
    ) on problemId 
    | order by  count_ desc
    `),
    			Name:              pulumi.String("Exceptions - New in the last 24 hours"),
    			ResourceGroupName: pulumi.String("my-resource-group"),
    			ResourceName:      pulumi.String("my-component"),
    			Scope:             pulumi.String(insights.ItemScopeShared),
    			ScopePath:         pulumi.String("analyticsItems"),
    			Type:              pulumi.String(insights.ItemTypeQuery),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.insights.AnalyticsItem;
    import com.pulumi.azurenative.insights.AnalyticsItemArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var analyticsItem = new AnalyticsItem("analyticsItem", AnalyticsItemArgs.builder()
                .content("""
    let newExceptionsTimeRange = 1d;
    let timeRangeToCheckBefore = 7d;
    exceptions
    | where timestamp < ago(timeRangeToCheckBefore)
    | summarize count() by problemId
    | join kind= rightanti (
    exceptions
    | where timestamp >= ago(newExceptionsTimeRange)
    | extend stack = tostring(details[0].rawStack)
    | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  
    ) on problemId 
    | order by  count_ desc
                """)
                .name("Exceptions - New in the last 24 hours")
                .resourceGroupName("my-resource-group")
                .resourceName("my-component")
                .scope("shared")
                .scopePath("analyticsItems")
                .type("query")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    analytics_item = azure_native.insights.AnalyticsItem("analyticsItem",
        content="""let newExceptionsTimeRange = 1d;
    let timeRangeToCheckBefore = 7d;
    exceptions
    | where timestamp < ago(timeRangeToCheckBefore)
    | summarize count() by problemId
    | join kind= rightanti (
    exceptions
    | where timestamp >= ago(newExceptionsTimeRange)
    | extend stack = tostring(details[0].rawStack)
    | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  
    ) on problemId 
    | order by  count_ desc
    """,
        name="Exceptions - New in the last 24 hours",
        resource_group_name="my-resource-group",
        resource_name_="my-component",
        scope=azure_native.insights.ItemScope.SHARED,
        scope_path="analyticsItems",
        type=azure_native.insights.ItemType.QUERY)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const analyticsItem = new azure_native.insights.AnalyticsItem("analyticsItem", {
        content: `let newExceptionsTimeRange = 1d;
    let timeRangeToCheckBefore = 7d;
    exceptions
    | where timestamp < ago(timeRangeToCheckBefore)
    | summarize count() by problemId
    | join kind= rightanti (
    exceptions
    | where timestamp >= ago(newExceptionsTimeRange)
    | extend stack = tostring(details[0].rawStack)
    | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  
    ) on problemId 
    | order by  count_ desc
    `,
        name: "Exceptions - New in the last 24 hours",
        resourceGroupName: "my-resource-group",
        resourceName: "my-component",
        scope: azure_native.insights.ItemScope.Shared,
        scopePath: "analyticsItems",
        type: azure_native.insights.ItemType.Query,
    });
    
    resources:
      analyticsItem:
        type: azure-native:insights:AnalyticsItem
        properties:
          content: "let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId  \n) on problemId \n| order by  count_ desc\n"
          name: Exceptions - New in the last 24 hours
          resourceGroupName: my-resource-group
          resourceName: my-component
          scope: shared
          scopePath: analyticsItems
          type: query
    

    Create AnalyticsItem Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AnalyticsItem(name: string, args: AnalyticsItemArgs, opts?: CustomResourceOptions);
    @overload
    def AnalyticsItem(resource_name: str,
                      args: AnalyticsItemArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def AnalyticsItem(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      resource_group_name: Optional[str] = None,
                      resource_name_: Optional[str] = None,
                      scope_path: Optional[str] = None,
                      content: Optional[str] = None,
                      id: Optional[str] = None,
                      name: Optional[str] = None,
                      override_item: Optional[bool] = None,
                      properties: Optional[ApplicationInsightsComponentAnalyticsItemPropertiesArgs] = None,
                      scope: Optional[Union[str, ItemScope]] = None,
                      type: Optional[Union[str, ItemType]] = None)
    func NewAnalyticsItem(ctx *Context, name string, args AnalyticsItemArgs, opts ...ResourceOption) (*AnalyticsItem, error)
    public AnalyticsItem(string name, AnalyticsItemArgs args, CustomResourceOptions? opts = null)
    public AnalyticsItem(String name, AnalyticsItemArgs args)
    public AnalyticsItem(String name, AnalyticsItemArgs args, CustomResourceOptions options)
    
    type: azure-native:insights:AnalyticsItem
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AnalyticsItemArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AnalyticsItemArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AnalyticsItemArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AnalyticsItemArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AnalyticsItemArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var analyticsItemResource = new AzureNative.Insights.AnalyticsItem("analyticsItemResource", new()
    {
        ResourceGroupName = "string",
        ResourceName = "string",
        ScopePath = "string",
        Content = "string",
        Id = "string",
        Name = "string",
        OverrideItem = false,
        Properties = new AzureNative.Insights.Inputs.ApplicationInsightsComponentAnalyticsItemPropertiesArgs
        {
            FunctionAlias = "string",
        },
        Scope = "string",
        Type = "string",
    });
    
    example, err := insights.NewAnalyticsItem(ctx, "analyticsItemResource", &insights.AnalyticsItemArgs{
    ResourceGroupName: pulumi.String("string"),
    ResourceName: pulumi.String("string"),
    ScopePath: pulumi.String("string"),
    Content: pulumi.String("string"),
    Id: pulumi.String("string"),
    Name: pulumi.String("string"),
    OverrideItem: pulumi.Bool(false),
    Properties: &insights.ApplicationInsightsComponentAnalyticsItemPropertiesArgs{
    FunctionAlias: pulumi.String("string"),
    },
    Scope: pulumi.String("string"),
    Type: pulumi.String("string"),
    })
    
    var analyticsItemResource = new AnalyticsItem("analyticsItemResource", AnalyticsItemArgs.builder()
        .resourceGroupName("string")
        .resourceName("string")
        .scopePath("string")
        .content("string")
        .id("string")
        .name("string")
        .overrideItem(false)
        .properties(ApplicationInsightsComponentAnalyticsItemPropertiesArgs.builder()
            .functionAlias("string")
            .build())
        .scope("string")
        .type("string")
        .build());
    
    analytics_item_resource = azure_native.insights.AnalyticsItem("analyticsItemResource",
        resource_group_name="string",
        resource_name_="string",
        scope_path="string",
        content="string",
        id="string",
        name="string",
        override_item=False,
        properties=azure_native.insights.ApplicationInsightsComponentAnalyticsItemPropertiesArgs(
            function_alias="string",
        ),
        scope="string",
        type="string")
    
    const analyticsItemResource = new azure_native.insights.AnalyticsItem("analyticsItemResource", {
        resourceGroupName: "string",
        resourceName: "string",
        scopePath: "string",
        content: "string",
        id: "string",
        name: "string",
        overrideItem: false,
        properties: {
            functionAlias: "string",
        },
        scope: "string",
        type: "string",
    });
    
    type: azure-native:insights:AnalyticsItem
    properties:
        content: string
        id: string
        name: string
        overrideItem: false
        properties:
            functionAlias: string
        resourceGroupName: string
        resourceName: string
        scope: string
        scopePath: string
        type: string
    

    AnalyticsItem Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The AnalyticsItem resource accepts the following input properties:

    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    ResourceName string
    The name of the Application Insights component resource.
    ScopePath string
    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.
    Content string
    The content of this item
    Id string
    Internally assigned unique id of the item definition.
    Name string
    The user-defined name of the item.
    OverrideItem bool
    Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
    Properties Pulumi.AzureNative.Insights.Inputs.ApplicationInsightsComponentAnalyticsItemProperties
    A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
    Scope string | Pulumi.AzureNative.Insights.ItemScope
    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.
    Type string | Pulumi.AzureNative.Insights.ItemType
    Enum indicating the type of the Analytics item.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    ResourceName string
    The name of the Application Insights component resource.
    ScopePath string
    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.
    Content string
    The content of this item
    Id string
    Internally assigned unique id of the item definition.
    Name string
    The user-defined name of the item.
    OverrideItem bool
    Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
    Properties ApplicationInsightsComponentAnalyticsItemPropertiesArgs
    A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
    Scope string | ItemScope
    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.
    Type string | ItemType
    Enum indicating the type of the Analytics item.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    resourceName String
    The name of the Application Insights component resource.
    scopePath String
    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.
    content String
    The content of this item
    id String
    Internally assigned unique id of the item definition.
    name String
    The user-defined name of the item.
    overrideItem Boolean
    Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
    properties ApplicationInsightsComponentAnalyticsItemProperties
    A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
    scope String | ItemScope
    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.
    type String | ItemType
    Enum indicating the type of the Analytics item.
    resourceGroupName string
    The name of the resource group. The name is case insensitive.
    resourceName string
    The name of the Application Insights component resource.
    scopePath string
    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.
    content string
    The content of this item
    id string
    Internally assigned unique id of the item definition.
    name string
    The user-defined name of the item.
    overrideItem boolean
    Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
    properties ApplicationInsightsComponentAnalyticsItemProperties
    A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
    scope string | ItemScope
    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.
    type string | ItemType
    Enum indicating the type of the Analytics item.
    resource_group_name str
    The name of the resource group. The name is case insensitive.
    resource_name str
    The name of the Application Insights component resource.
    scope_path str
    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.
    content str
    The content of this item
    id str
    Internally assigned unique id of the item definition.
    name str
    The user-defined name of the item.
    override_item bool
    Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
    properties ApplicationInsightsComponentAnalyticsItemPropertiesArgs
    A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
    scope str | ItemScope
    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.
    type str | ItemType
    Enum indicating the type of the Analytics item.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    resourceName String
    The name of the Application Insights component resource.
    scopePath String
    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.
    content String
    The content of this item
    id String
    Internally assigned unique id of the item definition.
    name String
    The user-defined name of the item.
    overrideItem Boolean
    Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
    properties Property Map
    A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
    scope String | "shared" | "user"
    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.
    type String | "none" | "query" | "recent" | "function"
    Enum indicating the type of the Analytics item.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AnalyticsItem resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    TimeCreated string
    Date and time in UTC when this item was created.
    TimeModified string
    Date and time in UTC of the last modification that was made to this item.
    Version string
    This instance's version of the data model. This can change as new features are added.
    Id string
    The provider-assigned unique ID for this managed resource.
    TimeCreated string
    Date and time in UTC when this item was created.
    TimeModified string
    Date and time in UTC of the last modification that was made to this item.
    Version string
    This instance's version of the data model. This can change as new features are added.
    id String
    The provider-assigned unique ID for this managed resource.
    timeCreated String
    Date and time in UTC when this item was created.
    timeModified String
    Date and time in UTC of the last modification that was made to this item.
    version String
    This instance's version of the data model. This can change as new features are added.
    id string
    The provider-assigned unique ID for this managed resource.
    timeCreated string
    Date and time in UTC when this item was created.
    timeModified string
    Date and time in UTC of the last modification that was made to this item.
    version string
    This instance's version of the data model. This can change as new features are added.
    id str
    The provider-assigned unique ID for this managed resource.
    time_created str
    Date and time in UTC when this item was created.
    time_modified str
    Date and time in UTC of the last modification that was made to this item.
    version str
    This instance's version of the data model. This can change as new features are added.
    id String
    The provider-assigned unique ID for this managed resource.
    timeCreated String
    Date and time in UTC when this item was created.
    timeModified String
    Date and time in UTC of the last modification that was made to this item.
    version String
    This instance's version of the data model. This can change as new features are added.

    Supporting Types

    ApplicationInsightsComponentAnalyticsItemProperties, ApplicationInsightsComponentAnalyticsItemPropertiesArgs

    FunctionAlias string
    A function alias, used when the type of the item is Function
    FunctionAlias string
    A function alias, used when the type of the item is Function
    functionAlias String
    A function alias, used when the type of the item is Function
    functionAlias string
    A function alias, used when the type of the item is Function
    function_alias str
    A function alias, used when the type of the item is Function
    functionAlias String
    A function alias, used when the type of the item is Function

    ApplicationInsightsComponentAnalyticsItemPropertiesResponse, ApplicationInsightsComponentAnalyticsItemPropertiesResponseArgs

    FunctionAlias string
    A function alias, used when the type of the item is Function
    FunctionAlias string
    A function alias, used when the type of the item is Function
    functionAlias String
    A function alias, used when the type of the item is Function
    functionAlias string
    A function alias, used when the type of the item is Function
    function_alias str
    A function alias, used when the type of the item is Function
    functionAlias String
    A function alias, used when the type of the item is Function

    ItemScope, ItemScopeArgs

    Shared
    shared
    User
    user
    ItemScopeShared
    shared
    ItemScopeUser
    user
    Shared
    shared
    User
    user
    Shared
    shared
    User
    user
    SHARED
    shared
    USER
    user
    "shared"
    shared
    "user"
    user

    ItemType, ItemTypeArgs

    None
    none
    Query
    query
    Recent
    recent
    Function
    function
    ItemTypeNone
    none
    ItemTypeQuery
    query
    ItemTypeRecent
    recent
    ItemTypeFunction
    function
    None
    none
    Query
    query
    Recent
    recent
    Function
    function
    None
    none
    Query
    query
    Recent
    recent
    Function
    function
    NONE
    none
    QUERY
    query
    RECENT
    recent
    FUNCTION
    function
    "none"
    none
    "query"
    query
    "recent"
    recent
    "function"
    function

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:insights:AnalyticsItem myresource1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.47.1 published on Monday, Jun 24, 2024 by Pulumi