Skip to content

Commit 8e33062

Browse files
authored
Merge pull request #17 from PerfectThymeTech/marvinbuss/instructions
Add deployment instructions
2 parents a109a5b + bfbb11b commit 8e33062

File tree

2 files changed

+51
-11
lines changed

2 files changed

+51
-11
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,41 @@
1-
# timeseries-data-explorer
1+
# Timeseries Data Explorer
2+
3+
## Instructions for deployment
4+
5+
### Prerequisites
6+
7+
- Azure CLI
8+
- Azure Subscription
9+
- Terraform
10+
11+
### Azure CLI configuration
12+
13+
```sh
14+
# Login to Azure
15+
az login
16+
17+
# Set azure account
18+
az account set --subscription "<your-subscription-id>"
19+
20+
# Configure CLI
21+
az config set extension.use_dynamic_install=yes_without_prompt
22+
```
23+
24+
### Terraform deployment (local backend)
25+
26+
```sh
27+
# Move terraform_override.tf file
28+
move .\utilities\terraformConfigSamples\* .\code\infra\
29+
30+
# Change directory
31+
cd .\code\infra\
32+
33+
# Terraform init
34+
terraform init
35+
36+
# Terraform plan
37+
terraform plan -var-file="vars.tfvars"
38+
39+
# Terraform apply
40+
terraform apply -var-file="vars.tfvars"
41+
```

code/datamodel/operationaldb.kql

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@
7979
)
8080

8181
// Create function
82+
.create-or-alter function with (docstring = 'Function to get latest threshold value for named threshold', folder='thresholds') GetThreshold(valueName: string) {
83+
toscalar(
84+
thresholds
85+
| where name == valueName
86+
| order by timestamp desc
87+
| limit 1
88+
| summarize max(value)
89+
)
90+
}
91+
8292
.create-or-alter function with (docstring = 'Function to get average happiness scores for iptv data', folder='iptv') IptvGetAvgHappinessScore() {
8393
let currentTimestamp = now();
8494
let movingWindowInMinutes = GetThreshold('movingWindowInMinutes');
@@ -179,16 +189,6 @@
179189
| project-away SumTotalHappiness
180190
}
181191

182-
.create-or-alter function with (docstring = 'Function to get latest threshold value for named threshold', folder='thresholds') GetThreshold(valueName: string) {
183-
toscalar(
184-
thresholds
185-
| where name == valueName
186-
| order by timestamp desc
187-
| limit 1
188-
| summarize max(value)
189-
)
190-
}
191-
192192
////////////////////////////////////////////////
193193
// Create materialized view and view for testing
194194
////////////////////////////////////////////////

0 commit comments

Comments
 (0)