Monitoring Azure Resources for Version Compliance Using Azure Workbooks and KQL
Compliance isn’t just about ticking boxes; it’s about safeguarding your cloud environment with the latest versions and updates
Lack of Centralized Version Compliance Monitoring Across Azure Resources
When the customer approached us, they were dealing with inefficient monitoring processes, increased operational costs, and difficulty ensuring version compliance, which affected their overall cloud governance and security.
Our recommendation/solution
We will discuss how we developed the version compliance monitoring solution using Azure Workbooks and KQL, explaining how it helped the customer automate tracking, ensure governance, and address their challenges with outdated resources and high operational costs.
Pre-requisites for the Set-Up
Before we implemented the solution, the following pre-requisites were already in place:
Manual monitoring is a thing of the past—real-time dashboards provide the visibility you need, when you need it.
Solution Implementation Steps
Step 1: Creating the Azure Workbook
We started by creating a new Azure Workbook to act as a centralized dashboard for version compliance. Using the Azure Portal, we navigated to Azure Monitor > Workbooks, and created a new workbook.
From there, we began customizing it by clicking on the Edit button and adding a new Query tile.
Step 2: Implementing the KQL Query
To fetch and compare resource versions, we implemented the following KQL query within the workbook:
领英推荐
Resources
| join kind=inner (
resourcecontainers
| where type == 'microsoft.resources/subscriptions'
| project subscriptionId, subscriptionName = name)
on subscriptionId
| where type in ({ResourceType})
| extend currentversion = case(tags['iac-version'] == "", tags['powered-by'],
tags['iac-version'])
| extend latestversion =
case(
type == 'microsoft.keyvault/vaults', 'v1.0.0,v1.1.0',
type == 'microsoft.containerservice/managedclusters', 'v1.3.0,v1.4.0',
type == 'microsoft.web/serverfarms', 'v2.0.0,v2.1.0,v2.1.1',
type == 'microsoft.sql/servers', 'v2.7.0,',
type == 'microsoft.sql/managedinstances', 'v2.7.0',
type == 'microsoft.dbforpostgresql/flexibleservers', 'v2.4.0',
type == 'microsoft.containerregistry/registries', 'v1.2.0',
type == 'microsoft.storage/storageaccounts', 'v1.3.0',
type == 'microsoft.compute/virtualmachines', 'v1.3.0',
type == 'microsoft.datafactory/datafactories', 'v1.1.0',
type == 'microsoft.cache/redis', 'v1.0.0,v1.1.0',
type == 'microsoft.insights/workbooks', 'v1.1.0',
'DefaultConstantValue'
)
| extend status = case(
latestversion contains (currentversion), 'Compliant',
'Non-Compliant'
)
| where status in ({status02})
| project subscriptionId, subscriptionName,type, name,currentversion,latestversion, status
This query pulls resource data and matches each resource’s current version (based on tags) with the latest version available. It then checks whether each resource is compliant or non-compliant based on this comparison, displaying the results in real time.
Automation doesn’t just save time; it ensures accuracy and scalability in managing compliance
We then added dynamic filters to enhance the interactivity of the workbook. These filters allowed users to:
Results and Benefits
By implementing this solution, we delivered the following key benefits to the customer:
CloudifyOps successfully implemented a real-time, automated version compliance monitoring solution using Azure Workbooks and KQL. By centralizing version tracking across subscriptions, the customer gained visibility into their Azure environment, improved governance, and significantly reduced operational costs.
This blog highlights how we helped the customer solve their compliance challenges, making their infrastructure more secure and easier to manage.
References:
Immediate Joiner|| AWS, Linux, Maven, Tomcat, Git Python, Jenkins , Terraform, Dockers, Managing, Kubernetes Cluster|| Ansible ||Prometheus and Grafana
2 个月Very informative