Set Up Azure using Automation Toolkit with CLI
High Level Steps to use toolkit with CLI
-
Login to the CD3 Container.
-
Check out CD3 Workflows document for workflows supported by the toolkit and choose the required workflow.
-
Use Azure excel template from Excel Templates based on your requirement.
-
Review
setUpAzure.properties
file:/cd3user/azure/<prefix>/<prefix>_setUpAzure.properties
.
setUpAzure.properties
[Default]
#Input variables required to run setUpAzure script
#path to output directory where terraform file will be generated. eg /cd3user/azure/<prefix>/terraform_files
outdir=
#prefix for output terraform files eg demo
prefix=
# Auth Params
subscription_id=
tenant_id=
client_id=
client_secret=
#path to cd3 excel eg /cd3user/azure/<prefix>\CD3-Customer.xlsx
cd3file=
#specify create_resources to create new resources in Azure(greenfield workflow)
#specify export_resources to export resources from Azure(non-greenfield workflow)
workflow_type=create_resources
Parameter Description
Variable | Description | Example |
---|---|---|
outdir | Path to output directory where terraform files will be generated | /cd3user/azure/demo/terraform_files |
prefix | Prefix for output terraform files | demo |
subscription_id | <azure subscription id | 155d83b2-....-....-....-ff5455dc5bdc |
tenant_id | azure subscription tenant id | 89b6314d-....-....-....-0c37ec95f20e |
client_id | service principal appid | 6950d59b-....-....-....-0039be18d7df |
client_secret | service principal password | .1..8Q~Xtch...........L5LxiPWb2vd_oaOP |
cd3file | Path to the Excel input file | /cd3user/azure/demo/CD3demo.xlsx |
workflow_type | Create Resources in Azure or Export Resources from Azure | create_resources or export_resources |
Copy CD3 Excel File
-
While using the container launched using RM Stack, local path
/cd3user/mount_path
on the VM is mapped to/cd3user/
inside the container. So the Excel template can be copied at/cd3user/mount_path/azure/<prefix>/
on the VM. Below is the sample command to copy the Excel template from local system to container: -
Note that the user
cd3user
can be used to connect to the VM because same key is pushed foropc
as well ascd3user
.