azure-native.insights.AnalyticsItem
Explore with Pulumi AI
Properties that define an Analytics item that is associated to an Application Insights component. API Version: 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 = "shared",
ScopePath = "analyticsItems",
Type = "query",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"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;\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: pulumi.String("Exceptions - New in the last 24 hours"),
ResourceGroupName: pulumi.String("my-resource-group"),
ResourceName: pulumi.String("my-component"),
Scope: pulumi.String("shared"),
ScopePath: pulumi.String("analyticsItems"),
Type: pulumi.String("query"),
})
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="shared",
scope_path="analyticsItems",
type="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: "shared",
scopePath: "analyticsItems",
type: "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 =
{
{ "functionAlias", "string" },
},
Scope = "string",
Type = "string",
});
example, err := insights.NewAnalyticsItem(ctx, "analyticsItemResource", &insights.AnalyticsItemArgs{
ResourceGroupName: "string",
ResourceName: "string",
ScopePath: "string",
Content: "string",
Id: "string",
Name: "string",
OverrideItem: false,
Properties: map[string]interface{}{
"functionAlias": "string",
},
Scope: "string",
Type: "string",
})
var analyticsItemResource = new AnalyticsItem("analyticsItemResource", AnalyticsItemArgs.builder()
.resourceGroupName("string")
.resourceName("string")
.scopePath("string")
.content("string")
.id("string")
.name("string")
.overrideItem(false)
.properties(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.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={
functionAlias: 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:
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Resource
Name string - The name of the Application Insights component resource.
- Scope
Path 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.
- Override
Item bool - Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
- Properties
Pulumi.
Azure Native. Insights. Inputs. Application Insights Component Analytics Item Properties - 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.
Azure Native. Insights. Item 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.
- Type
string | Pulumi.
Azure Native. Insights. Item Type - Enum indicating the type of the Analytics item.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Resource
Name string - The name of the Application Insights component resource.
- Scope
Path 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.
- Override
Item bool - Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
- Properties
Application
Insights Component Analytics Item Properties Args - 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 | Item
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.
- Type
string | Item
Type - Enum indicating the type of the Analytics item.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- resource
Name String - The name of the Application Insights component resource.
- scope
Path 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.
- override
Item Boolean - Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
- properties
Application
Insights Component Analytics Item Properties - 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 | Item
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.
- type
String | Item
Type - Enum indicating the type of the Analytics item.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- resource
Name string - The name of the Application Insights component resource.
- scope
Path 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.
- override
Item boolean - Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
- properties
Application
Insights Component Analytics Item Properties - 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 | Item
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.
- type
string | Item
Type - Enum indicating the type of the Analytics item.
- resource_
group_ strname - 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
Application
Insights Component Analytics Item Properties Args - 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 | Item
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.
- type
str | Item
Type - Enum indicating the type of the Analytics item.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- resource
Name String - The name of the Application Insights component resource.
- scope
Path 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.
- override
Item 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.
- Time
Created string - Date and time in UTC when this item was created.
- Time
Modified 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.
- Time
Created string - Date and time in UTC when this item was created.
- Time
Modified 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.
- time
Created String - Date and time in UTC when this item was created.
- time
Modified 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.
- time
Created string - Date and time in UTC when this item was created.
- time
Modified 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.
- time
Created String - Date and time in UTC when this item was created.
- time
Modified 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
- Function
Alias string - A function alias, used when the type of the item is Function
- Function
Alias string - A function alias, used when the type of the item is Function
- function
Alias String - A function alias, used when the type of the item is Function
- function
Alias 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
- function
Alias String - A function alias, used when the type of the item is Function
ApplicationInsightsComponentAnalyticsItemPropertiesResponse, ApplicationInsightsComponentAnalyticsItemPropertiesResponseArgs
- Function
Alias string - A function alias, used when the type of the item is Function
- Function
Alias string - A function alias, used when the type of the item is Function
- function
Alias String - A function alias, used when the type of the item is Function
- function
Alias 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
- function
Alias String - A function alias, used when the type of the item is Function
ItemScope, ItemScopeArgs
- Shared
- shared
- User
- user
- Item
Scope Shared - shared
- Item
Scope User - 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
- Item
Type None - none
- Item
Type Query - query
- Item
Type Recent - recent
- Item
Type 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
- "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-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0