-
Notifications
You must be signed in to change notification settings - Fork 709
Onboarding to Azure CAF framework
The following installation steps have been tested on Windows 10. There are 2 sets of instructions
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.
- Install the following
- With Chocolatey, install
- Install Ubuntu 20.04 from the Microsoft Store.
- In Docker Desktop, configure Docker WSL integration with Ubuntu 20.04
- 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
- [Optional] Create directories following the path
~/git/github.com/aztfmod
where repositories are cloned inaztfmod
- 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 - Change directory to the repository's code and open Visual Studio Code from there with
code .
- Install the Remote Development extension on VS code. This can be done directly in VS code. Alternatively, follow VisualStudio Marketplace - Remote Development
- Use the Remote Development Extension to
Reopen in in Container
. It then showsDev Container: Azure CAF module
. Verify that Terraform and Azure CLI are installed - In the container terminal, login to Azure CLI with
az login
-
Install the following
-
Chocolatey. Open
Windows PowerShell
as Administrator. This is done by searchingWindows PowerShell
, right clicking the icon, and selectingRun 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
-
Chocolatey. Open
-
With Chocolatey, install
-
Docker Desktop
choco install docker-desktop
-
Visual Studio Code
choco install vscode
-
Docker Desktop
-
Install Ubuntu 20.04 from the Microsoft Store.
-
In Docker Desktop, configure Docker WSL integration with Ubuntu 20.04
-
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
-
[Optional] Create directories following the path
~/git/github.com/aztfmod
where repositories are cloned inaztfmod
-
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
-
Change directory to the repository's code and open Visual Studio Code from there with
code .
-
Install the Remote Development extension on VS code. This can be done directly in VS code. Alternatively, follow VisualStudio Marketplace - Remote Development
-
At this stage, the bottom left hand corner shows
WSL: Ubuntu-20.04
-
Click
WSL: Ubuntu-20.04
and use the Remote Development Extension toReopen in in Container
. This step might take a few minutes because it pulls images from Docker Hub -
This step It then shows
Dev Container: Azure CAF module
. -
Verify that Terraform and Azure CLI are installed by running the following:
terraform az
-
Login to Azure CLI
# Login az login # Verify successful login az account show