Setup

Getting an Azure subscription is a good start. Then you can run through this page to set up your laptop ready for many of the labs on the Citadel site.

GitHub

If you do not have a GitHub ID already then sign up.

MacOS or Linux

If you are working on MacOS or a Linux distro then you can just use Bash in your preferred terminal. Skip the WSL step and install the binaries.

Windows 10 / 11

We recommend using the Windows Subsystem for Linux (WSL) and installing the binaries into linux rather than at the Windows OS level. This page assumes that you will take that route.

If your personal preference is to work within Windows and to use PowerShell then we understand. You can install both git and az at the OS level instead and then skip to vscode. However you should be aware that you won’t be able to use some of the examples in the labs as they are based on Ubuntu 22.04 running in WSL and use pipelines in Bash.

Binaries

  • Install

    • git
    • jq
    • tree
    • stress

    E.g., for Ubuntu/Debian:

    sudo apt update && sudo apt install jq git tree stress
    
  • Checks

    git
    jq --help
    tree ~
    stress
    

    You may want to add export JQ_COLORS="1;90:0;35:0;35:0;91:0;33:1;37:1;37" to your ~/.bashrc file to improve the colours.

Azure CLI

  • Install the Azure CLI

  • Checks:

    az version
    az login
    az account show --output jsonc
    az account show --output json | jq -r .user.name
    

Windows Terminal

For standard CLI use we favour the Windows Terminal on Windows. It will pick up on all of your WSL distros as well as creating profiles for Command Prompt, PowerShell and Cloud Shell.

Visual Studio Code

Visual Studio Code (vscode) is assumed as our default IDE.

  • Install Visual Studio Code
  • Install the Remote Development extension pack
    • Open extensions (CTRL+SHIFT+X)
    • Search ms-vscode-remote.vscode-remote-extensionpack
    • Install
  • Checks
    • Open Ubuntu in Windows Terminal

    • Open vscode for the current directory

      code .
      

      The vscode engine will be automatically downloaded upon first run, and then Visual Studio Code will open on the desktop.

    • Is “WSL: <distro>” shown at the bottom left?

    • Open Source Control (CTRL+SHIFT+G)

    • Click on the ellipsis () on the Source Control sidebar

    • Click on Show Git Output

    • Does the top of the output look similar to this?

      [info] Log level: Info
      [info] Validating found git in: "git"
      [info] Using git "2.34.1" from "git"
      

Visual Studio Code Extensions

Terraform

  • Install Terraform

  • Check:

    terraform --version
    

Packer

Only required for the virtual machine imaging labs.

  • Install Packer

  • Check:

    packer --version
    

Ansible

Ansible is used in a few of the labs. As per the Ansible docs, Ansible on Azure is installed using the Python installer, pip. It is preinstalled in the Cloud Shell’s container image.

  • Install PIP

    sudo apt update && sudo apt install -y python3-pip
    
  • Install Ansible

    pip3 install ansible[azure]
    

The remaining steps are option if you are familiar with Ansible and wish to configure it yourself. If you would like a default config then feel free to continue.

  • Create the ansible config file and directory structure

    umask 022
    
    cat << ANSIBLE_CFG > ~/.ansible.cfg
    [defaults]
    inventory = ~/ansible/hosts
    roles_path = ~/ansible/roles
    deprecation_warnings=False
    nocows = 1
    ANSIBLE_CFG
    
    mkdir -pm 755 ~/ansible/roles && cd ~/ansible
    
    cat << ANSIBLE_HOSTS > ~/ansible/hosts
    [localhost]
    127.0.0.1
    
    ANSIBLE_HOSTS
    
  • Install the Ansible collection for Azure

    ansible-galaxy collection install azure.azcollection
    
  • Install Azure modules

    wget https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt
    sudo pip3 install -r requirements-azure.txt
    

PowerShell

Most of this site has a slight bias towards OSS technologies rather than traditional Windows Server and PowerShell. Most Linux users will prefer to use the Azure CLI. Having said that, it is always useful to have the PowerShell Az module installed as there are some operations that can only be achieved with PowerShell cmdlets. The good news is that PowerShell and the PowerShell Az module are cross platform.


Help us improve

Azure Citadel is a community site built on GitHub, please contribute and send a pull request

 Make a change