Select Page

More Kusto – The Everything Script

“The get everything about virtual machines” script.

This brings back pretty much everything – sub second queries. Far, far easier than the old methods using PowerShell.

Resources

| where type =~ ‘microsoft.compute/virtualmachines’

| extend nics=array_length(properties.networkProfile.networkInterfaces)

| mv-expand nic=properties.networkProfile.networkInterfaces

| where nics == 1 or nic.properties.primary =~ ‘true’ or isempty(nic)

| project subscriptionId, resourceGroup, vmId = id, vmName = name, vmSize=tostring(properties.hardwareProfile.vmSize), nicId = tostring(nic.id),location, tags.itowner, tags.businessowner, tags.application, tags.costcenter, tags.supportgroup, tags.[‘project’], powerstate=properties.extended.instanceView.powerState.displayStatus, os=properties.storageProfile.osDisk.osType, sku=properties.storageProfile.imageReference.sku

| join kind=leftouter (ResourceContainers | where type==’microsoft.resources/subscriptions’ | project SubName=name, subscriptionId) on subscriptionId

| join kind=leftouter (

  Resources

  | where type =~ ‘microsoft.network/networkinterfaces’

  | extend ipConfigsCount=array_length(properties.ipConfigurations)

  | mv-expand ipconfig=properties.ipConfigurations

  | where ipConfigsCount == 1 or ipconfig.properties.primary =~ ‘true’

  | project nicId = id, privIP = tostring(ipconfig.properties.privateIPAddress)) on nicId

| project-away subscriptionId, subscriptionId1, vmId, nicId, nicId1

COVID – week 50 – Feb 22 – Feb 28 2021

Saturday – huge demand for vaccinations; this story from Portland, OR describing how 400,000 attempts to book for 3,400 slots. Washington State at around 13% first vaccination, UK is at just under 30% of the population having at least one dose. That reaches almost 40% in Wales. That’s actually quite the testament to the role of the NHS.

Track and Trace (contact tracing) is partially working, depending on location. Great results in New Zealand, missed contacts in England (with a possible Brazil variant escaped into the wild), unknown results in the US.

image

Usual weekend state of the State from The Seattle Times. Positive test rate is steady at around 5.4% – still a good way to go to below 2% trend.

Friday – next week I will start the “one year ago” retrospectives. The first cases of COVID in the US were in Washington State, first identified in late January. The first death was 29 February.

Thursday – reluctance over taking the AstraZeneca vaccine.

Wednesday – J&J single shot vaccine approved

Tuesday – >112M global cases, >2.5M global deaths.

Monday – officially 500,000 deaths due to Covid in the US.

The Guardian The Seattle Times
22 Feb here here
23 Feb here here
24 Feb here here
25 Feb here here
26 Feb here here
27 Feb here here
28 Feb here here

https://www.theguardian.com/world/series/coronavirus-live

https://www.seattletimes.com/tag/coronavirus/

Hands off keyboards! Automation and metadata validation

Sigh.

Tag taxonomy cleanup.

Another great example of “hands off keyboards” and needing to deliver via automation. Avoid errors, enforce validation of metadata.

image

Azure Resource Graph explorer – find the scope and scale of the problem. I’ll add the usual gripe around tags being case sensitive in some places (API, PowerShell) and not in others (Azure Portal!).

Resources

| where tags.businesowner != ”

| project name, subscriptionId, resourceGroup, tags.businessowner, tags.businesowner

COVID – week 49 – Feb 15 – Feb 21 2021

Weekend – half a million dead in the US.

Usual weekly update from The Seattle Times. Positive rates are down, folk are becoming complacent again. Continued discussion on back to school.

Friday – another variant in Japan, it’s a race. Dr Fauci says “back to normal by Christmas”.

Thursday – AstraZeneca vaccine reluctance. Rich/Poor divide on vaccine distribution.

Wednesday – Washington State daily cases below 600 for the first time in many months. Daily positive tests down to 6.5%. 10.7% of population have had first vaccine shot. Vaccine production is now the bottleneck. It’s a race against variants/mutations.

Tuesday – more mutations, one of these could be the escapee and massive impact. Real concern that antibiotic use during COVID is accelerating the risk of AMR.

Monday – we’re going to see a lot of “this time last year” posts in the media. Between late January 2020 and late February there was news coverage about the first case in the US – and increasing concern in China and across SE Asia about spread. My post from mid-March 2020 describing this time. Still in the office at that point.

The Guardian The Seattle Times
15 Feb here here
16 Feb here here
17 Feb here here
18 Feb here here
19 Feb here here
20 Feb here here
21 Feb here here

https://www.theguardian.com/world/series/coronavirus-live

https://www.seattletimes.com/tag/coronavirus/

COVID – week 48 – Feb 8 – Feb 14 2021

Weekend – cases declining in Washington State, positive rate is relatively stable at just under 8%.

US Daily reported cases below 100k/day for the first time since the end of October 2020. Data from JHU.

image

Weekend numbers from The Seattle Times.

Friday – UK hits 21% of population with at least one vaccine shot.

image

Thursday – WHO continue to search for the origin of this coronavirus. 600M vaccines by July for US. Population should be vaccinated by summer.

Wednesday – as vaccines continue to be rolled out, counties, countries are starting to open back up.

Tuesday – “Wuhan lab leak” unlikely to be source of coronavirus. Continued border closures as governments try to extinguish spread.

Monday – UK variant of COVID-19 is rapidly spreading in the US. Slowly vaccines are getting delivered.

TheGuardian The Seattle Times
8 Feb here here
9 Feb here here
10 Feb here here
11 Feb here here
12 Feb here here
13 Feb here here
14 Feb here here

https://www.theguardian.com/world/series/coronavirus-live

https://www.seattletimes.com/tag/coronavirus/

More Kusto – Azure Backup reporting

Using KQL against Azure Resource Graph; and here’s another useful snippet – it’s faster by far than PowerShell, subsecond result set.

RecoveryServicesResources

| join kind=leftouter (ResourceContainers | where type==’microsoft.resources/subscriptions’ | project SubName=name, subscriptionId) on subscriptionId

| where type == “microsoft.recoveryservices/vaults/backupjobs”

| where properties.backupManagementType == “AzureIaasVM”

| extend rsg = replace(“;[[:graph:]]*”, “”, replace(“iaasvmcontainerv2;”,””,tostring(properties.containerName)))

| extend vmname = tolower(tostring(properties.entityFriendlyName))

| extend rsvault = tolower(replace(“/[[:graph:]]*”,””, replace(“[[:graph:]]*\\/vaults\\/”,””,id)))

| extend backupage = datetime_diff(‘day’, now(), todatetime(properties.endTime))

| project SubName, rsg, vmname, rsvault, properties.operationCategory, properties.status, backupage