Skip to content

Commit

Permalink
param update for psrule
Browse files Browse the repository at this point in the history
  • Loading branch information
elanzel committed Jul 13, 2023
1 parent d7571e0 commit 0eeb82a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions modules/compute/virtual-machine-scale-sets/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ resource vmss_logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@20
scope: resourceGroup(split(monitoringWorkspaceId, '/')[2], split(monitoringWorkspaceId, '/')[4])
}

module vmss_microsoftMonitoringAgentExtension 'extensions/main.bicep' = if (extensionMonitoringAgentConfig.enabled) {
name: '${uniqueString(deployment().name, location)}-VMSS-MicrosoftMonitoringAgent'
module vmss_azureMonitorAgentExtension 'extensions/main.bicep' = if (extensionMonitoringAgentConfig.enabled) {
name: '${uniqueString(deployment().name, location)}-VMSS-AzureMonitorAgent'
params: {
virtualMachineScaleSetName: vmss.name
name: 'AzureMonitorAgent'
Expand Down Expand Up @@ -609,7 +609,7 @@ module vmss_azureDiskEncryptionExtension 'extensions/main.bicep' = if (extension
}
dependsOn: [
vmss_customScriptExtension
vmss_microsoftMonitoringAgentExtension
vmss_azureMonitorAgentExtension
]
}

Expand Down
10 changes: 5 additions & 5 deletions modules/compute/virtual-machine-scale-sets/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@
"condition": "[parameters('extensionMonitoringAgentConfig').enabled]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('{0}-VMSS-MicrosoftMonitoringAgent', uniqueString(deployment().name, parameters('location')))]",
"name": "[format('{0}-VMSS-AzureMonitorAgent', uniqueString(deployment().name, parameters('location')))]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
Expand All @@ -1194,12 +1194,12 @@
"value": "[parameters('name')]"
},
"name": {
"value": "MicrosoftMonitoringAgent"
"value": "AzureMonitorAgent"
},
"publisher": {
"value": "Microsoft.EnterpriseCloud.Monitoring"
},
"type": "[if(equals(parameters('osType'), 'Windows'), createObject('value', 'MicrosoftMonitoringAgent'), createObject('value', 'OmsAgentForLinux'))]",
"type": "[if(equals(parameters('osType'), 'Windows'), createObject('value', 'AzureMonitorWindowsAgent'), createObject('value', 'AzureMonitorLinuxAgent'))]",
"typeHandlerVersion": "[if(contains(parameters('extensionMonitoringAgentConfig'), 'typeHandlerVersion'), createObject('value', parameters('extensionMonitoringAgentConfig').typeHandlerVersion), if(equals(parameters('osType'), 'Windows'), createObject('value', '1.0'), createObject('value', '1.7')))]",
"autoUpgradeMinorVersion": "[if(contains(parameters('extensionMonitoringAgentConfig'), 'autoUpgradeMinorVersion'), createObject('value', parameters('extensionMonitoringAgentConfig').autoUpgradeMinorVersion), createObject('value', true()))]",
"enableAutomaticUpgrade": "[if(contains(parameters('extensionMonitoringAgentConfig'), 'enableAutomaticUpgrade'), createObject('value', parameters('extensionMonitoringAgentConfig').enableAutomaticUpgrade), createObject('value', false()))]",
Expand Down Expand Up @@ -2275,7 +2275,7 @@
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('name'))]",
"[resourceId('Microsoft.Resources/deployments', format('{0}-VMSS-CustomScriptExtension', uniqueString(deployment().name, parameters('location'))))]",
"[resourceId('Microsoft.Resources/deployments', format('{0}-VMSS-MicrosoftMonitoringAgent', uniqueString(deployment().name, parameters('location'))))]"
"[resourceId('Microsoft.Resources/deployments', format('{0}-VMSS-AzureMonitorAgent', uniqueString(deployment().name, parameters('location'))))]"
]
},
{
Expand Down Expand Up @@ -2486,4 +2486,4 @@
"value": "[reference(resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('name')), '2022-11-01', 'full').location]"
}
}
}
}
7 changes: 5 additions & 2 deletions ps-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ include:
- PSRule.Rules.Azure

execution:
suppressedRuleWarning: false
notProcessedWarning: false
# suppressedRuleWarning: false
# notProcessedWarning: false
ruleSuppressed: Warn
unprocessedObject: Warn


output:
culture:
Expand Down

0 comments on commit 0eeb82a

Please sign in to comment.