템플릿에서 DCR 및 연결을 정의하려면 다음 참조를 참조하세요.
다음 템플릿을 사용하여 Azure Monitor의 데이터 수집 규칙 구조 및 Azure Monitor의 샘플 DCR(데이터 수집 규칙)의 정보를 사용하여 DCR을 만들어 dcr-properties
을(를) 정의합니다.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dataCollectionRuleName": {
"type": "string",
"metadata": {
"description": "Specifies the name of the Data Collection Rule to create."
}
},
"location": {
"type": "string",
"metadata": {
"description": "Specifies the location in which to create the Data Collection Rule."
}
}
},
"resources": [
{
"type": "Microsoft.Insights/dataCollectionRules",
"name": "[parameters('dataCollectionRuleName')]",
"location": "[parameters('location')]",
"apiVersion": "2021-09-01-preview",
"properties": {
"<dcr-properties>"
}
}
]
}
DCR 연결 -Azure VM
다음 샘플에서는 Azure 가상 머신과 데이터 수집 규칙 간에 연결을 만듭니다.
Bicep 템플릿 파일
@description('The name of the virtual machine.')
param vmName string
@description('The name of the association.')
param associationName string
@description('The resource ID of the data collection rule.')
param dataCollectionRuleId string
resource vm 'Microsoft.Compute/virtualMachines@2021-11-01' existing = {
name: vmName
}
resource association 'Microsoft.Insights/dataCollectionRuleAssociations@2021-09-01-preview' = {
name: associationName
scope: vm
properties: {
description: 'Association of data collection rule. Deleting this association will break the data collection for this virtual machine.'
dataCollectionRuleId: dataCollectionRuleId
}
}
ARM 템플릿 파일
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"type": "string",
"metadata": {
"description": "The name of the virtual machine."
}
},
"associationName": {
"type": "string",
"metadata": {
"description": "The name of the association."
}
},
"dataCollectionRuleId": {
"type": "string",
"metadata": {
"description": "The resource ID of the data collection rule."
}
}
},
"resources": [
{
"type": "Microsoft.Insights/dataCollectionRuleAssociations",
"apiVersion": "2021-09-01-preview",
"scope": "[format('Microsoft.Compute/virtualMachines/{0}', parameters('vmName'))]",
"name": "[parameters('associationName')]",
"properties": {
"description": "Association of data collection rule. Deleting this association will break the data collection for this virtual machine.",
"dataCollectionRuleId": "[parameters('dataCollectionRuleId')]"
}
}
]
}
매개 변수 파일
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"value": "my-azure-vm"
},
"associationName": {
"value": "my-windows-vm-my-dcr"
},
"dataCollectionRuleId": {
"value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/microsoft.insights/datacollectionrules/my-dcr"
}
}
}
DCR 연결 -Arc 지원 서버
다음 샘플에서는 Azure Arc 사용 서버와 데이터 수집 규칙 간에 연결을 만듭니다.
Bicep 템플릿 파일
@description('The name of the virtual machine.')
param vmName string
@description('The name of the association.')
param associationName string
@description('The resource ID of the data collection rule.')
param dataCollectionRuleId string
resource vm 'Microsoft.HybridCompute/machines@2021-11-01' existing = {
name: vmName
}
resource association 'Microsoft.Insights/dataCollectionRuleAssociations@2021-09-01-preview' = {
name: associationName
scope: vm
properties: {
description: 'Association of data collection rule. Deleting this association will break the data collection for this Arc server.'
dataCollectionRuleId: dataCollectionRuleId
}
}
ARM 템플릿 파일
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"type": "string",
"metadata": {
"description": "The name of the virtual machine."
}
},
"associationName": {
"type": "string",
"metadata": {
"description": "The name of the association."
}
},
"dataCollectionRuleId": {
"type": "string",
"metadata": {
"description": "The resource ID of the data collection rule."
}
}
},
"resources": [
{
"type": "Microsoft.Insights/dataCollectionRuleAssociations",
"apiVersion": "2021-09-01-preview",
"scope": "[format('Microsoft.HybridCompute/machines/{0}', parameters('vmName'))]",
"name": "[parameters('associationName')]",
"properties": {
"description": "Association of data collection rule. Deleting this association will break the data collection for this Arc server.",
"dataCollectionRuleId": "[parameters('dataCollectionRuleId')]"
}
}
]
}
매개 변수 파일
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"value": "my-hybrid-vm"
},
"associationName": {
"value": "my-windows-vm-my-dcr"
},
"dataCollectionRuleId": {
"value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/microsoft.insights/datacollectionrules/my-dcr"
}
}
}