1. Packages
  2. Azure Native
  3. API Docs
  4. insights
  5. WorkbookTemplate
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.34.0 published on Thursday, Mar 28, 2024 by Pulumi

azure-native.insights.WorkbookTemplate

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.34.0 published on Thursday, Mar 28, 2024 by Pulumi

    An Application Insights workbook template definition. Azure REST API version: 2020-11-20. Prior API version in Azure Native 1.x: 2019-10-17-preview.

    Example Usage

    WorkbookTemplateAdd

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var workbookTemplate = new AzureNative.Insights.WorkbookTemplate("workbookTemplate", new()
        {
            Author = "Contoso",
            Galleries = new[]
            {
                new AzureNative.Insights.Inputs.WorkbookTemplateGalleryArgs
                {
                    Category = "Failures",
                    Name = "Simple Template",
                    Order = 100,
                    ResourceType = "microsoft.insights/components",
                    Type = "tsg",
                },
            },
            Location = "west us",
            Priority = 1,
            ResourceGroupName = "my-resource-group",
            ResourceName = "testtemplate2",
            TemplateData = 
            {
                { "$schema", "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json" },
                { "items", new[]
                {
                    
                    {
                        { "content", 
                        {
                            { "json", @"## New workbook
    ---
    
    Welcome to your new workbook.  This area will display text formatted as markdown.
    
    
    We've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections." },
                        } },
                        { "name", "text - 2" },
                        { "type", 1 },
                    },
                    
                    {
                        { "content", 
                        {
                            { "exportToExcelOptions", "visible" },
                            { "query", @"union withsource=TableName *
    | summarize Count=count() by TableName
    | render barchart" },
                            { "queryType", 0 },
                            { "resourceType", "microsoft.operationalinsights/workspaces" },
                            { "size", 1 },
                            { "version", "KqlItem/1.0" },
                        } },
                        { "name", "query - 2" },
                        { "type", 3 },
                    },
                } },
                { "styleSettings", null },
                { "version", "Notebook/1.0" },
            },
        });
    
    });
    
    package main
    
    import (
    	"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.NewWorkbookTemplate(ctx, "workbookTemplate", &insights.WorkbookTemplateArgs{
    			Author: pulumi.String("Contoso"),
    			Galleries: insights.WorkbookTemplateGalleryArray{
    				&insights.WorkbookTemplateGalleryArgs{
    					Category:     pulumi.String("Failures"),
    					Name:         pulumi.String("Simple Template"),
    					Order:        pulumi.Int(100),
    					ResourceType: pulumi.String("microsoft.insights/components"),
    					Type:         pulumi.String("tsg"),
    				},
    			},
    			Location:          pulumi.String("west us"),
    			Priority:          pulumi.Int(1),
    			ResourceGroupName: pulumi.String("my-resource-group"),
    			ResourceName:      pulumi.String("testtemplate2"),
    			TemplateData: pulumi.Any{
    				Schema: "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json",
    				Items: []interface{}{
    					map[string]interface{}{
    						"content": map[string]interface{}{
    							"json": "## New workbook\n---\n\nWelcome to your new workbook.  This area will display text formatted as markdown.\n\n\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.",
    						},
    						"name": "text - 2",
    						"type": 1,
    					},
    					map[string]interface{}{
    						"content": map[string]interface{}{
    							"exportToExcelOptions": "visible",
    							"query":                "union withsource=TableName *\n| summarize Count=count() by TableName\n| render barchart",
    							"queryType":            0,
    							"resourceType":         "microsoft.operationalinsights/workspaces",
    							"size":                 1,
    							"version":              "KqlItem/1.0",
    						},
    						"name": "query - 2",
    						"type": 3,
    					},
    				},
    				StyleSettings: nil,
    				Version:       "Notebook/1.0",
    			},
    		})
    		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.WorkbookTemplate;
    import com.pulumi.azurenative.insights.WorkbookTemplateArgs;
    import com.pulumi.azurenative.insights.inputs.WorkbookTemplateGalleryArgs;
    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 workbookTemplate = new WorkbookTemplate("workbookTemplate", WorkbookTemplateArgs.builder()        
                .author("Contoso")
                .galleries(WorkbookTemplateGalleryArgs.builder()
                    .category("Failures")
                    .name("Simple Template")
                    .order(100)
                    .resourceType("microsoft.insights/components")
                    .type("tsg")
                    .build())
                .location("west us")
                .priority(1)
                .resourceGroupName("my-resource-group")
                .resourceName("testtemplate2")
                .templateData(Map.ofEntries(
                    Map.entry("$schema", "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"),
                    Map.entry("items",                 
                        Map.ofEntries(
                            Map.entry("content", Map.of("json", """
    ## New workbook
    ---
    
    Welcome to your new workbook.  This area will display text formatted as markdown.
    
    
    We've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.                        """)),
                            Map.entry("name", "text - 2"),
                            Map.entry("type", 1)
                        ),
                        Map.ofEntries(
                            Map.entry("content", Map.ofEntries(
                                Map.entry("exportToExcelOptions", "visible"),
                                Map.entry("query", """
    union withsource=TableName *
    | summarize Count=count() by TableName
    | render barchart                            """),
                                Map.entry("queryType", 0),
                                Map.entry("resourceType", "microsoft.operationalinsights/workspaces"),
                                Map.entry("size", 1),
                                Map.entry("version", "KqlItem/1.0")
                            )),
                            Map.entry("name", "query - 2"),
                            Map.entry("type", 3)
                        )),
                    Map.entry("styleSettings", ),
                    Map.entry("version", "Notebook/1.0")
                ))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    workbook_template = azure_native.insights.WorkbookTemplate("workbookTemplate",
        author="Contoso",
        galleries=[azure_native.insights.WorkbookTemplateGalleryArgs(
            category="Failures",
            name="Simple Template",
            order=100,
            resource_type="microsoft.insights/components",
            type="tsg",
        )],
        location="west us",
        priority=1,
        resource_group_name="my-resource-group",
        resource_name_="testtemplate2",
        template_data={
            "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json",
            "items": [
                {
                    "content": {
                        "json": """## New workbook
    ---
    
    Welcome to your new workbook.  This area will display text formatted as markdown.
    
    
    We've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.""",
                    },
                    "name": "text - 2",
                    "type": 1,
                },
                {
                    "content": {
                        "exportToExcelOptions": "visible",
                        "query": """union withsource=TableName *
    | summarize Count=count() by TableName
    | render barchart""",
                        "queryType": 0,
                        "resourceType": "microsoft.operationalinsights/workspaces",
                        "size": 1,
                        "version": "KqlItem/1.0",
                    },
                    "name": "query - 2",
                    "type": 3,
                },
            ],
            "styleSettings": {},
            "version": "Notebook/1.0",
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const workbookTemplate = new azure_native.insights.WorkbookTemplate("workbookTemplate", {
        author: "Contoso",
        galleries: [{
            category: "Failures",
            name: "Simple Template",
            order: 100,
            resourceType: "microsoft.insights/components",
            type: "tsg",
        }],
        location: "west us",
        priority: 1,
        resourceGroupName: "my-resource-group",
        resourceName: "testtemplate2",
        templateData: {
            $schema: "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json",
            items: [
                {
                    content: {
                        json: `## New workbook
    ---
    
    Welcome to your new workbook.  This area will display text formatted as markdown.
    
    
    We've included a basic analytics query to get you started. Use the \`Edit\` button below each section to configure it or add more sections.`,
                    },
                    name: "text - 2",
                    type: 1,
                },
                {
                    content: {
                        exportToExcelOptions: "visible",
                        query: `union withsource=TableName *
    | summarize Count=count() by TableName
    | render barchart`,
                        queryType: 0,
                        resourceType: "microsoft.operationalinsights/workspaces",
                        size: 1,
                        version: "KqlItem/1.0",
                    },
                    name: "query - 2",
                    type: 3,
                },
            ],
            styleSettings: {},
            version: "Notebook/1.0",
        },
    });
    
    resources:
      workbookTemplate:
        type: azure-native:insights:WorkbookTemplate
        properties:
          author: Contoso
          galleries:
            - category: Failures
              name: Simple Template
              order: 100
              resourceType: microsoft.insights/components
              type: tsg
          location: west us
          priority: 1
          resourceGroupName: my-resource-group
          resourceName: testtemplate2
          templateData:
            $schema: https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json
            items:
              - content:
                  json: |-
                    ## New workbook
                    ---
    
                    Welcome to your new workbook.  This area will display text formatted as markdown.
    
    
                    We've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.                
                name: text - 2
                type: 1
              - content:
                  exportToExcelOptions: visible
                  query: |-
                    union withsource=TableName *
                    | summarize Count=count() by TableName
                    | render barchart                
                  queryType: 0
                  resourceType: microsoft.operationalinsights/workspaces
                  size: 1
                  version: KqlItem/1.0
                name: query - 2
                type: 3
            styleSettings: {}
            version: Notebook/1.0
    

    Create WorkbookTemplate Resource

    new WorkbookTemplate(name: string, args: WorkbookTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def WorkbookTemplate(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         author: Optional[str] = None,
                         galleries: Optional[Sequence[WorkbookTemplateGalleryArgs]] = None,
                         localized: Optional[Mapping[str, Sequence[WorkbookTemplateLocalizedGalleryArgs]]] = None,
                         location: Optional[str] = None,
                         priority: Optional[int] = None,
                         resource_group_name: Optional[str] = None,
                         resource_name_: Optional[str] = None,
                         tags: Optional[Mapping[str, str]] = None,
                         template_data: Optional[Any] = None)
    @overload
    def WorkbookTemplate(resource_name: str,
                         args: WorkbookTemplateArgs,
                         opts: Optional[ResourceOptions] = None)
    func NewWorkbookTemplate(ctx *Context, name string, args WorkbookTemplateArgs, opts ...ResourceOption) (*WorkbookTemplate, error)
    public WorkbookTemplate(string name, WorkbookTemplateArgs args, CustomResourceOptions? opts = null)
    public WorkbookTemplate(String name, WorkbookTemplateArgs args)
    public WorkbookTemplate(String name, WorkbookTemplateArgs args, CustomResourceOptions options)
    
    type: azure-native:insights:WorkbookTemplate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args WorkbookTemplateArgs
    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 WorkbookTemplateArgs
    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 WorkbookTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkbookTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkbookTemplateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    WorkbookTemplate 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 WorkbookTemplate resource accepts the following input properties:

    Galleries List<Pulumi.AzureNative.Insights.Inputs.WorkbookTemplateGallery>
    Workbook galleries supported by the template.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    TemplateData object
    Valid JSON object containing workbook template payload.
    Author string
    Information about the author of the workbook template.
    Localized Dictionary<string, ImmutableArray<Pulumi.AzureNative.Insights.Inputs.WorkbookTemplateLocalizedGalleryArgs>>
    Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.
    Location string
    Resource location
    Priority int
    Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.
    ResourceName string
    The name of the Application Insights component resource.
    Tags Dictionary<string, string>
    Resource tags
    Galleries []WorkbookTemplateGalleryArgs
    Workbook galleries supported by the template.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    TemplateData interface{}
    Valid JSON object containing workbook template payload.
    Author string
    Information about the author of the workbook template.
    Localized map[string][]WorkbookTemplateLocalizedGalleryArgs
    Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.
    Location string
    Resource location
    Priority int
    Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.
    ResourceName string
    The name of the Application Insights component resource.
    Tags map[string]string
    Resource tags
    galleries List<WorkbookTemplateGallery>
    Workbook galleries supported by the template.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    templateData Object
    Valid JSON object containing workbook template payload.
    author String
    Information about the author of the workbook template.
    localized Map<String,List<WorkbookTemplateLocalizedGalleryArgs>>
    Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.
    location String
    Resource location
    priority Integer
    Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.
    resourceName String
    The name of the Application Insights component resource.
    tags Map<String,String>
    Resource tags
    galleries WorkbookTemplateGallery[]
    Workbook galleries supported by the template.
    resourceGroupName string
    The name of the resource group. The name is case insensitive.
    templateData any
    Valid JSON object containing workbook template payload.
    author string
    Information about the author of the workbook template.
    localized {[key: string]: WorkbookTemplateLocalizedGalleryArgs[]}
    Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.
    location string
    Resource location
    priority number
    Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.
    resourceName string
    The name of the Application Insights component resource.
    tags {[key: string]: string}
    Resource tags
    galleries Sequence[WorkbookTemplateGalleryArgs]
    Workbook galleries supported by the template.
    resource_group_name str
    The name of the resource group. The name is case insensitive.
    template_data Any
    Valid JSON object containing workbook template payload.
    author str
    Information about the author of the workbook template.
    localized Mapping[str, Sequence[WorkbookTemplateLocalizedGalleryArgs]]
    Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.
    location str
    Resource location
    priority int
    Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.
    resource_name str
    The name of the Application Insights component resource.
    tags Mapping[str, str]
    Resource tags
    galleries List<Property Map>
    Workbook galleries supported by the template.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    templateData Any
    Valid JSON object containing workbook template payload.
    author String
    Information about the author of the workbook template.
    localized Map<List<Property Map>>
    Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal.
    location String
    Resource location
    priority Number
    Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode.
    resourceName String
    The name of the Application Insights component resource.
    tags Map<String>
    Resource tags

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Azure resource name.
    Type string
    Azure resource type
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Azure resource name.
    Type string
    Azure resource type
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Azure resource name.
    type String
    Azure resource type
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Azure resource name.
    type string
    Azure resource type
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Azure resource name.
    type str
    Azure resource type
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Azure resource name.
    type String
    Azure resource type

    Supporting Types

    WorkbookTemplateGallery, WorkbookTemplateGalleryArgs

    Category string
    Category for the gallery.
    Name string
    Name of the workbook template in the gallery.
    Order int
    Order of the template within the gallery.
    ResourceType string
    Azure resource type supported by the gallery.
    Type string
    Type of workbook supported by the workbook template.
    Category string
    Category for the gallery.
    Name string
    Name of the workbook template in the gallery.
    Order int
    Order of the template within the gallery.
    ResourceType string
    Azure resource type supported by the gallery.
    Type string
    Type of workbook supported by the workbook template.
    category String
    Category for the gallery.
    name String
    Name of the workbook template in the gallery.
    order Integer
    Order of the template within the gallery.
    resourceType String
    Azure resource type supported by the gallery.
    type String
    Type of workbook supported by the workbook template.
    category string
    Category for the gallery.
    name string
    Name of the workbook template in the gallery.
    order number
    Order of the template within the gallery.
    resourceType string
    Azure resource type supported by the gallery.
    type string
    Type of workbook supported by the workbook template.
    category str
    Category for the gallery.
    name str
    Name of the workbook template in the gallery.
    order int
    Order of the template within the gallery.
    resource_type str
    Azure resource type supported by the gallery.
    type str
    Type of workbook supported by the workbook template.
    category String
    Category for the gallery.
    name String
    Name of the workbook template in the gallery.
    order Number
    Order of the template within the gallery.
    resourceType String
    Azure resource type supported by the gallery.
    type String
    Type of workbook supported by the workbook template.

    WorkbookTemplateGalleryResponse, WorkbookTemplateGalleryResponseArgs

    Category string
    Category for the gallery.
    Name string
    Name of the workbook template in the gallery.
    Order int
    Order of the template within the gallery.
    ResourceType string
    Azure resource type supported by the gallery.
    Type string
    Type of workbook supported by the workbook template.
    Category string
    Category for the gallery.
    Name string
    Name of the workbook template in the gallery.
    Order int
    Order of the template within the gallery.
    ResourceType string
    Azure resource type supported by the gallery.
    Type string
    Type of workbook supported by the workbook template.
    category String
    Category for the gallery.
    name String
    Name of the workbook template in the gallery.
    order Integer
    Order of the template within the gallery.
    resourceType String
    Azure resource type supported by the gallery.
    type String
    Type of workbook supported by the workbook template.
    category string
    Category for the gallery.
    name string
    Name of the workbook template in the gallery.
    order number
    Order of the template within the gallery.
    resourceType string
    Azure resource type supported by the gallery.
    type string
    Type of workbook supported by the workbook template.
    category str
    Category for the gallery.
    name str
    Name of the workbook template in the gallery.
    order int
    Order of the template within the gallery.
    resource_type str
    Azure resource type supported by the gallery.
    type str
    Type of workbook supported by the workbook template.
    category String
    Category for the gallery.
    name String
    Name of the workbook template in the gallery.
    order Number
    Order of the template within the gallery.
    resourceType String
    Azure resource type supported by the gallery.
    type String
    Type of workbook supported by the workbook template.

    WorkbookTemplateLocalizedGallery, WorkbookTemplateLocalizedGalleryArgs

    Galleries List<Pulumi.AzureNative.Insights.Inputs.WorkbookTemplateGallery>
    Workbook galleries supported by the template.
    TemplateData object
    Valid JSON object containing workbook template payload.
    Galleries []WorkbookTemplateGallery
    Workbook galleries supported by the template.
    TemplateData interface{}
    Valid JSON object containing workbook template payload.
    galleries List<WorkbookTemplateGallery>
    Workbook galleries supported by the template.
    templateData Object
    Valid JSON object containing workbook template payload.
    galleries WorkbookTemplateGallery[]
    Workbook galleries supported by the template.
    templateData any
    Valid JSON object containing workbook template payload.
    galleries Sequence[WorkbookTemplateGallery]
    Workbook galleries supported by the template.
    template_data Any
    Valid JSON object containing workbook template payload.
    galleries List<Property Map>
    Workbook galleries supported by the template.
    templateData Any
    Valid JSON object containing workbook template payload.

    WorkbookTemplateLocalizedGalleryResponse, WorkbookTemplateLocalizedGalleryResponseArgs

    Galleries List<Pulumi.AzureNative.Insights.Inputs.WorkbookTemplateGalleryResponse>
    Workbook galleries supported by the template.
    TemplateData object
    Valid JSON object containing workbook template payload.
    Galleries []WorkbookTemplateGalleryResponse
    Workbook galleries supported by the template.
    TemplateData interface{}
    Valid JSON object containing workbook template payload.
    galleries List<WorkbookTemplateGalleryResponse>
    Workbook galleries supported by the template.
    templateData Object
    Valid JSON object containing workbook template payload.
    galleries WorkbookTemplateGalleryResponse[]
    Workbook galleries supported by the template.
    templateData any
    Valid JSON object containing workbook template payload.
    galleries Sequence[WorkbookTemplateGalleryResponse]
    Workbook galleries supported by the template.
    template_data Any
    Valid JSON object containing workbook template payload.
    galleries List<Property Map>
    Workbook galleries supported by the template.
    templateData Any
    Valid JSON object containing workbook template payload.

    Import

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

    $ pulumi import azure-native:insights:WorkbookTemplate testtemplate2 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName} 
    

    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.34.0 published on Thursday, Mar 28, 2024 by Pulumi