In this post I’ll show you how to setup Workload Identity in an AKS cluster using terraform and then deploy a pod with Azure CLI that you will use to login to Azure.
Long story short: once workload identity is configured and enabled, kubernetes will inject 3 environment variables needed to login with Azure CLI:
I’ve been using Ansible and the Azure CLI every single day for the last 3 months. Non stop work editing playbooks and scripts with Visual Studio Code and running them on Ubuntu (WSL) on my Windows 10 machine.
Turns out that because Ansible uses python version 2.7.12 and the Azure CLI uses python 3.6.5 you can make a mess if you get “creative” trying to install the tools instead of using the recommended commands:
When you try to deploy a VM from the Marketplace using an ARM (json) template you’ll get an error like the one below in the case when you’ve not previously accepted the Legal terms for the image:
[{"Legal terms have not been accepted for this item on this subscription. To accept terms using Powershell..."}] Accepting the Legal terms is something you have to do once per subscription for each provider offer you want to use. So how can you accept the terms using the Azure CLI (version 2.0.26 or higher)?