Workbook
Manages an Azure Workbook.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleWorkbook = new azure.appinsights.Workbook("example", {
name: "85b3e8bb-fc93-40be-83f2-98f6bec18ba0",
resourceGroupName: example.name,
location: example.location,
displayName: "workbook1",
dataJson: JSON.stringify({
version: "Notebook/1.0",
items: [{
type: 1,
content: {
json: "Test2022",
},
name: "text - 0",
}],
isLocked: false,
fallbackResourceIds: ["Azure Monitor"],
}),
tags: {
ENV: "Test",
},
});
Content copied to clipboard
import pulumi
import json
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_workbook = azure.appinsights.Workbook("example",
name="85b3e8bb-fc93-40be-83f2-98f6bec18ba0",
resource_group_name=example.name,
location=example.location,
display_name="workbook1",
data_json=json.dumps({
"version": "Notebook/1.0",
"items": [{
"type": 1,
"content": {
"json": "Test2022",
},
"name": "text - 0",
}],
"isLocked": False,
"fallbackResourceIds": ["Azure Monitor"],
}),
tags={
"ENV": "Test",
})
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleWorkbook = new Azure.AppInsights.Workbook("example", new()
{
Name = "85b3e8bb-fc93-40be-83f2-98f6bec18ba0",
ResourceGroupName = example.Name,
Location = example.Location,
DisplayName = "workbook1",
DataJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["version"] = "Notebook/1.0",
["items"] = new[]
{
new Dictionary<string, object?>
{
["type"] = 1,
["content"] = new Dictionary<string, object?>
{
["json"] = "Test2022",
},
["name"] = "text - 0",
},
},
["isLocked"] = false,
["fallbackResourceIds"] = new[]
{
"Azure Monitor",
},
}),
Tags =
{
{ "ENV", "Test" },
},
});
});
Content copied to clipboard
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appinsights"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"version": "Notebook/1.0",
"items": []map[string]interface{}{
map[string]interface{}{
"type": 1,
"content": map[string]interface{}{
"json": "Test2022",
},
"name": "text - 0",
},
},
"isLocked": false,
"fallbackResourceIds": []string{
"Azure Monitor",
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = appinsights.NewWorkbook(ctx, "example", &appinsights.WorkbookArgs{
Name: pulumi.String("85b3e8bb-fc93-40be-83f2-98f6bec18ba0"),
ResourceGroupName: example.Name,
Location: example.Location,
DisplayName: pulumi.String("workbook1"),
DataJson: pulumi.String(json0),
Tags: pulumi.StringMap{
"ENV": pulumi.String("Test"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.appinsights.Workbook;
import com.pulumi.azure.appinsights.WorkbookArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleWorkbook = new Workbook("exampleWorkbook", WorkbookArgs.builder()
.name("85b3e8bb-fc93-40be-83f2-98f6bec18ba0")
.resourceGroupName(example.name())
.location(example.location())
.displayName("workbook1")
.dataJson(serializeJson(
jsonObject(
jsonProperty("version", "Notebook/1.0"),
jsonProperty("items", jsonArray(jsonObject(
jsonProperty("type", 1),
jsonProperty("content", jsonObject(
jsonProperty("json", "Test2022")
)),
jsonProperty("name", "text - 0")
))),
jsonProperty("isLocked", false),
jsonProperty("fallbackResourceIds", jsonArray("Azure Monitor"))
)))
.tags(Map.of("ENV", "Test"))
.build());
}
}
Content copied to clipboard
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleWorkbook:
type: azure:appinsights:Workbook
name: example
properties:
name: 85b3e8bb-fc93-40be-83f2-98f6bec18ba0
resourceGroupName: ${example.name}
location: ${example.location}
displayName: workbook1
dataJson:
fn::toJSON:
version: Notebook/1.0
items:
- type: 1
content:
json: Test2022
name: text - 0
isLocked: false
fallbackResourceIds:
- Azure Monitor
tags:
ENV: Test
Content copied to clipboard
Import
Workbooks can be imported using the resource id
, e.g.
$ pulumi import azure:appinsights/workbook:Workbook example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Insights/workbooks/resource1
Content copied to clipboard
Properties
Link copied to clipboard
Specifies the description of the workbook.
Link copied to clipboard
Specifies the user-defined name (display name) of the workbook.
Link copied to clipboard
An identity
block as defined below. Changing this forces a new Workbook to be created.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Specifies the name of the Resource Group where the Workbook should exist. Changing this forces a new Workbook to be created.
Link copied to clipboard
Specifies the Resource Manager ID of the Storage Container when bring your own storage is used. Changing this forces a new Workbook to be created.