In the last post we went through setting up a log workspace and setting up diagnostic setting to send data to the workspace.
In this post we will be going through using the different KQL operators
First we will use the search operator to return all data in the log workspace, this can be useful when trying to find a the table we want to query or see specific event type.
search *
If we want to return specific number for of rows but not in specific order we can use take 10
Table
|take 10
To return a list of unique values in a column we can use distinct.
Table
| distinct AppDisplayName
To select multiple rows we can use the or operator
Table
| where colume_name contains "value" or colume_name contains "value" Signup Portal"
| project value1, value2
To order the data we can use order by
Table
| where colume_name contains "value" or colume_name contains "value" Signup Portal"
| order by type
| project value1, value2
To return the first set to rows we can use top
Table
| top 10 by colume_name
| project value1
To return data between a specific date and time we can use the between operator
Table
| where TimeGenerated between (datetime(2023-08-14T19:12:00) .. datetime(2023-08-15T19:12:00))
In the next post we will go through Query and Structure Data, as well as creating data in visualizing data in charts using the render operator.
In this post we will be going through the process of migrating a VM in to an availability zone.
Azure availability zones are designed to help with availability for business-critical workloads. Using availability zone allow VMs to be replicated to different datacenter within the same Azure region.
There is not currently an easy process to move a VM in to an availability zone as this needs to be configured when the VM is originally deployed.
The process to migrate does required down time for the VM as we will need to snapshot the VM, create new disks from the snapshot and deploy in to an availability zone.
We will be using PowerShell to create a snapshot of the existing VM disks , create the new disks from the snapshots and create a new VM using the existing VM config.
I will be doing this on test VM with no live data but for an live server make sure to have a full backup as we will be deleting the VM and use the existing configuration to recreate the VM with disk in the availability zone.
I created a test VM call SAZTest with one data disk, that is not in an availability zone.
First we need to connect to AZ PowerShell and select the correct subscription if there are multiple.
Next we get the VM that we will create a snapshot of the disk. We will be using the $vm variable to get the disk and for recreating the VM later to keep the existing configuration.