Share via


Resource Manager mallexempel för arbetsböcker i Azure Monitor

Den här artikeln innehåller exempel på Azure Resource Manager-mallar för att skapa arbetsböcker i Azure Monitor. Varje exempel innehåller en mallfil och en parameterfil med exempelvärden som ska tillhandahållas till mallen.

Anteckning

Se Azure Resource Manager-exempel för Azure Monitor för en lista över exempel som är tillgängliga och vägledning om hur du distribuerar dem i din Azure-prenumeration.

Arbetsböcker kan vara komplexa, så en typisk strategi är att skapa arbetsboken i Azure Portal och sedan generera en Resource Manager mall. Se information om den här metoden i Azure Resource Manager mall för distribution av arbetsböcker.

Skapa en arbetsbok

I följande exempel skapas en enkel arbetsbok.

Mallfil

@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

Parameterfil

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

Nästa steg