Skip to content

Commit f2b3d82

Browse files
committed
[HOTFIX] Pass the resource location explicitly to Add-VMImage within Canary
1 parent f7cafeb commit f2b3d82

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

CanaryValidator/Canary.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ param (
9191
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
9292
[ValidateNotNullOrEmpty()]
9393
[string]$CanaryLogPath = $env:TMP + "\CanaryLogs$((Get-Date).Ticks)",
94-
[parameter(HelpMessage="Specifies the file name for canary log file")]
94+
[parameter(HelpMessage="Specifies the file name for canary log file")]
9595
[Parameter(ParameterSetName="default", Mandatory=$false)]
9696
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
9797
[ValidateNotNullOrEmpty()]
@@ -180,7 +180,7 @@ while ($runCount -le $NumberOfIterations)
180180
{
181181
if (-not (Get-AzureRmVMImage -Location $ResourceLocation -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer" -Sku "2016-Datacenter-Core" -ErrorAction SilentlyContinue))
182182
{
183-
New-Server2016VMImage -ISOPath $WindowsISOPath -TenantId $TenantID -EnvironmentName $SvcAdminEnvironmentName -Version Core -AzureStackCredentials $ServiceAdminCredentials -CreateGalleryItem $false
183+
New-Server2016VMImage -ISOPath $WindowsISOPath -TenantId $TenantID -EnvironmentName $SvcAdminEnvironmentName -Location $ResourceLocation -Version Core -AzureStackCredentials $ServiceAdminCredentials -CreateGalleryItem $false
184184
}
185185
}
186186
}
@@ -200,7 +200,7 @@ while ($runCount -le $NumberOfIterations)
200200
}
201201
New-Item -Path $CanaryCustomImageFolder -ItemType Directory
202202
$CustomVHDPath = CopyImage -ImagePath $LinuxImagePath -OutputFolder $CanaryCustomImageFolder
203-
Add-VMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -tenantID $TenantID -azureStackCredentials $ServiceAdminCredentials -CreateGalleryItem $false -EnvironmentName $SvcAdminEnvironmentName
203+
Add-VMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -tenantID $TenantID -azureStackCredentials $ServiceAdminCredentials -Location $ResourceLocation -CreateGalleryItem $false -EnvironmentName $SvcAdminEnvironmentName
204204
Remove-Item $CanaryCustomImageFolder -Force -Recurse
205205
}
206206
}

0 commit comments

Comments
 (0)