Help with VM Insights in Bicep #15695
GBCSIM1
started this conversation in
Authoring Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am creating a Bicep Template (held in a ACR) for our engineers to use.
I have created a VM Insights template that includes:
Data Collection Rule
Data Collection Rule Association
Existing VM
Existing VM RG
I want to have One DCR for VM insights.
Then have an association referencing the DCR.id.
The existing Vm resource group requires the template to be targetscope = Subscription but the DCR requires the TargetScope to be Resource group.
Any ideas how i can achieve this?
I have attempted to put a seperate file for the DCR Association but doesn't like the reference of a resource.
Trying to understand how this can be achieved?
#resource dcr 'Microsoft.Insights/dataCollectionRules@2023-03-11' = {
name: dcrName
identity: {
type: identityType
userAssignedIdentities: identityType == 'SystemAssigned' ? null : userAssignedIdentities
}
location: location
properties: {
description: 'Data collection rule for VM Insights.'
dataSources: {
performanceCounters: [
{
streams: [
'Microsoft-InsightsMetrics'
]
samplingFrequencyInSeconds: 60
counterSpecifiers: [
'\VmInsights\DetailedMetrics'
]
name: 'VMInsightsPerfCounters'
}
]
extensions: [
{
streams: [
'Microsoft-ServiceMap'
]
extensionName: 'DependencyAgent'
extensionSettings: {}
name: 'DependencyAgentDataSource'
}
]
}
destinations: {
logAnalytics: [
{
name: 'VMInsightsPerf-Logs-Dest'
workspaceResourceId: logAnalyticsId
}
]
}
dataFlows: [
{
streams: [
'Microsoft-InsightsMetrics'
]
destinations: [
'VMInsightsPerf-Logs-Dest'
]
}
{
streams: [
'Microsoft-ServiceMap'
]
destinations: [
'VMInsightsPerf-Logs-Dest'
]
}
]
}
}
I have managed to get this to work creating the VM
Beta Was this translation helpful? Give feedback.
All reactions