From a49a731d2b287cb747fceadf3be446fd39b595d2 Mon Sep 17 00:00:00 2001 From: Marvin Buss Date: Thu, 16 May 2024 16:27:35 +0200 Subject: [PATCH 1/3] Add deployment instructions --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fccde48..a17c85b 100644 --- a/README.md +++ b/README.md @@ -1 +1,42 @@ -# timeseries-data-explorer +# Timeseries Data Explorer + +## Instructions for deployment + +### Prerequisites + +- Azure CLI +- Azure Subscription +- Terraform + +### Azure CLI configuration + +```sh +# Login to Azure +az login + +# Set azure account +az account set --subscription "" + +# Configure CLI +az config set extension.use_dynamic_install=yes_without_prompt +``` + +### Terraform deployment (local backend) + +```sh +# Move terraform_override.tf file +move .\utilities\terraformConfigSamples\* .\code\infra\ + +# Change directory +cd .\code\infra\ + +# Terraform init +terraform init + +# Terraform plan +terraform plan -var-file="vars.tfvars" + +# Terraform apply +terraform apply -var-file="vars.tfvars" +``` + From 341148c2f3329f51772b7a2219e60e7abf0ca8e3 Mon Sep 17 00:00:00 2001 From: Marvin Buss Date: Thu, 16 May 2024 16:28:18 +0200 Subject: [PATCH 2/3] Fix bug in kusto script --- code/datamodel/operationaldb.kql | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/datamodel/operationaldb.kql b/code/datamodel/operationaldb.kql index 18820ec..d281ed6 100644 --- a/code/datamodel/operationaldb.kql +++ b/code/datamodel/operationaldb.kql @@ -79,6 +79,16 @@ ) // Create function +.create-or-alter function with (docstring = 'Function to get latest threshold value for named threshold', folder='thresholds') GetThreshold(valueName: string) { + toscalar( + thresholds + | where name == valueName + | order by timestamp desc + | limit 1 + | summarize max(value) + ) +} + .create-or-alter function with (docstring = 'Function to get average happiness scores for iptv data', folder='iptv') IptvGetAvgHappinessScore() { let currentTimestamp = now(); let movingWindowInMinutes = GetThreshold('movingWindowInMinutes'); @@ -179,16 +189,6 @@ | project-away SumTotalHappiness } -.create-or-alter function with (docstring = 'Function to get latest threshold value for named threshold', folder='thresholds') GetThreshold(valueName: string) { - toscalar( - thresholds - | where name == valueName - | order by timestamp desc - | limit 1 - | summarize max(value) - ) -} - //////////////////////////////////////////////// // Create materialized view and view for testing //////////////////////////////////////////////// From bfbb11b32356eedb91071dc7bdac9045aff6c444 Mon Sep 17 00:00:00 2001 From: Marvin Buss Date: Thu, 16 May 2024 16:44:19 +0200 Subject: [PATCH 3/3] lint --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a17c85b..4ce20a6 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,3 @@ terraform plan -var-file="vars.tfvars" # Terraform apply terraform apply -var-file="vars.tfvars" ``` -