Skip to content

Commit c9e772f

Browse files
committed
Feature: Add optional StateStore connection string parameter and default value for Debian distribution
1 parent 6de500d commit c9e772f

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

ACA/deploy-to-aca-jfrog.ps1

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ param(
5151
[string]$JFrogDebianRepo,
5252

5353
[Parameter(Mandatory=$true)]
54-
[string]$JFrogDebianDistribution,
54+
[string]$JFrogDebianDistribution = "bookworm",
5555

5656
[Parameter(Mandatory=$true)]
5757
[string]$JFrogDebianComponent,
@@ -94,6 +94,9 @@ param(
9494
[Parameter(Mandatory=$false)]
9595
[string]$JFrogPassword = "",
9696

97+
[Parameter(Mandatory=$false)]
98+
[string]$StateStoreConnectionString = "",
99+
97100
[Parameter(Mandatory=$false)]
98101
[switch]$SkipDockerBuild
99102
)
@@ -275,11 +278,16 @@ if ($LASTEXITCODE -ne 0) {
275278

276279
Write-Host "Infrastructure deployment completed successfully" -ForegroundColor Green
277280

278-
Write-Host "`nStep 3: Prompting for StateStore connection string..." -ForegroundColor Yellow
279-
$secureConnString = Read-Host -Prompt "The StateStore keeps track of migration job details in a DocumentDB. You may use the same database as the Target DocumentDB or a separate one. Enter the connection string for the StateStore." -AsSecureString
280-
$connString = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
281-
[Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureConnString)
282-
)
281+
Write-Host "`nStep 3: StateStore connection string..." -ForegroundColor Yellow
282+
if ([string]::IsNullOrEmpty($StateStoreConnectionString)) {
283+
$secureConnString = Read-Host -Prompt "The StateStore keeps track of migration job details in a DocumentDB. You may use the same database as the Target DocumentDB or a separate one. Enter the connection string for the StateStore." -AsSecureString
284+
$connString = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
285+
[Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureConnString)
286+
)
287+
} else {
288+
$connString = $StateStoreConnectionString
289+
Write-Host "Using StateStore connection string from parameter" -ForegroundColor Gray
290+
}
283291

284292
Write-Host "`nStep 4: Deploying Container App with application image..." -ForegroundColor Yellow
285293

0 commit comments

Comments
 (0)