Parallel Azure Authentication in PowerShell

Working for a Tier 1 CSP (Cloud Solution Provider), a lot of the code I produce has to “do stuff” in multiple Azure tenants/subscription in one go. This can be anything from deploying resources to getting tokens and calling APIs against multiple environments, all from the same script.

To reduce the execution runtime of my code, I often try to run things in parallel where possible.