Sachin built this to provision backstage for demos and tear it down once done
- Cloud Provisioning
- For Azure
- Set up a subscription
- Set up a Contributor Azure Custom Role
- az ad sp create-for-rbac --name="id-iaac-dev-centralus-001" --role="Contributor" --scopes="/subscriptions/<SUBSCRIPTION_ID>"
- For Azure
- Login to Cloud Provider
- az login
- az account set --subscription "<SUBSCRIPTION_ID>"
- az account show (ensure you are pointing at right subscription)
- Setup Environment for Terraform
- use
az_sp.sh
and create your ownlocal_az_sp.sh
filling out values to keys and then sourcesource ./scripts/local_az_sp.sh
- use
- Terraform Provision
cd environments/dev
terraform init
terraform validate
terraform plan
terraform apply
- Terraform Destroy
terraform destroy
You should see output as below
Outputs:
backstage_app = {
"details" = {
"backstage_app" = "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/rg-backstage-sandbox-001/providers/Microsoft.Web/sites/backstagedev"
"backstage_app_plan" = "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/rg-backstage-sandbox-001/providers/Microsoft.Web/serverfarms/backstagedev-plan"
"backstage_rg" = "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/rg-backstage-sandbox-001"
}
}
- az login
- az account set --subscription "<SUBSCRIPTION_ID>"
- If you want to customize for other actions, start from scratch like below and customize
- az ad sp create-for-rbac --name="id-iaac-dev-centralus-001" --role="Contributor" --scopes="/subscriptions/<SUBSCRIPTION_ID>"
- use
az_sp.sh
and create your ownlocal_az_sp.sh
filling out values to keys and then source./scripts/local_az_sp.sh
- use
az_msi.sh
and create your ownlocal_az_msi.sh
filling out values to keys and then source./scripts/local_az_msi.sh