Skip to content

Commit 356c98e

Browse files
authored
Merge pull request #113484 from lgayhardt/azmonworkbooksautomate0420
Azure Monitor Workbooks automate update
2 parents 95a758e + e90e01e commit 356c98e

File tree

2 files changed

+94
-4
lines changed

2 files changed

+94
-4
lines changed
2.51 KB
Loading

articles/azure-monitor/platform/workbooks-automate.md

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,112 @@ manager: carmonm
88
ms.workload: tbd
99
ms.tgt_pltfrm: ibiza
1010
ms.topic: conceptual
11-
ms.date: 10/23/2019
11+
ms.date: 04/30/2020
1212
ms.author: mbullwin
1313
---
1414

1515
# Programmatically manage workbooks
1616

17-
Resource owners have the option to create and manage their workbooks programmatically via Resource Manager templates.
17+
Resource owners have the option to create and manage their workbooks programmatically via Resource Manager templates.
1818

1919
This can be useful in scenarios like:
2020
* Deploying org- or domain-specific analytics reports along with resources deployments. For instance, you may deploy org-specific performance and failure workbooks for your new apps or virtual machines.
2121
* Deploying standard reports or dashboards using workbooks for existing resources.
2222

2323
The workbook will be created in the desired sub/resource-group and with the content specified in the Resource Manager templates.
2424

25-
## Azure Resource Manager template for deploying workbooks
25+
There are two types of workbook resources that can be managed programmatically:
26+
* [Workbook templates](#azure-resource-manager-template-for-deploying-a-workbook-template)
27+
* [Workbook instances](#azure-resource-manager-template-for-deploying-a-workbook-instance)
28+
29+
## Azure Resource Manager template for deploying a workbook template
30+
31+
1. Open a workbook you want to deploy programmatically.
32+
2. Switch the workbook to edit mode by clicking on the _Edit_ toolbar item.
33+
3. Open the _Advanced Editor_ using the _</>_ button on the toolbar.
34+
4. Ensure you are on the _Gallery Template_ tab.
35+
36+
![Gallery template tab](./media/workbooks-automate/gallery-template.png)
37+
1. Copy the JSON in the gallery template to the clipboard.
38+
2. Below is a sample Azure Resource Manager template that deploys a workbook template to Azure Monitor workbook gallery. Paste the JSON you copied in place of `<PASTE-COPIED-WORKBOOK_TEMPLATE_HERE>`. A reference Azure Resource Manager template that creates a workbook template can be found [here](https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Documentation/ARM-template-for-creating-workbook-template).
39+
40+
```json
41+
{
42+
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
43+
"contentVersion": "1.0.0.0",
44+
"parameters": {
45+
"resourceName": {
46+
"type": "string",
47+
"defaultValue": "my-workbook-template",
48+
"metadata": {
49+
"description": "The unique name for this workbook template instance"
50+
}
51+
}
52+
},
53+
"resources": [
54+
{
55+
"name": "[parameters('resourceName')]",
56+
"type": "microsoft.insights/workbooktemplates",
57+
"location": "[resourceGroup().location]",
58+
"apiVersion": "2019-10-17-preview",
59+
"dependsOn": [],
60+
"properties": {
61+
"galleries": [
62+
{
63+
"name": "A Workbook Template",
64+
"category": "Deployed Templates",
65+
"order": 100,
66+
"type": "workbook",
67+
"resourceType": "Azure Monitor"
68+
}
69+
],
70+
"templateData": <PASTE-COPIED-WORKBOOK_TEMPLATE_HERE>
71+
}
72+
}
73+
]
74+
}
75+
```
76+
1. In the `galleries` object fill in the `name` and `category` keys with your values. Learn more about [parameters](#parameters) in the next section.
77+
2. Deploy this Azure Resource Manager template using either the [Azure portal](https://docs.microsoft.com/azure/azure-resource-manager/templates/deploy-portal#deploy-resources-from-custom-template), [command line interface](https://docs.microsoft.com/azure/azure-resource-manager/templates/deploy-cli), [PowerShell](https://docs.microsoft.com/azure/azure-resource-manager/templates/deploy-powershell), etc.
78+
3. Open the Azure portal and navigate to the workbook gallery chosen in the Azure Resource Manager template. In the example template, navigate to the Azure Monitor workbook gallery:
79+
1. Open the Azure portal and navigate to Azure Monitor
80+
2. Open `Workbooks` from the table of contents
81+
3. Find your template in the gallery under category `Deployed Templates` (will be one of the purple items).
82+
83+
### Parameters
84+
85+
|Parameters |Explanation |
86+
|:-------------------------|:-------------------------------------------------------------------------------------------------------|
87+
| `name` | The name of the workbook template resource in Azure Resource Manager. |
88+
|`type` | Always microsoft.insights/workbooktemplates |
89+
| `location` | The Azure location that the workbook will be created in. |
90+
| `apiVersion` | 2019-10-17 preview |
91+
| `type` | Always microsoft.insights/workbooktemplates |
92+
| `galleries` | The set of galleries to show this workbook template in. |
93+
| `gallery.name` | The friendly name of the workbook template in the gallery. |
94+
| `gallery.category` | The group in the gallery to place the template in. |
95+
| `gallery.order` | A number that decides the order to show the template within a category in the gallery. Lower order implies higher priority. |
96+
| `gallery.resourceType` | The resource type corresponding to the gallery. This is usually the resource type string corresponding to the resource (for example, microsoft.operationalinsights/workspaces ). |
97+
|`gallery.type` | Referred to as workbook type, this is a unique key that differentiates the gallery within a resource type. Application Insights, for example, have types `workbook` and `tsg` corresponding to different workbook galleries. |
98+
99+
### Galleries
100+
101+
| Gallery | Resource type | Workbook type |
102+
| :--------------------------------------------- |:---------------------------------------------------|:--------------|
103+
| Workbooks in Azure Monitor | `Azure Monitor` | `workbook` |
104+
| VM Insights in Azure Monitor | `Azure Monitor` | `vm-insights` |
105+
| Workbooks in Log analytics workspace | `microsoft.operationalinsights/workspaces` | `workbook` |
106+
| Workbooks in Application Insights | `microsoft.insights/component` | `workbook` |
107+
| Troubleshooting guides in Application Insights | `microsoft.insights/component` | `tsg` |
108+
| Usage in Application Insights | `microsoft.insights/component` | `usage` |
109+
| Workbooks in Kubernetes service | `Microsoft.ContainerService/managedClusters` | `workbook` |
110+
| Workbooks in Resource groups | `microsoft.resources/subscriptions/resourcegroups` | `workbook` |
111+
| Workbooks in Azure Active Directory | `microsoft.aadiam/tenant` | `workbook` |
112+
| VM Insights in Virtual machines | `microsoft.compute/virtualmachines` | `insights` |
113+
| VM Insights in virtual machine scale sets | `microsoft.compute/virtualmachinescalesets` | `insights` |
114+
115+
## Azure Resource Manager template for deploying a workbook instance
116+
26117
1. Open a workbook that you want to deploy programmatically.
27118
2. Switch the workbook to edit mode by clicking on the _Edit_ toolbar item.
28119
3. Open the _Advanced Editor_ using the _</>_ button on the toolbar.
@@ -120,4 +211,3 @@ For a technical reason, this mechanism cannot be used to create workbook instanc
120211
## Next steps
121212

122213
Explore how workbooks are being used to power the new [Azure Monitor for Storage experience](../insights/storage-insights-overview.md).
123-

0 commit comments

Comments
 (0)