-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDeploy-Application.ps1
35 lines (26 loc) · 1.37 KB
/
Deploy-Application.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#Requires -Version 3.0
Param(
[Parameter(Mandatory=$True)]
[string]
$EnvironmentTag
)
# stop the script on first error
$ErrorActionPreference = 'Stop'
#******************************************************************************
# Script body
#******************************************************************************
Write-Host "Deploying the application..."
$registryUrl = ("cadevcache" + $EnvironmentTag + "registry.azurecr.io")
$keyVaultName = "ca-devcache-$EnvironmentTag"
$storageKeyName = ("cadevcache" + $EnvironmentTag + "storage")
$recieveConnectionString = (Get-AzureKeyVaultSecret -VaultName $keyVaultName -SecretName eventHubReceiveConnectionString).SecretValueText
$sendConnectionString = (Get-AzureKeyVaultSecret -VaultName $keyVaultName -SecretName eventHubSendConnectionString).SecretValueText
$storageAccountKey = (Get-AzureKeyVaultSecret -VaultName $keyVaultName -SecretName $storageKeyName).SecretValueText
$storageAccountName = ("cadevcache" + $EnvironmentTag + "storage")
$eventHubReaderPath = "ca-devcache-$EnvironmentTag-hub"
helm install ./devicecache --set global.imageRepository=$registryUrl `
--set eventHubReaderConnectionString=$recieveConnectionString `
--set eventHubSenderConnectionString=$sendConnectionString `
--set storageAccountName=$storageAccountName `
--set storageAccountKey=$storageAccountKey `
--set eventHubReaderPath=$eventHubReaderPath