tl;dr How to call the Azure API directly via PowerShell from within Terraform

For the most part Terraform does what I need, but there have been times where it just can’t manage some things well. For this post I am pointing at you, “azurerm_security_center_workspace”, yes, you. For the last year you’ve been annoying to deal with, like executing resource deployment for an hour before throwing your hands up in the air and giving up 😤.

This issue had been raised over a year ago, https://github.com/terraform-providers/terraform-provider-azurerm/issues/5475, and I think longer than that in other posts. …


An mini PowerShell script to retrieve interesting statistics of pull request reviews via GitHub API

TL;DR ~ A PowerShell script to print statistics of user activity of PRs by Approved, Changes_Requested, Commented or Dismissed.

The GitHub “Insights” tab in repositories is pretty good, but I’ve been more interested in finding some stats on PR reviews that I couldn’t find via Insights So lately I had been messing around with GitHub API in my spare time to see what kind of interesting information I can pull from it about Pull Requests… and thus, the following script was born!

The script is…


A collection of AWK scripts that I have built to help aid productivity on client projects. Although AWK is a powerful programming language, it is still limited to the abilities of searching text (line by line) and the structure on which it is written. Please bear in mind that the majority of these scripts rely on this, and it will vary for each client/project/file.

You can find my GitHub repo link below which contains all the scripts and examples discussed here.

WSL Users, Take Note!

For those of whom are like me that use Windows Subsystem for Linux, beware! The AWK printf function will…


This describes how to deploy a basic Ubuntu VM that can be utilised for basic egress testing in a DEV environment

It was born out of the need to replace expensive Palo Altos as a task to ensure that we have egress for some resources. Unfortunately our setup already had an Azure Firewall, and it was sitting in the same vnet that we need to swap the Palo’s out with; due to the subnet naming requirement of Azure Firewall, we couldn’t have two subnets named AzureFirewallSubnet in the same vnet, else this would have been our choice. …


For those that don’t know, Pester is an extremely simple and useful PowerShell testing tool that can easily be adapted to test if Terraform has actually deployed your resources correctly by using basic assertions; which is a whole lot easier than eyeballing each one yourself. Not only can it test what you have just deployed is correct, but it can also run on a schedule to ensure that nothing has drifted away from what the Terraform state file determines as correct. …

Paul Mackinnon

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store