-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #664 from Azure/issue-662
updates
- Loading branch information
Showing
3 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"_generator": { | ||
"name": "bicep", | ||
"version": "0.29.47.4906", | ||
"templateHash": "8529136871393216686" | ||
"templateHash": "14096690486777536500" | ||
} | ||
}, | ||
"parameters": { | ||
|
@@ -405,6 +405,12 @@ | |
"metadata": { | ||
"description": "Organizational owner of the AVD deployment. (Default: [email protected])" | ||
} | ||
}, | ||
"dataCollectionRuleId": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Data collection rule ID." | ||
} | ||
} | ||
}, | ||
"variables": { | ||
|
@@ -5720,6 +5726,73 @@ | |
"sessionHostsAntimalwareExtension" | ||
] | ||
}, | ||
{ | ||
"copy": { | ||
"name": "dataCollectionRuleAssociation", | ||
"count": "[length(range(1, parameters('count')))]" | ||
}, | ||
"condition": "[parameters('deployMonitoring')]", | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2022-09-01", | ||
"name": "[format('DCR-Asso-{0}-{1}', sub(range(1, parameters('count'))[copyIndex()], 1), parameters('time'))]", | ||
"subscriptionId": "[format('{0}', parameters('computeSubscriptionId'))]", | ||
"resourceGroup": "[format('{0}', parameters('computeRgResourceGroupName'))]", | ||
"properties": { | ||
"expressionEvaluationOptions": { | ||
"scope": "inner" | ||
}, | ||
"mode": "Incremental", | ||
"parameters": { | ||
"virtualMachineName": { | ||
"value": "[format('{0}{1}', variables('varSessionHostNamePrefix'), padLeft(add(range(1, parameters('count'))[copyIndex()], parameters('countIndex')), 4, '0'))]" | ||
}, | ||
"dataCollectionRuleId": { | ||
"value": "[parameters('dataCollectionRuleId')]" | ||
} | ||
}, | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.29.47.4906", | ||
"templateHash": "15961062277630290779" | ||
} | ||
}, | ||
"parameters": { | ||
"virtualMachineName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "VM name." | ||
} | ||
}, | ||
"dataCollectionRuleId": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Data collection rule ID." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Insights/dataCollectionRuleAssociations", | ||
"apiVersion": "2022-06-01", | ||
"scope": "[format('Microsoft.Compute/virtualMachines/{0}', parameters('virtualMachineName'))]", | ||
"name": "[parameters('virtualMachineName')]", | ||
"properties": { | ||
"dataCollectionRuleId": "[parameters('dataCollectionRuleId')]", | ||
"description": "AVD Insights data collection rule association" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"dependsOn": [ | ||
"monitoring", | ||
"sessionHostsAntimalwareExtension" | ||
] | ||
}, | ||
{ | ||
"copy": { | ||
"name": "sessionHostConfiguration", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,9 @@ param opsTeamTag string = '[email protected]' | |
@sys.description('Organizational owner of the AVD deployment. (Default: [email protected])') | ||
param ownerTag string = '[email protected]' | ||
|
||
@sys.description('Data collection rule ID.') | ||
param dataCollectionRuleId string | ||
|
||
// =========== // | ||
// Variable declaration // | ||
// =========== // | ||
|
@@ -436,6 +439,22 @@ module monitoring '../../../../avm/1.0.0/res/compute/virtual-machine/extension/m | |
] | ||
}] | ||
|
||
// Data collection rule association | ||
module dataCollectionRuleAssociation '../..//modules/avdSessionHosts/.bicep/dataCollectionRulesAssociation.bicep' = [for i in range(1, count): if (deployMonitoring) { | ||
scope: resourceGroup('${computeSubscriptionId}', '${computeRgResourceGroupName}') | ||
name: 'DCR-Asso-${i - 1}-${time}' | ||
params: { | ||
virtualMachineName: '${varSessionHostNamePrefix}${padLeft((i + countIndex), 4, '0')}' | ||
dataCollectionRuleId: dataCollectionRuleId | ||
} | ||
dependsOn: [ | ||
monitoring | ||
sessionHostsAntimalwareExtension | ||
alaWorkspace | ||
] | ||
}] | ||
|
||
|
||
// Apply AVD session host configurations | ||
module sessionHostConfiguration '../../modules/avdSessionHosts/.bicep/configureSessionHost.bicep' = [for i in range(1, count): { | ||
scope: resourceGroup('${computeSubscriptionId}', '${computeRgResourceGroupName}') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters