Azure Monitor のブック用の Resource Manager テンプレートのサンプル

この記事には、Azure Monitor でブックを作成するためのサンプルの Azure Resource Manager テンプレートが含まれています。 各サンプルには、テンプレート ファイルと、テンプレートに指定するサンプル値を含むパラメーター ファイルが含まれています。

Note

利用可能なサンプルのリスト、および Azure サブスクリプションへの各サンプルのデプロイ方法については、Azure Monitor の Azure Resource Manager のサンプルに関するページを参照してください。

ブックは複雑になる可能性があるため、一般的な戦略として、Azure portal でブックを作成してから、Resource Manager テンプレートを生成します。 この方法の詳細については、ブックをデプロイするための Azure Resource Manager テンプレートに関するページを参照してください。

ブックの作成

次のサンプルでは、単純なブックを作成します。

テンプレート ファイル

@description('The unique guid for this workbook instance.')
param workbookId string = newGuid()

@description('The location of the resource.')
param location string = resourceGroup().location

@description('The friendly name for the workbook that is used in the Gallery or Saved List. Needs to be unique in the scope of the resource group and source.')
param workbookDisplayName string = 'My Workbook'

@description('The gallery that the workbook will been shown under. Supported values include workbook, `tsg`, Azure Monitor, etc.')
param workbookType string = 'tsg'

@description('The id of resource instance to which the workbook will be associated.')
param workbookSourceId string = '<insert-your-resource-id-here>'


resource workbook 'Microsoft.Insights/workbooks@2018-06-17-preview' = {
  name: workbookId
  location: location
  kind: 'shared'
  properties: {
    displayName: workbookDisplayName
    serializedData: '{"version":"Notebook/1.0","items":[{"type":1,"content":"{\\"json\\":\\"Hello World!\\"}","conditionalVisibility":null}],"isLocked":false}'
    version: '1.0'
    sourceId: workbookSourceId
    category: workbookType
  }
}

output workbookId string = workbook.id

パラメーター ファイル

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "value": "Sample Hello World workbook"
    },
    "workbookType": {
      "value": "workbook"
    },
    "workbookSourceId": {
      "value": "Azure Monitor"
    }
  }
}

次のステップ