@@ -48,6 +48,7 @@ if ($restartingInstance) {
48
48
if (" $databaseInstance " -ne " " ) {
49
49
$databaseServerInstance += " \$databaseInstance "
50
50
}
51
+ Write-Host " Using database server $databaseServerInstance "
51
52
52
53
if (! $multitenant ) {
53
54
New-NAVDatabase - DatabaseServer $databaseServer `
@@ -79,26 +80,28 @@ if ($restartingInstance) {
79
80
Remove-NAVApplication - DatabaseServer $DatabaseServer - DatabaseInstance $DatabaseInstance - DatabaseName " tenant" - Force | Out-Null
80
81
}
81
82
82
- } elseif (" $appBacpac " -ne " " -and " $tenantBacpac " -ne " " ) {
83
+ } elseif (" $appBacpac " -ne " " ) {
83
84
84
85
# appBacpac and tenantBacpac specified - restore and use
85
86
86
87
$dbName = " app"
87
88
$appBacpac , $tenantBacpac | % {
88
- if ($_.StartsWith (" https://" ) -or $_.StartsWith (" http://" ))
89
- {
90
- $databaseFile = (Join-Path $runPath " ${dbName} .bacpac" )
91
- Write-Host " Downloading ${dbName} .bacpac"
92
- (New-Object System.Net.WebClient).DownloadFile($_ , $databaseFile )
93
- } else {
94
- if (! (Test-Path - Path $_ - PathType Leaf)) {
95
- Write-Error " ERROR: Database Backup File not found."
96
- Write-Error " The file must be uploaded to the container or available on a share."
97
- exit 1
89
+ if ($_ ) {
90
+ if ($_.StartsWith (" https://" ) -or $_.StartsWith (" http://" ))
91
+ {
92
+ $databaseFile = (Join-Path $runPath " ${dbName} .bacpac" )
93
+ Write-Host " Downloading ${dbName} .bacpac"
94
+ (New-Object System.Net.WebClient).DownloadFile($_ , $databaseFile )
95
+ } else {
96
+ if (! (Test-Path - Path $_ - PathType Leaf)) {
97
+ Write-Error " ERROR: Database Backup File not found."
98
+ Write-Error " The file must be uploaded to the container or available on a share."
99
+ exit 1
100
+ }
101
+ $databaseFile = $_
98
102
}
99
- $databaseFile = $_
103
+ Restore-BacpacWithRetry - Bacpac $databaseFile - DatabaseName $dbName
100
104
}
101
- Restore-BacpacWithRetry - Bacpac $databaseFile - DatabaseName $dbName
102
105
$dbName = " tenant"
103
106
}
104
107
0 commit comments