Sampel template Azure Resource Manager untuk buku kerja di Azure Monitor
Artikel ini menyertakan sampel templat Azure Resource Manager untuk membuat buku kerja di Azure Monitor. Setiap sampel menyertakan file templat dan file parameter dengan sampel nilai yang akan disediakan untuk templat.
Catatan
Lihat Sampel Azure Resource Manager untuk Azure Monitor untuk daftar sampel yang tersedia dan panduan tentang menyebarkannya di langganan Azure Anda.
Buku kerja bisa rumit, jadi strategi umumnya adalah membuat buku kerja di portal Azure lalu membuat templat Resource Manager. Lihat detail metode ini di templat Azure Resource Manager untuk menyebarkan buku kerja.
Membuat buku kerja
Contoh berikut membuat buku kerja sederhana.
File templat
@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
File parameter
{
"$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"
}
}
}