Azure Citadel
  • Blogs

  • ARM
  • Azure Arc
    • Overview
    • Azure Arc-enabled Servers
      • Prereqs
      • Scenario
      • Hack Overview
      • Azure Landing Zone
      • Arc Pilot resource group
      • Azure Monitoring Agent
      • Additional policy assignments
      • Access your on prem VMs
      • Create onboarding scripts
      • Onboarding using scripts
      • Inventory
      • Monitoring
      • SSH
      • Windows Admin Center
      • Governance
      • Custom Script Extension
      • Key Vault Extension
      • Managed Identity
    • Azure Arc-enabled Kubernetes
      • Prereqs
      • Background
      • Deploy Cluster
      • Connect to Arc
      • Enable GitOps
      • Deploy Application
      • Enable Azure AD
      • Enforce Policy
      • Enable Monitoring
      • Enable Azure Defender
      • Enable Data Services
      • Enable Application Delivery
    • Useful Links
  • Azure CLI
    • Install
    • Get started
    • JMESPATH queries
    • Integrate with Bash
  • Azure Landing Zones
    • Prereqs
    • Day 1
      • Azure Baristas
      • Day 1 Challenge
    • Day 2
      • Example
      • Day 2 Challenge
    • Day 3
      • Day 3 Challenge
    • Useful Links
  • Azure Policy
    • Azure Policy Basics
      • Policy Basics in the Azure Portal
      • Creating Policy via the CLI
      • Deploy If Not Exists
      • Management Groups and Initiatives
    • Creating Custom Policies
      • Customer scenario
      • Policy Aliases
      • Determine the logic
      • Create the custom policy
      • Define, assign and test
  • Azure Stack HCI
    • Overview
    • Useful Links
    • Updates from Microsoft Ignite 2022
  • Marketplace
    • Introduction
      • Terminology
      • Offer Types
    • Partner Center
    • Offer Type
    • Publish a VM Offer HOL
      • Getting Started
      • Create VM Image
      • Test VM Image
      • VM Offer with SIG
      • VM Offer with SAS
      • Publish Offer
    • Other VM Resources
    • Publish a Solution Template HOL
      • Getting Started
      • Create ARM Template
      • Validate ARM Template
      • Create UI Definition
      • Package Assets
      • Publish Offer
    • Publish a Managed App HOL
      • Getting Started
      • Create ARM Template
      • Validate ARM Template
      • Create UI Definition
      • Package Assets
      • Publish Offer
    • Managed Apps with AKS HOL
    • Other Managed App Resources
    • SaaS Offer HOLs
    • SaaS Offer Video Series
      • Video 1 - SaaS Offer Overview
      • Video 2 - Purchasing a SaaS Offer
      • Video 3 - Purchasing a Private SaaS Plan
      • Video 4 - Publishing a SaaS Offer
      • Video 5 - Publishing a Private SaaS Plan
      • Video 6 - SaaS Offer Technical Overview
      • Video 7 - Azure AD Application Registrations
      • Video 8 - Using the SaaS Offer REST Fulfillment API
      • Video 9 - The SaaS Client Library for .NET
      • Video 10 - Building a Simple SaaS Landing Page in .NET
      • Video 11 - Building a Simple SaaS Publisher Portal in .NET
      • Video 12 - SaaS Webhook Overview
      • Video 13 - Implementing a Simple SaaS Webhook in .NET
      • Video 14 - Securing a Simple SaaS Webhook in .NET
      • Video 15 - SaaS Metered Billing Overview
      • Video 16 - The SaaS Metered Billing API with REST
  • Microsoft Fabric
    • Theory
    • Prereqs
    • Fabric Capacity
    • Set up a Remote State
    • Create a repo from a GitHub template
    • Configure an app reg for development
    • Initial Terraform workflow
    • Expanding your config
    • Configure a workload identity
    • GitHub Actions for Microsoft Fabric
    • GitLab pipeline for Microsoft Fabric
  • Packer & Ansible
    • Packer
    • Ansible
    • Dynamic Inventories
    • Playbooks & Roles
    • Custom Roles
    • Shared Image Gallery
  • Partner
    • Lighthouse and Partner Admin Link
      • Microsoft Cloud Partner Program
      • Combining Lighthouse and PAL
      • Minimal Lighthouse definition
      • Using service principals
      • Privileged Identity Management
    • Useful Links
  • REST API
    • REST API theory
    • Using az rest
  • Setup
  • Terraform
    • Fundamentals
      • Initialise
      • Format
      • Validate
      • Plan
      • Apply
      • Adding resources
      • Locals and outputs
      • Managing state
      • Importing resources
      • Destroy
    • Working Environments for Terraform
      • Cloud Shell
      • macOS
      • Windows with PowerShell
      • Windows with Ubuntu in WSL2
    • Using AzAPI
      • Using the REST API
      • azapi_resource
      • Removing azapi_resource
      • azapi_update_resource
      • Data sources and outputs
      • Removing azapi_update_resource
  • Virtual Machines
    • Azure Bastion with native tools & AAD
    • Managed Identities

  • About
  • Archive
  1. Home
  2. Setup

Table of Contents

  • GitHub
  • MacOS or Linux
  • Windows 10 / 11
  • Binaries
  • Azure CLI
  • Windows Terminal
  • Visual Studio Code
  • Visual Studio Code Extensions
  • Terraform
  • Packer
  • Ansible
  • PowerShell

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.

  • Join GitHub if you don’t have an ID already
  • Make sure you have the GitHub CLI installed

Check you can login with gh auth login and gh auth status.

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.

  • Install Windows Subsystem for Linux

    Run as Administrator.

    wsl --install
    

    You will be guided to set up a local admin ID and password.

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.

  • Install Windows Terminal

    Refer to the [Windows Terminal documentation] if you wish to customise.

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

  • Install additional extensions

    Use the shortcodes to quickly find the right extension. Some will install into the front end and some directly into WSL.

    Extension Shortcode
    Azure Account ms-vscode.azure-account
    Azure Resource Manager tools msazurermtools.azurerm-vscode-tools
    Hashicorp Terraform hashicorp.terraform
    JSON Tools eriklynd.json-tools

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.

  • Install PowerShell & the Az module