Skip to content

Commit

Permalink
Fix #21 - Change filter to dropdown (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
webtonize authored Jan 6, 2024
1 parent b0f7a04 commit 29ba20b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/bicep/modules/azdo-resources-by-rule.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,29 @@ var workbook = {
id: '3f1e834c-9a51-41b3-aa49-88a8834e7aba'
version: 'KqlParameterItem/1.0'
name: 'ruleName'
type: 1
label: 'Rule Name'
type: 2
isRequired: true
multiSelect: true
quote: '\''
delimiter: ','
query: 'PSRule_CL\r\n| summarize by DisplayName_s'
typeSettings: {
additionalResourceOptions: [
'value::all'
]
selectAllValue: 'All Rules'
showDefault: false
}
timeContext: {
durationMs: 86400000
}
defaultValue: 'value::all'
queryType: 0
resourceType: 'microsoft.operationalinsights/workspaces'
}
]
style: 'pills'
style: 'above'
queryType: 0
resourceType: 'microsoft.operationalinsights/workspaces'
}
Expand All @@ -37,7 +53,7 @@ var workbook = {
type: 3
content: {
version: 'KqlItem/1.0'
query: 'PSRule_CL\r\n| where DisplayName_s == \'{ruleName}\' or \'All Rules\' == \'{ruleName}\'\r\n| where TimeGenerated >= datetime_add(\'day\', -1, now())\r\n| extend a=parse_json(Annotations_s), f=parse_json(Field_s)\r\n| extend [\'Resource Id\']=f.id, Severity=a.severity, [\'Rule Help Url\']=a.[\'online version\'],Category=a.category\r\n| extend severity_level = case(\r\n Severity == "Informational" and Outcome_s == \'Fail\', 1,\r\n Severity == "Important" and Outcome_s == \'Fail\', 2,\r\n Severity == "Severe" and Outcome_s == \'Fail\', 3,\r\n Severity == "Critical" and Outcome_s == \'Fail\', 4,\r\n 0)\r\n| project [\'Resource FQN\']=TargetName_s, [\'Outcome\']=Outcome_s\r\n| sort by Outcome asc'
query: 'PSRule_CL\r\n| where DisplayName_s in ({ruleName}) or \'All Rules\' in ({ruleName})\r\n| where TimeGenerated >= datetime_add(\'day\', -1, now())\r\n| extend a=parse_json(Annotations_s), f=parse_json(Field_s)\r\n| extend [\'Resource Id\']=f.id, Severity=a.severity, [\'Rule Help Url\']=a.[\'online version\'],Category=a.category\r\n| extend severity_level = case(\r\n Severity == "Informational" and Outcome_s == \'Fail\', 1,\r\n Severity == "Important" and Outcome_s == \'Fail\', 2,\r\n Severity == "Severe" and Outcome_s == \'Fail\', 3,\r\n Severity == "Critical" and Outcome_s == \'Fail\', 4,\r\n 0)\r\n| project [\'Resource FQN\']=TargetName_s, [\'Outcome\']=Outcome_s\r\n| sort by Outcome asc'
size: 0
timeContext: {
durationMs: 86400000
Expand Down

0 comments on commit 29ba20b

Please sign in to comment.