From d2e30a6870edc6c26504406d9b1be9ab4fe7c699 Mon Sep 17 00:00:00 2001 From: Noel Bundick Date: Thu, 23 May 2019 14:17:52 -0700 Subject: [PATCH 1/2] Call out user-configurable options as Bash vars --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4db54c0..bc158ca 100644 --- a/README.md +++ b/README.md @@ -57,11 +57,17 @@ az group create -n $TF_BACKEND_RG -l westus2 az storage account create -g $TF_BACKEND_RG -n $TF_BACKEND_STORAGE --sku Standard_LRS az storage container create -n terraform --account-name $TF_BACKEND_STORAGE -# Setting up Grafana with Azure Active Directory +# GRAFANA_ROOT_URL should be a DNS name that will resolve to a visualization VM that is created later +# This can be an actual DNS entry or a hostfile entry +GRAFANA_ROOT_URL='https://vm-12345.westus2.cloudapp.azure.com' + +# Create an AAD Application for use with Grafana +CLIENT_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1) az ad app create \ ---display-name \ ---reply-urls # separated by spaces if more than one ---password # must be at least 16 characters long, contain at least 1 special character, and contain at least 1 numeric character + --display-name grafana \ + --reply-urls "https://$GRAFANA_ROOT_URL/login/generic_oauth" \ + --key-type Password + --password $CLIENT_SECRET # Deploy the development infrastructure cd terraform/infra @@ -71,8 +77,8 @@ terraform init \ --backend-config="key=infra.terraform.tfstate" terraform apply \ - -var 'infra_resource_group_name=network-telemetry-infra' \ - -var 'grafana_aad_client_secret=5554eb17-abf0-4c59-aac4-f4a7405ec53d' + -var "infra_resource_group_name=network-telemetry-infra" \ + -var "grafana_aad_client_secret=$CLIENT_SECRET" ``` From f5df766174cde5b75c85218a1b490173f7ae4258 Mon Sep 17 00:00:00 2001 From: Noel Bundick Date: Thu, 23 May 2019 14:19:38 -0700 Subject: [PATCH 2/2] fix backslash --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bc158ca..693597e 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ CLIENT_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1) az ad app create \ --display-name grafana \ --reply-urls "https://$GRAFANA_ROOT_URL/login/generic_oauth" \ - --key-type Password + --key-type Password \ --password $CLIENT_SECRET # Deploy the development infrastructure @@ -135,7 +135,7 @@ terraform apply > Note: all components are deployed inside a VNET and are inaccessible to the outside world. If you want to access your resources from the Internet, you'll need to make some changes. [Public access to VMs](#Public-access-to-VMs) has additional details. -## Grafana configuration +## Post-deployment configuration You'll need to perform a couple of quick steps to configure Grafana.