Skip to content

Onboarding to Azure CAF framework

GlennChia edited this page Jul 12, 2021 · 2 revisions

The following installation steps have been tested on Windows 10. There are 2 sets of instructions

  1. Installation steps:
  2. Detailed installation steps

Installation steps

Follow the steps below and their relevant links to perform the required installations. For specific commands, refer to Detailed installation steps although the commands could be outdated. For the most up-to-date commands, you are advised to visit the respective links and retrieve the commands from there.

  1. Install the following
  2. With Chocolatey, install
  3. Install Ubuntu 20.04 from the Microsoft Store.
  4. In Docker Desktop, configure Docker WSL integration with Ubuntu 20.04
  5. Open the Ubuntu 20.04 app and generate the SSH keys that will be used for git commands. Follow Generating a new SSH key and adding it to the ssh-agent. The keys must be registered on GitHub as well
  6. [Optional] Create directories following the path ~/git/github.com/aztfmod where repositories are cloned in aztfmod
  7. Open the Ubuntu 20.04 app and clone the repo into the ~/git/github.com/aztfmod directory. Link to the aztfmod/terraform-azurerm-caf repo
  8. Change directory to the repository's code and open Visual Studio Code from there with code .
  9. Install the Remote Development extension on VS code. This can be done directly in VS code. Alternatively, follow VisualStudio Marketplace - Remote Development
  10. Use the Remote Development Extension to Reopen in in Container. It then shows Dev Container: Azure CAF module. Verify that Terraform and Azure CLI are installed
  11. In the container terminal, login to Azure CLI with az login

Detailed installation steps

  1. Install the following

    • Chocolatey. Open Windows PowerShell as Administrator. This is done by searching Windows PowerShell, right clicking the icon, and selecting Run as administrator. Once opened, run the following command:
      Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    • WSL2. Note that only certain systems support WSL2 and it is recommended to check if your system is compatible at the reference link. If it is, open Windows PowerShell as Administrator and run the following commands:
      # Enable the Windows Subsystem for Linux
      dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
      # To update to WSL 2, wait to restart your machine and move on to the next step.
      # Enable the Virtual Machine feature
      dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
      # Restart your machine to complete the WSL install and update to WSL 2.
      # download and install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
      # Set WSL 2 as your default version
      wsl --set-default-version 2
  2. With Chocolatey, install

  3. Install Ubuntu 20.04 from the Microsoft Store.

  4. In Docker Desktop, configure Docker WSL integration with Ubuntu 20.04

  5. Open the Ubuntu 20.04 app and generate the SSH keys that will be used for git commands. Follow Generating a new SSH key and adding it to the ssh-agent. The keys must be registered on GitHub as well

  6. [Optional] Create directories following the path ~/git/github.com/aztfmod where repositories are cloned in aztfmod

  7. Open the Ubuntu 20.04 app and clone the repo into the ~/git/github.com/aztfmod directory. Link to the aztfmod/terraform-azurerm-caf repo.

    # option 1: git clone via ssh (if using this instruction guide)
    git clone git@github.com:aztfmod/terraform-azurerm-caf.git
    # option 2: git clone via https
    git clone https://github.com/aztfmod/terraform-azurerm-caf.git
  8. Change directory to the repository's code and open Visual Studio Code from there with code .

  9. Install the Remote Development extension on VS code. This can be done directly in VS code. Alternatively, follow VisualStudio Marketplace - Remote Development

  10. At this stage, the bottom left hand corner shows WSL: Ubuntu-20.04

  11. Click WSL: Ubuntu-20.04 and use the Remote Development Extension to Reopen in in Container. This step might take a few minutes because it pulls images from Docker Hub

  12. This step It then shows Dev Container: Azure CAF module.

  13. Verify that Terraform and Azure CLI are installed by running the following:

    terraform
    az
  14. Login to Azure CLI

    # Login
    az login
    # Verify successful login
    az account show
Clone this wiki locally