azure 如何将工作簿资源与其他资源链接

yacmzcpb  于 2023-01-09  发布在  其他
关注(0)|答案(1)|浏览(154)

我已经创建了一个简单的工作簿模板通过二头肌没有任何设置。
我希望将其与其他资源集成/链接,例如使用Bicep的应用洞察,并通过我的管道将其部署到Azure。
但是,我不知道如何将它们链接在一起。如果不可能,如何将工作簿模板链接到App Service资源或其他资源示例?
这是我的练习册二头肌:

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

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

@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 workbookName string

@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@2022-04-01' = {
  name: workbookId
  location: location
  kind: 'shared'
  properties: {
    displayName: workbookName
    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

这是我的应用洞察:

@description('Name of Application Insights resource.')
param appName string

@description('Type of app you are deploying. This field is for legacy reasons and will not impact the type of App Insights resource you deploy.')
param type string = 'web'

@description('Which Azure Region to deploy the resource to. This must be a valid Azure regionId.')
param regionId string

@description('Source of Azure Resource Manager deployment.')
param requestSource string

@description('Log Analytics workspace ID to associate with your Application Insights resource.')
param workspaceResourceId string

//param deployWorkspaceDiagnosticSettings bool = true

// @description('See documentation on tags: https://learn.microsoft.com/azure/azure-resource-manager/management/tag-resources.')
// param tagsArray object

resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
  name: appName
  location: regionId
  // tags: tagsArray
  kind: 'other'
  properties: {
    Application_Type: type
    Flow_Type: 'Bluefield'
    Request_Source: requestSource
    WorkspaceResourceId: workspaceResourceId
  }
}

@description('Get Application Insights ID.')
output appIdOutput string = applicationInsights.id

@description('Get Application Type.')
output appTypeOutput string = applicationInsights.properties.Application_Type

@description('Get Instrumentation Key.')
output appInstrumentationKeyOutput string = applicationInsights.properties.InstrumentationKey
cygmwpex

cygmwpex1#

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

workbookSourceId将是应用洞察资源的资源ID,您将首先创建该资源(如果您希望将其链接到应用洞察资源)
你实际上是如何做的二头肌具体我不知道,但似乎你已经做了类似的workspaceResourceId

相关问题