Overview
Here is a high level diagram of how Mage interacts with various Azure resources deployed using this Terraform template.
Pre-requisites
- Download Mage maintained Terraform templates.
1. Install Azure CLI
Follow these instructions to install the Azure CLI on your workstation.2. Log into Azure from CLI
If you don’t already have an account in Azure, create one here. Once you created an account, from your terminal run the following command to log in:3. Customize Terraform settings
Storage account name (REQUIRED) Thestorage_account_name must be unique globally. Before running any Terraform
commands, please change the default value of variable named
storage_account_name in the
./azure/variables.tf
file.
key_vault_name must be unique globally. Before running any Terraform
commands, please change the default value of variable named key_vault_name
in the
./azure/variables.tf
file.
default value under app_name:
default value under docker_image:
Custom Docker imagesIf you previously tagged a Docker image you built when following this
CI/CD guide, you must push that locally tagged Docker image
to Azure Container Registry before deploying using Terraform.
location value under resource_group:
More
Other variables defined in ./azure/variables.tf can also be customized to your needs.Environment variables for application
Set your environment variables in your running cloud environment by adding the following under the resource namedazurerm_container_group in the file
./azure/main.tf:
4. Deploy
-
Change directory into scripts folder:
-
Initialize Terraform
A sample output could look like this:
Terraform plan
You can run the following command to see all the resources that will be created by Terraform:terraform planBy default, here are the resources that will be created. -
Deploy
A sample output could look like this:
-
In your browser, go to
http://[IP_address]/.Change theIP_addressto the IP address that was output in your terminal after successfully runningterraform apply.
Updating Mage versions
After Mage is running in your cloud, you can update the Mage Docker image version by running the following command in your CLI tool:Misc
Security
By default,terraform apply will attempt to add your current workstation’s IP
address to the above mentioned security group.
In order to access Mage on Azure from another local workstation, you must add
that IP address to the security group named
mage-data-prep-production-nsg-public.
Security group name Your security group might be named differently because you may have changed your virtual network name (e.g.app_name). The security group you must add the IP to will end with-nsg-public.