Resource Manager-voorbeeldsjablonen voor werkmappen in Azure Monitor

Dit artikel bevat Azure Resource Manager-sjablonen die dienen als voorbeeld voor het maken van werkmappen in Azure Monitor. Elk voorbeeld bevat een sjabloonbestand en een parameterbestand met voorbeeldwaarden voor het sjabloon.

Notitie

Zie Azure Resource Manager-voorbeelden voor Azure Monitor voor een lijst met beschikbare voorbeelden en richtlijnen voor het implementeren ervan in uw Azure-abonnement.

Workbooks kunnen complex zijn, dus een veelgebruikte strategie is om de werkmap te maken in Azure Portal en vervolgens een Resource Manager-sjabloon te genereren. Zie Azure Resource Manager-sjabloon voor het implementeren van werkmappen voor meer informatie over deze methode.

Een werkmap maken

In het volgende voorbeeld wordt een eenvoudige werkmap gemaakt.

Sjabloonbestand

@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

Parameterbestand

{
  "$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"
    }
  }
}

Volgende stappen