Skip to content

Commit 57a623b

Browse files
Create skeleton workbook (#598)
* Create skeleton workbook Workbook contents to come later Fixes #548 * Remove gallery from param description Co-authored-by: Ross Smith <[email protected]> * Name heading heading Co-authored-by: Ross Smith <[email protected]> --------- Co-authored-by: Ross Smith <[email protected]>
1 parent c2c6cf1 commit 57a623b

File tree

4 files changed

+312
-142
lines changed

4 files changed

+312
-142
lines changed

infra/core/monitor/workbook.bicep

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@description('The friendly name for the workbook. This name must be unique within a resource group.')
2+
param workbookDisplayName string
3+
4+
@description('The gallery that the workbook will been shown under. Supported values include workbook, tsg, etc. Usually, this is \'workbook\'')
5+
param workbookType string = 'workbook'
6+
7+
@description('The id of resource instance to which the workbook will be associated')
8+
param workbookSourceId string = 'azure monitor'
9+
10+
@description('The unique guid for this workbook instance')
11+
param workbookId string
12+
13+
@description('The json content of the workbook')
14+
param workbookContents string
15+
16+
param location string = resourceGroup().location
17+
18+
resource workbookId_resource 'microsoft.insights/workbooks@2023-06-01' = {
19+
name: workbookId
20+
location: location
21+
kind: 'shared'
22+
properties: {
23+
displayName: workbookDisplayName
24+
serializedData: workbookContents
25+
version: '1.0'
26+
sourceId: workbookSourceId
27+
category: workbookType
28+
}
29+
dependsOn: []
30+
}
31+
32+
output workbookId string = workbookId_resource.id

infra/main.bicep

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ param websiteName string = 'web-${resourceToken}'
3636
@description('Name of Application Insights')
3737
param applicationInsightsName string = 'appinsights-${resourceToken}'
3838

39+
@description('Name of the Workbook')
40+
param workbookDisplayName string = 'workbook-${resourceToken}'
41+
3942
@description('Use semantic search')
4043
param azureSearchUseSemanticSearch string = 'false'
4144

@@ -571,6 +574,17 @@ module monitoring './core/monitor/monitoring.bicep' = {
571574
}
572575
}
573576

577+
module workbook './core/monitor/workbook.bicep' = {
578+
name: workbookDisplayName
579+
scope: rg
580+
params: {
581+
workbookId: 'd9bd03af-7ef0-4bac-b91b-b14ee4c7002b'
582+
workbookDisplayName: workbookDisplayName
583+
location: location
584+
workbookContents: loadTextContent('workbooks/workbook.json')
585+
}
586+
}
587+
574588
module function './app/function.bicep' = if (hostingModel == 'code') {
575589
name: functionName
576590
scope: rg

0 commit comments

Comments
 (0)