Skip to content

Commit

Permalink
Issue #3219 (#3227)
Browse files Browse the repository at this point in the history
Fix for issue #3219

Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk committed Nov 12, 2023
1 parent 47971a0 commit 2fdb431
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions AppHandling/Run-AlValidation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
.Parameter ValidateCurrent
Include this switch if you want to also validate against current version of Business Central
.Parameter ValidateNextMinor
Include this switch if you want to also validate against next minor version of Business Central. If you include this switch you need to specify a sasToken for insider builds as well.
Include this switch if you want to also validate against next minor version of Business Central.
.Parameter ValidateNextMajor
Include this switch if you want to also validate against next major version of Business Central. If you include this switch you need to specify a sasToken for insider builds as well.
Include this switch if you want to also validate against next major version of Business Central.
.Parameter failOnError
Include this switch if you want to fail on the first error instead of returning all errors to the caller
.Parameter includeWarnings
Include this switch if you want to include Warnings
.Parameter doNotIgnoreInfos
Include this switch if you don't want to ignore Infos (if you want to include Infos)
.Parameter sasToken
OBSOLETE - sasToken is no longer needed
Shared Access Service Token for accessing insider artifacts of Business Central. Available on http://aka.ms/collaborate
.Parameter countries
Array or comma separated list of country codes to validate against
Expand All @@ -47,7 +48,7 @@
.Parameter vsixFile
Specify a URL or path to a .vsix file in order to override the .vsix file in the image with this.
Use Get-LatestAlLanguageExtensionUrl to get latest AL Language extension from Marketplace.
Use Get-AlLanguageExtensionFromArtifacts -artifactUrl (Get-BCArtifactUrl -select NextMajor -sasToken $insiderSasToken) to get latest insider .vsix
Use Get-AlLanguageExtensionFromArtifacts -artifactUrl (Get-BCArtifactUrl -select NextMajor -accept_insiderEULA) to get latest insider .vsix
Use . to specify that you want to use the AL Language extension from the container spun up for validation
Default is to use the latest AL Language extension from Marketplace for non-insider containers and the Language extension in the container for insider containers
.Parameter skipVerification
Expand Down Expand Up @@ -95,6 +96,7 @@ Param(
[switch] $failOnError,
[switch] $includeWarnings,
[switch] $doNotIgnoreInfos,
[Obsolete("sasToken is no longer needed")]
[string] $sasToken = "",
[Parameter(Mandatory=$true)]
$countries,
Expand All @@ -121,7 +123,6 @@ function DetermineArtifactsToUse {
Param(
[string] $version = "",
[string] $select = "Current",
[string] $sasToken = "",
[string[]] $countries = @("us"),
[switch] $throw
)
Expand All @@ -138,11 +139,10 @@ Write-Host -ForegroundColor Yellow @'

$minsto = 'bcartifacts'
$minsel = $select
$mintok = $sasToken
if ($countries) {
$minver = $null
$countries | ForEach-Object {
$url = Get-BCArtifactUrl -version $version -country $_ -select $select -sasToken $sasToken | Select-Object -First 1
$url = Get-BCArtifactUrl -version $version -country $_ -select $select -accept_insiderEula | Select-Object -First 1
if (!($url)) {
Write-Host -ForegroundColor Yellow "WARNING: NextMajor artifacts doesn't exist for $_"
}
Expand All @@ -154,7 +154,6 @@ Write-Host -ForegroundColor Yellow @'
$minver = $ver
$minsto = $url.Split('/')[2].Split('.')[0]
$minsel = "Latest"
$mintok = $url.Split('?')[1]; if ($mintok) { $mintok = "?$mintok" }
}
}
}
Expand All @@ -169,7 +168,7 @@ Write-Host -ForegroundColor Yellow @'
$version = $minver.ToString()
}
}
$artifactUrl = Get-BCArtifactUrl -storageAccount $minsto -version $version -country $countries[0] -select $minsel -sasToken $mintok | Select-Object -First 1
$artifactUrl = Get-BCArtifactUrl -storageAccount $minsto -version $version -country $countries[0] -select $minsel -accept_insiderEula | Select-Object -First 1
if (!($artifactUrl)) {
if ($throw) { throw "Unable to locate artifacts" }
}
Expand Down Expand Up @@ -452,6 +451,7 @@ Measure-Command {

$Parameters = @{
"accept_eula" = $true
"accept_insiderEula" = $true
"containerName" = $containerName
"artifactUrl" = $artifactUrl
"useGenericImage" = $useGenericImage
Expand Down
1 change: 1 addition & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
New-AadAppsForBC doesn't work with the newer versions of Microsoft.Graph module (where the type of the accesstoken parameter has changed)
New-AppSourceSubmission has a new parameter -doNotUpdateVersionNumber to support hotfixes in AppSource for earlier versions
New-AppSourceSubmission obsoleted parameter -doNotCheckVersionNumber that was previously used for hotfixes, because of a change in AppSource
Issue 3219 Run-AlValidation cannot validate against Next Major without an insider Sas token

6.0.0
Add parameter -accept_insiderEULA on New-BcContainer, Get-BcArtifactUrl and Run-AlPipeline to accept the insider EULA (https://go.microsoft.com/fwlink/?linkid=2245051) instead of using the insider SAS token.
Expand Down

0 comments on commit 2fdb431

Please sign in to comment.