Skip to content

Commit

Permalink
Bug fix: Storing .env file for bicep file at service dir (#1943)
Browse files Browse the repository at this point in the history
New-TestResources.ps1 was storing the .env file at the temp folder if the service uses bicep files. This bug fix stores the .env file at the correct service directory.

(also pushed in logging request in #1876)
  • Loading branch information
ckairen authored Aug 27, 2021
1 parent 04e9623 commit edc75f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,13 @@ try {
&$preDeploymentScript -ResourceGroupName $ResourceGroupName @PSBoundParameters
}

Log "Deploying template '$($templateFile.originalFilePath)' to resource group '$($resourceGroup.ResourceGroupName)'"
$msg = if ($templateFile.jsonFilePath -ne $templateFile.originalFilePath) {
"Deployment template $($templateFile.jsonFilePath) from $($templateFile.originalFilePath) to resource group $($resourceGroup.ResourceGroupName)"
} else {
"Deployment template $($templateFile.jsonFilePath) to resource group $($resourceGroup.ResourceGroupName)"
}
Log $msg

$deployment = Retry {
$lastDebugPreference = $DebugPreference
try {
Expand Down Expand Up @@ -538,7 +544,7 @@ try {
Write-Host 'File option is supported only on Windows'
}

$outputFile = "$($templateFile.jsonFilePath).env"
$outputFile = "$($templateFile.originalFilePath).env"

$environmentText = $deploymentOutputs | ConvertTo-Json;
$bytes = ([System.Text.Encoding]::UTF8).GetBytes($environmentText)
Expand Down

0 comments on commit edc75f5

Please sign in to comment.