-
You have several options from where to run the automated deployment:
- Local deployments: Open a shell on your local machine (Works on a Unix based system (i.e. MacOS, Linux, Cygwin, or Windows Subsystem for Linux)).
- VM deployment: Connect to your VM using an SSH client.
- Cloud Shell deployment: From your Azure Portal, open your Cloud Shell (
>_
button in top bar).
(Note: Cloud Shell comes pre-installed with Terraform 0.12 which is now compatible with our scripts.)
-
Install the following software on your deployment machine as needed (not required for deployments on Cloud Shell):
(Note: The scripts have been tested with Terraform
v0.12.12
and Ansible2.8
) -
Install the Azure Command-Line Interface (CLI) (If required)
-
Log into your Azure subscription:
az login
-
Create a service principal that will be used to manage Azure resources on your behalf:
az ad sp create-for-rbac --name <service-principal-name>
(Note: You can find additional information on creating service principals on this page.)
-
You will see an output similar to this:
"appId": "<service-principal-app-id>", "displayName": "<service-principal-name>", "name": "http://<service-principal-name>", "password": "<service-principal-password>", "tenant": "<service-principal-tenant-id>" }
-
Set the details of the service principal as environment variables:
# configure service principal for Terraform on Linux/MacOS export ARM_SUBSCRIPTION_ID='<azure-subscription-id>' export ARM_CLIENT_ID='<service-principal-app-id>' export ARM_CLIENT_SECRET='<service-principal-password>' export ARM_TENANT_ID='<service-principal-tenant-id>'
# configure service principal for Terraform on Windows SETX ARM_SUBSCRIPTION_ID <azure-subscription-id> SETX ARM_CLIENT_ID <service-principal-app-id> SETX ARM_CLIENT_SECRET <service-principal-password> SETX ARM_TENANT_ID <service-principal-tenant-id>
(Note: While you set the environment variables every time, the recommended way is to create a file
set-sp.sh
orset-sp.cmd
and copy the above contents into it; this way, you can just run the script by executingsource set-sp.sh
orset-sp.cmd
.)