Skip to content

Instantly share code, notes, and snippets.

@alancoleman
Last active June 4, 2024 14:55
Show Gist options
  • Save alancoleman/5f7f0dba33637070523a86cecc18f2e7 to your computer and use it in GitHub Desktop.
Save alancoleman/5f7f0dba33637070523a86cecc18f2e7 to your computer and use it in GitHub Desktop.
Install Terraform (Ubuntu) and connect to Azure
# Start by installing Terraform on Ubuntu
# The best way to do this is by following the install instructions on the Hashicorp developer site
# https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
# Hashicorp advise authenticating using the Azure CLI when running Terraform locally
# Install the Azure CLI
# https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Login to Azure. Authentication will be via a browser
az login
# Display and choose an Azure Tennant and subscription
az account list
# Once selected show Azure Tennant and subscription currently in use
az account show
# Add some Terraform files to the working directory and run Terraform init
terraform init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment