diff --git a/.github/workflows/E2E.yaml b/.github/workflows/E2E.yaml index c098cc150..b371a6d87 100644 --- a/.github/workflows/E2E.yaml +++ b/.github/workflows/E2E.yaml @@ -62,10 +62,6 @@ jobs: Write-Host "::Error::In order to run end to end tests, you need a Secret called licenseFileUrl containing a secure Url to a build license file" $err = $true } - if ('${{ Secrets.insiderSasToken }}' -eq '') { - Write-Host "::Error::In order to run end to end tests, you need a Secret called insiderSasToken containing the Insider SAS token from https://aka.ms/collaborate" - $err = $true - } if ($err) { exit 1 } @@ -196,7 +192,7 @@ jobs: - name: Run test run: | try { - . (Join-Path "." "e2eTests/scenarios/${{ matrix.scenario }}/runtest.ps1") -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName ${{ steps.calculateParams.outputs.repoName }} -token '${{ Secrets.E2EPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -pteTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -appSourceTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -adminCenterApiToken '${{ Secrets.adminCenterApiCredentials }}' -licenseFileUrl '${{ Secrets.licenseFileUrl }}' + . (Join-Path "." "e2eTests/scenarios/${{ matrix.scenario }}/runtest.ps1") -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName ${{ steps.calculateParams.outputs.repoName }} -token '${{ Secrets.E2EPAT }}' -pteTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -appSourceTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -adminCenterApiToken '${{ Secrets.adminCenterApiCredentials }}' -licenseFileUrl '${{ Secrets.licenseFileUrl }}' } catch { Write-Host $_.Exception.Message @@ -242,7 +238,7 @@ jobs: - name: Run tests run: | try { - . (Join-Path "." "e2eTests/Test-AL-Go.ps1") -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName ${{ steps.calculateParams.outputs.repoName }} -token '${{ Secrets.E2EPAT }}' -InsiderSasToken '${{ Secrets.InsiderSasToken }}' -template ${{ steps.calculateParams.outputs.template }} -adminCenterApiToken ${{ steps.calculateParams.outputs.adminCenterApiCredentials }} -licenseFileUrl ${{ steps.calculateParams.outputs.licenseFileUrl }} -multiProject:('${{ matrix.style }}' -eq 'multiProject') -appSource:('${{ matrix.type }}' -eq 'appSourceApp') -linux:('${{ matrix.os }}' -eq 'linux') -private:('${{ matrix.visibility }}' -eq 'private') -useCompilerFolder:('${{ matrix.Compiler }}' -eq 'CompilerFolder') + . (Join-Path "." "e2eTests/Test-AL-Go.ps1") -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName ${{ steps.calculateParams.outputs.repoName }} -token '${{ Secrets.E2EPAT }}' -template ${{ steps.calculateParams.outputs.template }} -adminCenterApiToken ${{ steps.calculateParams.outputs.adminCenterApiCredentials }} -licenseFileUrl ${{ steps.calculateParams.outputs.licenseFileUrl }} -multiProject:('${{ matrix.style }}' -eq 'multiProject') -appSource:('${{ matrix.type }}' -eq 'appSourceApp') -linux:('${{ matrix.os }}' -eq 'linux') -private:('${{ matrix.visibility }}' -eq 'private') -useCompilerFolder:('${{ matrix.Compiler }}' -eq 'CompilerFolder') } catch { Write-Host $_.Exception.Message diff --git a/Actions/AL-Go-Helper.ps1 b/Actions/AL-Go-Helper.ps1 index 4f874a2b7..f2fb6a124 100644 --- a/Actions/AL-Go-Helper.ps1 +++ b/Actions/AL-Go-Helper.ps1 @@ -553,7 +553,6 @@ function ReadSettings { "appRevision" = 0 "keyVaultName" = "" "licenseFileUrlSecretName" = "licenseFileUrl" - "insiderSasTokenSecretName" = "insiderSasToken" "ghTokenWorkflowSecretName" = "ghTokenWorkflow" "adminCenterApiCredentialsSecretName" = "adminCenterApiCredentials" "applicationInsightsConnectionStringSecretName" = "applicationInsightsConnectionString" @@ -842,7 +841,6 @@ function AnalyzeRepo { [hashTable] $settings, [string] $baseFolder = $ENV:GITHUB_WORKSPACE, [string] $project = '.', - [string] $insiderSasToken, [switch] $doNotCheckArtifactSetting, [switch] $doNotIssueWarnings, [string[]] $includeOnlyAppIds @@ -992,7 +990,7 @@ function AnalyzeRepo { } if (!$doNotCheckArtifactSetting) { - $artifactUrl = DetermineArtifactUrl -projectSettings $settings -insiderSasToken $insiderSasToken -doNotIssueWarnings:$doNotIssueWarnings + $artifactUrl = DetermineArtifactUrl -projectSettings $settings -doNotIssueWarnings:$doNotIssueWarnings $version = $artifactUrl.Split('/')[4] Write-Host "Downloading artifacts from $($artifactUrl.Split('?')[0])" $folders = Download-Artifacts -artifactUrl $artifactUrl -includePlatform -ErrorAction SilentlyContinue @@ -1506,8 +1504,8 @@ function CreateDevEnv { [pscredential] $credential, [Parameter(ParameterSetName = 'local')] [string] $containerName = "", - [string] $insiderSasToken = "", - [string] $licenseFileUrl = "" + [string] $licenseFileUrl = "", + [switch] $accept_insiderEula ) if ($PSCmdlet.ParameterSetName -ne $kind) { @@ -1595,9 +1593,6 @@ function CreateDevEnv { $LicenseFileSecret = Get-AzKeyVaultSecret -VaultName $settings.keyVaultName -Name $settings.licenseFileUrlSecretName if ($LicenseFileSecret) { $licenseFileUrl = $LicenseFileSecret.SecretValue | Get-PlainText } - $insiderSasTokenSecret = Get-AzKeyVaultSecret -VaultName $settings.keyVaultName -Name $settings.insiderSasTokenSecretName - if ($insiderSasTokenSecret) { $insiderSasToken = $insiderSasTokenSecret.SecretValue | Get-PlainText } - # do not add codesign cert. if ($settings.applicationInsightsConnectionStringSecretName) { @@ -1640,18 +1635,20 @@ function CreateDevEnv { } $params = @{} - if ($kind -eq "local") { - $params += @{ - "insiderSasToken" = $insiderSasToken - } - } - elseif ($kind -eq "cloud") { + if ($kind -eq "cloud") { + $accept_insiderEula = $true $params += @{ "doNotCheckArtifactSetting" = $true } } $settings = AnalyzeRepo -settings $settings -baseFolder $baseFolder -project $project @params $settings = CheckAppDependencyProbingPaths -settings $settings -baseFolder $baseFolder -project $project + + if (!$accept_insiderEula -and ($repo.artifact -like 'https://bcinsider.blob.core.windows.net/*' -or $repo.artifact -like 'https://bcinsider.azureedge.net/*')) { + Read-Host 'Press ENTER to accept the Business Central insider EULA (https://go.microsoft.com/fwlink/?linkid=2245051) or break the script to cancel' + $accept_insiderEula = $true + } + if ((-not $settings.appFolders) -and (-not $settings.testFolders)) { Write-Host "Repository is empty" } @@ -1749,7 +1746,7 @@ function CreateDevEnv { if ($kind -eq "local") { $runAlPipelineParams += @{ - "artifact" = $settings.artifact.replace('{INSIDERSASTOKEN}', $insiderSasToken) + "artifact" = $settings.artifact.replace('{INSIDERSASTOKEN}', '') "auth" = $auth "credential" = $credential } @@ -1841,6 +1838,7 @@ function CreateDevEnv { } Run-AlPipeline @runAlPipelineParams ` + -accept_insiderEula:$accept_insiderEula ` -vsixFile $settings.vsixFile ` -pipelinename $workflowName ` -imageName "" ` @@ -2108,32 +2106,23 @@ function GetProject { function DetermineArtifactUrl { Param( [hashtable] $projectSettings, - [string] $insiderSasToken = "", [switch] $doNotIssueWarnings ) $artifact = $projectSettings.artifact if ($artifact.Contains('{INSIDERSASTOKEN}')) { - if ($insiderSasToken) { - $artifact = $artifact.replace('{INSIDERSASTOKEN}', $insiderSasToken) - } - else { - throw "Artifact definition $artifact requires you to create a secret called InsiderSasToken, containing the Insider SAS Token from https://aka.ms/collaborate" - } + $artifact = $artifact.replace('{INSIDERSASTOKEN}', '') + Write-Host "::Warning::Please update your artifact setting and remove {INSIDERSASTOKEN} from the setting. This is no longer needed." } Write-Host "Checking artifact setting for project" if ($artifact -eq "" -and $projectSettings.updateDependencies) { $artifact = Get-BCArtifactUrl -country $projectSettings.country -select all | Where-Object { [Version]$_.Split("/")[4] -ge [Version]$projectSettings.applicationDependency } | Select-Object -First 1 if (-not $artifact) { - if ($insiderSasToken) { - $artifact = Get-BCArtifactUrl -storageAccount bcinsider -country $projectSettings.country -select all -sasToken $insiderSasToken | Where-Object { [Version]$_.Split("/")[4] -ge [Version]$projectSettings.applicationDependency } | Select-Object -First 1 - if (-not $artifact) { - throw "No artifacts found for application dependency $($projectSettings.applicationDependency)." - } - } - else { - throw "No artifacts found for application dependency $($projectSettings.applicationDependency). If you are targetting an insider version, you need to create a secret called InsiderSasToken, containing the Insider SAS Token from https://aka.ms/collaborate" + # Check Insider Artifacts + $artifact = Get-BCArtifactUrl -storageAccount bcinsider -accept_insiderEula -country $projectSettings.country -select all | Where-Object { [Version]$_.Split("/")[4] -ge [Version]$projectSettings.applicationDependency } | Select-Object -First 1 + if (-not $artifact) { + throw "No artifacts found for application dependency $($projectSettings.applicationDependency)." } } } @@ -2144,7 +2133,6 @@ function DetermineArtifactUrl { $artifactType = ("$artifactUrl////".Split('/')[3]) $version = ("$artifactUrl////".Split('/')[4]) $country = ("$artifactUrl////".Split('?')[0].Split('/')[5]) - $sasToken = "$($artifactUrl)?".Split('?')[1] } else { $segments = "$artifact/////".Split('/') @@ -2153,8 +2141,7 @@ function DetermineArtifactUrl { $version = $segments[2] $country = $segments[3]; if ($country -eq "") { $country = $projectSettings.country } $select = $segments[4]; if ($select -eq "") { $select = "latest" } - $sasToken = $segments[5] - $artifactUrl = Get-BCArtifactUrl -storageAccount $storageAccount -type $artifactType -version $version -country $country -select $select -sasToken $sasToken | Select-Object -First 1 + $artifactUrl = Get-BCArtifactUrl -storageAccount $storageAccount -type $artifactType -version $version -country $country -select $select -accept_insiderEula | Select-Object -First 1 if (-not $artifactUrl) { throw "No artifacts found for the artifact setting ($artifact) in $ALGoSettingsFile" } @@ -2170,10 +2157,10 @@ function DetermineArtifactUrl { # AT is the latest published language - use this to determine available country codes (combined with mapping) $ver = [Version]$version Write-Host "https://$storageAccount/$artifactType/$version/$country" - $atArtifactUrl = Get-BCArtifactUrl -storageAccount $storageAccount -type $artifactType -country at -version "$($ver.Major).$($ver.Minor)" -select Latest -sasToken $sasToken + $atArtifactUrl = Get-BCArtifactUrl -storageAccount $storageAccount -type $artifactType -country at -version "$($ver.Major).$($ver.Minor)" -select Latest -accept_insiderEula Write-Host "Latest AT artifacts $atArtifactUrl" $latestATversion = $atArtifactUrl.Split('/')[4] - $countries = Get-BCArtifactUrl -storageAccount $storageAccount -type $artifactType -version $latestATversion -sasToken $sasToken -select All | ForEach-Object { + $countries = Get-BCArtifactUrl -storageAccount $storageAccount -type $artifactType -version $latestATversion -accept_insiderEula -select All | ForEach-Object { $countryArtifactUrl = $_.Split('?')[0] # remove sas token $countryArtifactUrl.Split('/')[5] # get country } diff --git a/Actions/DetermineArtifactUrl/DetermineArtifactUrl.ps1 b/Actions/DetermineArtifactUrl/DetermineArtifactUrl.ps1 index 4637f18c6..87ee569d3 100644 --- a/Actions/DetermineArtifactUrl/DetermineArtifactUrl.ps1 +++ b/Actions/DetermineArtifactUrl/DetermineArtifactUrl.ps1 @@ -17,16 +17,9 @@ try { #region Action: Determine artifacts to use $telemetryScope = CreateScope -eventId 'DO0084' -parentTelemetryScopeJson $parentTelemetryScopeJson - $insiderSasToken = "" - # ENV:Secrets is not set when running Pull_Request trigger - if ($env:Secrets) { - $secrets = $env:Secrets | ConvertFrom-Json | ConvertTo-HashTable - $insiderSasToken = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($secrets.insiderSasToken)) - } - $settings = $env:Settings | ConvertFrom-Json | ConvertTo-HashTable $settings = AnalyzeRepo -settings $settings -project $project -doNotCheckArtifactSetting -doNotIssueWarnings - $artifactUrl = DetermineArtifactUrl -projectSettings $settings -insiderSasToken $insiderSasToken + $artifactUrl = DetermineArtifactUrl -projectSettings $settings $artifactCacheKey = '' if ($settings.useCompilerFolder) { $artifactCacheKey = $artifactUrl.Split('?')[0] diff --git a/Actions/DetermineArtifactUrl/README.md b/Actions/DetermineArtifactUrl/README.md index ce3cbf74d..82edf8ec3 100644 --- a/Actions/DetermineArtifactUrl/README.md +++ b/Actions/DetermineArtifactUrl/README.md @@ -7,7 +7,6 @@ Determines the artifactUrl to use for a given project | Name | Description | | :-- | :-- | | Settings | env.Settings must be set by a prior call to the ReadSettings Action | -| Secrets | env.Secrets with insiderSasToken must be read by a prior call to the ReadSecrets Action | ### Parameters | Name | Required | Description | Default value | diff --git a/Actions/RunPipeline/README.md b/Actions/RunPipeline/README.md index 021ca3b1d..bd1955ee2 100644 --- a/Actions/RunPipeline/README.md +++ b/Actions/RunPipeline/README.md @@ -7,7 +7,7 @@ Run pipeline in AL-Go repository | Name | Description | | :-- | :-- | | Settings | env.Settings must be set by a prior call to the ReadSettings Action | -| Secrets | env.Secrets with licenseFileUrl, insiderSasToken, codeSignCertificateUrl, codeSignCertificatePassword, keyVaultCertificateUrl, keyVaultCertificatePassword, keyVaultClientId, gitHubPackagesContext, applicationInsightsConnectionString must be read by a prior call to the ReadSecets Action | +| Secrets | env.Secrets with licenseFileUrl, codeSignCertificateUrl, codeSignCertificatePassword, keyVaultCertificateUrl, keyVaultCertificatePassword, keyVaultClientId, gitHubPackagesContext, applicationInsightsConnectionString must be read by a prior call to the ReadSecets Action | ### Parameters | Name | Required | Description | Default value | diff --git a/Actions/RunPipeline/RunPipeline.ps1 b/Actions/RunPipeline/RunPipeline.ps1 index ee35a6d00..5432d42a4 100644 --- a/Actions/RunPipeline/RunPipeline.ps1 +++ b/Actions/RunPipeline/RunPipeline.ps1 @@ -87,7 +87,7 @@ try { $appBuild = $settings.appBuild $appRevision = $settings.appRevision - 'licenseFileUrl','insiderSasToken','codeSignCertificateUrl','*codeSignCertificatePassword','keyVaultCertificateUrl','*keyVaultCertificatePassword','keyVaultClientId','gitHubPackagesContext','applicationInsightsConnectionString' | ForEach-Object { + 'licenseFileUrl','codeSignCertificateUrl','*codeSignCertificatePassword','keyVaultCertificateUrl','*keyVaultCertificatePassword','keyVaultClientId','gitHubPackagesContext','applicationInsightsConnectionString' | ForEach-Object { # Secrets might not be read during Pull Request runs if ($secrets.Keys -contains $_) { $value = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($secrets."$_")) @@ -122,7 +122,7 @@ try { } } - $settings = AnalyzeRepo -settings $settings -baseFolder $baseFolder -project $project -insiderSasToken $insiderSasToken @analyzeRepoParams + $settings = AnalyzeRepo -settings $settings -baseFolder $baseFolder -project $project @analyzeRepoParams $settings = CheckAppDependencyProbingPaths -settings $settings -token $token -baseFolder $baseFolder -project $project if ((-not $settings.appFolders) -and (-not $settings.testFolders) -and (-not $settings.bcptTestFolders)) { @@ -369,12 +369,13 @@ try { Write-Host "Invoke Run-AlPipeline with buildmode $buildMode" Run-AlPipeline @runAlPipelineParams ` + -accept_insiderEula ` -pipelinename $workflowName ` -containerName $containerName ` -imageName $imageName ` -bcAuthContext $authContext ` -environment $environmentName ` - -artifact $settings.artifact.replace('{INSIDERSASTOKEN}',$insiderSasToken) ` + -artifact $settings.artifact.replace('{INSIDERSASTOKEN}','') ` -vsixFile $settings.vsixFile ` -companyName $settings.companyName ` -memoryLimit $settings.memoryLimit ` diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 9c196bdec..657db4bc8 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -16,6 +16,12 @@ Note that when using the preview version of AL-Go for GitHub, we recommend you U - Issue 683 Settings from GitHub variables ALGoRepoSettings and ALGoOrgSettings are not applied during build pipeline - Issue 708 Inconsistent AuthTokenSecret Behavior in Multiple Projects: 'Secrets are not available' +### Removal of the InsiderSasToken + +As of October 1st 2023, Business Central insider builds are now publicly available. When creating local containers with the insider builds, you will have to accept the insider EULA (https://go.microsoft.com/fwlink/?linkid=2245051) in order to continue. + +AL-Go for GitHub allows you to build and test using insider builds without any explicit approval, but please note that the insider artifacts contains the insider Eula and you automatically accept this when using the builds. + ### Breaking changes Earlier, you could specify a mapping to an environment name in an environment secret called `_EnvironmentName`, `-EnvironmentName` or just `EnvironmentName`. You could also specify the projects you want to deploy to an environment as an environment secret called `Projects`. diff --git a/Scenarios/Contribute.md b/Scenarios/Contribute.md index 2ed1fb0e7..6c1ccde82 100644 --- a/Scenarios/Contribute.md +++ b/Scenarios/Contribute.md @@ -56,7 +56,6 @@ In your personal fork, you can now run the end to end tests, if the following pr - E2EPAT needs to be a Personal Access Token with these permissions: _admin:org, delete:packages, delete_repo, repo, workflow, write:packages_ - AdminCenterApiCredentials needs to be the adminCenterApiCredentials as described [here](CreateOnlineDevEnv2.md). - LicenseFileUrl needs to be a direct download URL to a developer .bclicense file - - InsiderSasToken needs to contain the Insider Sas Token from https://aka.ms/collaborate - Beside the secrets, you need to have a GitHub organization setup, which will contain all the temporary repositories created by the end to end testing. This organization needs to have at least two instances of a GitHub runner registered as self-hosted (for running all private repo builds) Run the End to end tests by running the *End to end tests* workflow and specify your organization in the corresponding field. @@ -71,7 +70,6 @@ You can also run the end to end tests directly from VS Code, by providing the fo |$global:SecureE2EPAT| SecureString | A personal access token with workflow permissions | |$global:SecureAdminCenterApiToken| SecureString | Admin Center API Credentials | |$global:SecureLicenseFileUrl| SecureString | Direct download URL to a license file | -|$global:SecureInsiderSasToken | SecureString | The Insider SAS Token from https://aka.ms/collaborate | |$global:pteTemplate| String | URL for your PTE template (like `freddyk/AL-Go-PTE@main` or `freddydk/AL-Go@main\|Templates/Per Tenant Extension` for using your AL-Go fork directly) | |$global:appSourceTemplate| String | URL for your PTE template (like `freddyk/AL-Go-AppSource@main` or `freddydk/AL-Go@main\|Templates/AppSource App` for using your AL-Go fork directly) | diff --git a/Scenarios/settings.md b/Scenarios/settings.md index efeca2727..9fd05ddbb 100644 --- a/Scenarios/settings.md +++ b/Scenarios/settings.md @@ -69,7 +69,7 @@ The repository settings are only read from the repository settings file (.github | Name | Description | Default value | | :-- | :-- | :-- | -| artifact | Determines the artifacts used for building and testing the app.
This setting can either be an absolute pointer to Business Central artifacts (https://... - rarely used) or it can be a search specification for artifacts (\/\/\/\/\/\).
If not specified, the artifacts used will be the latest sandbox artifacts from the country specified in the country setting. | | +| artifact | Determines the artifacts used for building and testing the app.
This setting can either be an absolute pointer to Business Central artifacts (https://... - rarely used) or it can be a search specification for artifacts (\/\/\/\/\).
If not specified, the artifacts used will be the latest sandbox artifacts from the country specified in the country setting. | | | updateDependencies | Setting updateDependencies to true causes AL-Go to build your app against the first compatible Business Central build and set the dependency version numbers in the app.json accordingly during build. All version numbers in the built app will be set to the version number used during compilation. | false | | generateDependencyArtifact | When this repository setting is true, CI/CD pipeline generates an artifact with the external dependencies used for building the apps in this repo. | false | | companyName | Company name selected in the database, used for running the CI/CD workflow. Default is to use the default company in the selected Business Central localization. | | @@ -77,7 +77,6 @@ The repository settings are only read from the repository settings file (.github | additionalCountries | This property can be set to an additional number of countries to compile, publish and test your app against during workflows. Note that this setting can be different in NextMajor and NextMinor workflows compared to the CI/CD workflow, by specifying a different value in a workflow settings file. | [ ] | | keyVaultName | When using Azure KeyVault for the secrets used in your workflows, the KeyVault name needs to be specified in this setting if it isn't specified in the AZURE_CREDENTIALS secret. Read [this](UseAzureKeyVault.md) for more information. | | | licenseFileUrlSecretName | Specify the name (**NOT the secret**) of the LicenseFileUrl secret. Default is LicenseFileUrl. AL-Go for GitHub will look for a secret with this name in GitHub Secrets or Azure KeyVault to use as LicenseFileUrl. A LicenseFileUrl is required when building AppSource apps for Business Central prior to version 22. Read [this](SetupCiCdForExistingAppSourceApp.md) for more information. | LicenseFileUrl | -| insiderSasTokenSecretName | Specifies the name (**NOT the secret**) of the InsiderSasToken secret. Default is InsiderSasToken. AL-Go for GitHub will look for a secret with this name in GitHub Secrets or Azure KeyVault to use as InsiderSasToken for getting access to Next Minor and Next Major builds. | InsiderSasToken | | ghTokenWorkflowSecretName | Specifies the name (**NOT the secret**) of the GhTokenWorkflow secret. Default is GhTokenWorkflow. AL-Go for GitHub will look for a secret with this name in GitHub Secrets or Azure KeyVault to use as Personal Access Token with permission to modify workflows when running the Update AL-Go System Files workflow. Read [this](UpdateAlGoSystemFiles.md) for more information. | GhTokenWorkflow | | adminCenterApiCredentialsSecretName | Specifies the name (**NOT the secret**) of the adminCenterApiCredentials secret. Default is adminCenterApiCredentials. AL-Go for GitHub will look for a secret with this name in GitHub Secrets or Azure KeyVault to use when connecting to the Admin Center API when creating Online Development Environments. Read [this](CreateOnlineDevEnv2.md) for more information. | AdminCenterApiCredentials | | installApps | An array of 3rd party dependency apps, which you do not have access to through the appDependencyProbingPaths. The setting should be an array of either secure URLs or paths to folders or files relative to the project, where the CI/CD workflow can find and download the apps. The apps in installApps are downloaded and installed before compiling and installing the apps. | [ ] | diff --git a/Templates/AppSource App/.AL-Go/localDevEnv.ps1 b/Templates/AppSource App/.AL-Go/localDevEnv.ps1 index c38d17ef8..ddde6a723 100644 --- a/Templates/AppSource App/.AL-Go/localDevEnv.ps1 +++ b/Templates/AppSource App/.AL-Go/localDevEnv.ps1 @@ -8,7 +8,6 @@ Param( [string] $auth = "", [pscredential] $credential = $null, [string] $licenseFileUrl = "", - [string] $insiderSasToken = "", [switch] $fromVSCode ) @@ -130,8 +129,7 @@ CreateDevEnv ` -project $project ` -auth $auth ` -credential $credential ` - -licenseFileUrl $licenseFileUrl ` - -insiderSasToken $insiderSasToken + -licenseFileUrl $licenseFileUrl } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/Templates/AppSource App/.github/Test Next Major.settings.json b/Templates/AppSource App/.github/Test Next Major.settings.json index a5a125a44..1fc329de5 100644 --- a/Templates/AppSource App/.github/Test Next Major.settings.json +++ b/Templates/AppSource App/.github/Test Next Major.settings.json @@ -1,5 +1,5 @@ { - "artifact": "////nextmajor/{INSIDERSASTOKEN}", + "artifact": "////nextmajor", "cacheImageName": "", "versioningStrategy": 15 } diff --git a/Templates/AppSource App/.github/Test Next Minor.settings.json b/Templates/AppSource App/.github/Test Next Minor.settings.json index 91469d1fd..127bce769 100644 --- a/Templates/AppSource App/.github/Test Next Minor.settings.json +++ b/Templates/AppSource App/.github/Test Next Minor.settings.json @@ -1,5 +1,5 @@ { - "artifact": "////nextminor/{INSIDERSASTOKEN}", + "artifact": "////nextminor", "cacheImageName": "", "versioningStrategy": 15 } diff --git a/Templates/AppSource App/.github/workflows/CICD.yaml b/Templates/AppSource App/.github/workflows/CICD.yaml index 6f8b8927a..66a24f19e 100644 --- a/Templates/AppSource App/.github/workflows/CICD.yaml +++ b/Templates/AppSource App/.github/workflows/CICD.yaml @@ -143,7 +143,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} publishArtifacts: ${{ github.ref_name == 'main' || startswith(github.ref_name, 'release/') || needs.Initialization.outputs.deliveryTargetsJson != '[]' || needs.Initialization.outputs.environmentCount > 0 }} signArtifacts: true diff --git a/Templates/AppSource App/.github/workflows/Current.yaml b/Templates/AppSource App/.github/workflows/Current.yaml index 88699da49..f0de67e7f 100644 --- a/Templates/AppSource App/.github/workflows/Current.yaml +++ b/Templates/AppSource App/.github/workflows/Current.yaml @@ -75,7 +75,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} artifactsNameSuffix: 'Current' diff --git a/Templates/AppSource App/.github/workflows/NextMajor.yaml b/Templates/AppSource App/.github/workflows/NextMajor.yaml index 646f74e3b..60aa18c18 100644 --- a/Templates/AppSource App/.github/workflows/NextMajor.yaml +++ b/Templates/AppSource App/.github/workflows/NextMajor.yaml @@ -75,7 +75,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} artifactsNameSuffix: 'NextMajor' diff --git a/Templates/AppSource App/.github/workflows/NextMinor.yaml b/Templates/AppSource App/.github/workflows/NextMinor.yaml index 02f7cb332..0854574da 100644 --- a/Templates/AppSource App/.github/workflows/NextMinor.yaml +++ b/Templates/AppSource App/.github/workflows/NextMinor.yaml @@ -75,7 +75,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} artifactsNameSuffix: 'NextMinor' diff --git a/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml b/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml index ca955a56b..ac0c165c2 100644 --- a/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml +++ b/Templates/AppSource App/.github/workflows/PullRequestHandler.yaml @@ -94,7 +94,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} StatusCheck: diff --git a/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml b/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml index 8cf8dbef9..878d5501d 100644 --- a/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml +++ b/Templates/AppSource App/.github/workflows/_BuildALGoProject.yaml @@ -105,8 +105,6 @@ jobs: - name: Determine ArtifactUrl uses: microsoft/AL-Go-Actions/DetermineArtifactUrl@main id: determineArtifactUrl - env: - Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: shell: ${{ inputs.shell }} parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} diff --git a/Templates/Per Tenant Extension/.AL-Go/localDevEnv.ps1 b/Templates/Per Tenant Extension/.AL-Go/localDevEnv.ps1 index ab0db7e94..0b5c9a86f 100644 --- a/Templates/Per Tenant Extension/.AL-Go/localDevEnv.ps1 +++ b/Templates/Per Tenant Extension/.AL-Go/localDevEnv.ps1 @@ -8,7 +8,6 @@ Param( [string] $auth = "", [pscredential] $credential = $null, [string] $licenseFileUrl = "", - [string] $insiderSasToken = "", [switch] $fromVSCode ) @@ -130,8 +129,7 @@ CreateDevEnv ` -project $project ` -auth $auth ` -credential $credential ` - -licenseFileUrl $licenseFileUrl ` - -insiderSasToken $insiderSasToken + -licenseFileUrl $licenseFileUrl } catch { Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)" diff --git a/Templates/Per Tenant Extension/.github/Test Next Major.settings.json b/Templates/Per Tenant Extension/.github/Test Next Major.settings.json index a5a125a44..1fc329de5 100644 --- a/Templates/Per Tenant Extension/.github/Test Next Major.settings.json +++ b/Templates/Per Tenant Extension/.github/Test Next Major.settings.json @@ -1,5 +1,5 @@ { - "artifact": "////nextmajor/{INSIDERSASTOKEN}", + "artifact": "////nextmajor", "cacheImageName": "", "versioningStrategy": 15 } diff --git a/Templates/Per Tenant Extension/.github/Test Next Minor.settings.json b/Templates/Per Tenant Extension/.github/Test Next Minor.settings.json index 91469d1fd..127bce769 100644 --- a/Templates/Per Tenant Extension/.github/Test Next Minor.settings.json +++ b/Templates/Per Tenant Extension/.github/Test Next Minor.settings.json @@ -1,5 +1,5 @@ { - "artifact": "////nextminor/{INSIDERSASTOKEN}", + "artifact": "////nextminor", "cacheImageName": "", "versioningStrategy": 15 } diff --git a/Templates/Per Tenant Extension/.github/workflows/CICD.yaml b/Templates/Per Tenant Extension/.github/workflows/CICD.yaml index 6f8b8927a..66a24f19e 100644 --- a/Templates/Per Tenant Extension/.github/workflows/CICD.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/CICD.yaml @@ -143,7 +143,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} publishArtifacts: ${{ github.ref_name == 'main' || startswith(github.ref_name, 'release/') || needs.Initialization.outputs.deliveryTargetsJson != '[]' || needs.Initialization.outputs.environmentCount > 0 }} signArtifacts: true diff --git a/Templates/Per Tenant Extension/.github/workflows/Current.yaml b/Templates/Per Tenant Extension/.github/workflows/Current.yaml index 88699da49..f0de67e7f 100644 --- a/Templates/Per Tenant Extension/.github/workflows/Current.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/Current.yaml @@ -75,7 +75,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} artifactsNameSuffix: 'Current' diff --git a/Templates/Per Tenant Extension/.github/workflows/NextMajor.yaml b/Templates/Per Tenant Extension/.github/workflows/NextMajor.yaml index 646f74e3b..60aa18c18 100644 --- a/Templates/Per Tenant Extension/.github/workflows/NextMajor.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/NextMajor.yaml @@ -75,7 +75,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} artifactsNameSuffix: 'NextMajor' diff --git a/Templates/Per Tenant Extension/.github/workflows/NextMinor.yaml b/Templates/Per Tenant Extension/.github/workflows/NextMinor.yaml index 02f7cb332..0854574da 100644 --- a/Templates/Per Tenant Extension/.github/workflows/NextMinor.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/NextMinor.yaml @@ -75,7 +75,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,codeSignCertificateUrl,*codeSignCertificatePassword,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} artifactsNameSuffix: 'NextMinor' diff --git a/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml b/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml index ca955a56b..ac0c165c2 100644 --- a/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/PullRequestHandler.yaml @@ -94,7 +94,7 @@ jobs: projectName: ${{ matrix.projectName }} buildMode: ${{ matrix.buildMode }} projectDependenciesJson: ${{ needs.Initialization.outputs.projectDependenciesJson }} - secrets: 'licenseFileUrl,insiderSasToken,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' + secrets: 'licenseFileUrl,keyVaultCertificateUrl,*keyVaultCertificatePassword,keyVaultClientId,gitHubPackagesContext,applicationInsightsConnectionString' publishThisBuildArtifacts: ${{ needs.Initialization.outputs.workflowDepth > 1 }} StatusCheck: diff --git a/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml b/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml index 8cf8dbef9..878d5501d 100644 --- a/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml +++ b/Templates/Per Tenant Extension/.github/workflows/_BuildALGoProject.yaml @@ -105,8 +105,6 @@ jobs: - name: Determine ArtifactUrl uses: microsoft/AL-Go-Actions/DetermineArtifactUrl@main id: determineArtifactUrl - env: - Secrets: '${{ steps.ReadSecrets.outputs.Secrets }}' with: shell: ${{ inputs.shell }} parentTelemetryScopeJson: ${{ inputs.parentTelemetryScopeJson }} diff --git a/Tests/DetermineArtifactUrl.Test.ps1 b/Tests/DetermineArtifactUrl.Test.ps1 index 3bbf7c162..87ea66213 100644 --- a/Tests/DetermineArtifactUrl.Test.ps1 +++ b/Tests/DetermineArtifactUrl.Test.ps1 @@ -12,37 +12,37 @@ Describe "DetermineArtifactUrl" { . (Join-Path -Path $PSScriptRoot -ChildPath "../Actions/AL-Go-Helper.ps1" -Resolve) DownloadAndImportBcContainerHelper -baseFolder $([System.IO.Path]::GetTempPath()) - Mock -CommandName Get-BcArtifactUrl -MockWith { Param([string] $storageAccount, [string] $type = 'sandbox', [string] $version, [string] $country = '*', [string] $select = 'Latest', [string] $sasToken = '') + Mock -CommandName Get-BcArtifactUrl -MockWith { Param([string] $storageAccount, [string] $type = 'sandbox', [string] $version, [string] $country = '*', [string] $select = 'Latest') if ($select -eq 'nextmajor') { $storageAccount = 'bcinsider' } if (-not $storageAccount) { $storageAccount = 'bcartifacts' } if (-not $version) { $version = '*' } - Write-Host "Get-BcArtifactUrl -storageAccount '$storageAccount' -type '$type' -version '$version' -country '$country' -select '$select' -sasToken '$sasToken'" + Write-Host "Get-BcArtifactUrl -storageAccount '$storageAccount' -type '$type' -version '$version' -country '$country' -select '$select'" $allArtifacts = @( - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'at'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'dk'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'us'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'w1'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'at'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'dk'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'us'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'w1'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'at'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'dk'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'us'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'w1'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'at'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'dk'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'us'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'w1'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12346'; "country" = 'dk'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12346'; "country" = 'us'; "sasToken" = '' } - @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12346'; "country" = 'w1'; "sasToken" = '' } - @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'at'; "sasToken" = '?[SASTOKEN]' } - @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'dk'; "sasToken" = '?[SASTOKEN]' } - @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'us'; "sasToken" = '?[SASTOKEN]' } - @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'w1'; "sasToken" = '?[SASTOKEN]' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'at' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'dk' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'us' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '20.1.0.0'; "country" = 'w1' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'at' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'dk' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'us' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'onprem'; "version" = '21.0.11111.0'; "country" = 'w1' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'at' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'dk' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'us' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.0.55555.44444'; "country" = 'w1' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'at' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'dk' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'us' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12345'; "country" = 'w1' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12346'; "country" = 'dk' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12346'; "country" = 'us' } + @{ "storageAccount" = 'bcartifacts'; "type" = 'sandbox'; "version" = '22.1.12345.12346'; "country" = 'w1' } + @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'at' } + @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'dk' } + @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'us' } + @{ "storageAccount" = 'bcinsider'; "type" = 'sandbox'; "version" = '23.0.33333.0'; "country" = 'w1' } ) if ($version -ne '*') { @@ -53,13 +53,13 @@ Describe "DetermineArtifactUrl" { } } - $artifacts = $allArtifacts | Where-Object { $storageAccount -eq $_.StorageAccount -and $type -eq $_.type -and $_.version -like "$version" -and $_.country -like $country -and $sasToken -eq $_.sasToken } + $artifacts = $allArtifacts | Where-Object { $storageAccount -eq $_.StorageAccount -and $type -eq $_.type -and $_.version -like "$version" -and $_.country -like $country } if ($select -eq 'latest') { $artifacts = $artifacts | Select-Object -Last 1 } $artifacts | ForEach-Object { - Write-Host "https://$($_.storageAccount)/$($_.type)/$($_.version)/$($_.country)$($_.sasToken)" - "https://$($_.storageAccount)/$($_.type)/$($_.version)/$($_.country)$($_.sasToken)" + Write-Host "https://$($_.storageAccount)/$($_.type)/$($_.version)/$($_.country)" + "https://$($_.storageAccount)/$($_.type)/$($_.version)/$($_.country)" } } } @@ -103,8 +103,8 @@ Describe "DetermineArtifactUrl" { It 'NextMajor' { $projectSettings.country = 'dk' - $projectSettings.artifact = "////nextmajor/{INSIDERSASTOKEN}" - DetermineArtifactUrl -projectSettings $projectSettings -sasToken = '?[SASTOKEN]' | should -be 'https://bcinsider/sandbox/23.0.33333.0/dk?[SASTOKEN]' + $projectSettings.artifact = "////nextmajor" + DetermineArtifactUrl -projectSettings $projectSettings | should -be 'https://bcinsider/sandbox/23.0.33333.0/dk' } It 'Artifact setting wins over country setting' { diff --git a/Workshop/ScheduledTestRuns.md b/Workshop/ScheduledTestRuns.md index 634b84840..1fde3e56b 100644 --- a/Workshop/ScheduledTestRuns.md +++ b/Workshop/ScheduledTestRuns.md @@ -3,11 +3,6 @@ Building and testing your apps with the latest and the upcoming versions of Busi To be able to run the workflows for testing against **Next Minor** and **Next Major** versions of Business Central, you will need an **insider SAS Token**, which is available on https://aka.ms/collaborate (Select **Packages** and **Working with Business Central insider builds**). The Direct URL is [here](https://partner.microsoft.com/en-us/dashboard/collaborate/packages/9387), but you will have to have an account with collaborate in order to use the link. -Create an organizatonal secret called **INSIDERSASTOKEN**, containing the insider SAS Token from collaborate. - -| ![image](https://user-images.githubusercontent.com/10775043/232338769-abe5c76d-6ac5-4b1a-8fb8-a972333f0e44.png) | -|-| - Use **https://crontab.guru** to create a crontab for the schedule you want to run your workflows on. I have selected the following: - I want to run the **Test Current** workflow every day at 2 in the morning. The crontab for that is: 0 2 * * * - I want to run the **Test Next Minor** workflow every Saturday at 2 in the morning. The crontab for that is: 0 2 * * 6 diff --git a/e2eTests/Test-AL-Go.ps1 b/e2eTests/Test-AL-Go.ps1 index 285c13bde..24d522db5 100644 --- a/e2eTests/Test-AL-Go.ps1 +++ b/e2eTests/Test-AL-Go.ps1 @@ -7,7 +7,6 @@ Param( [string] $template = $global:pteTemplate, [string] $adminCenterApiToken = ($global:SecureAdminCenterApiToken | Get-PlainText), [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText), - [string] $insiderSasToken = ($global:SecureInsiderSasToken | Get-PlainText), [switch] $multiProject, [switch] $appSourceApp, [switch] $private, @@ -243,8 +242,8 @@ $runs++ # Launch Current, NextMinor and NextMajor builds $runTestCurrent = RunTestCurrent -branch $branch -$runTestNextMinor = RunTestNextMinor -branch $branch -insiderSasToken $insiderSasToken -$runTestNextMajor = RunTestNextMajor -branch $branch -insiderSasToken $insiderSasToken +$runTestNextMinor = RunTestNextMinor -branch $branch +$runTestNextMajor = RunTestNextMajor -branch $branch # TODO: Test workspace diff --git a/e2eTests/Workflows/RunTestNextMajor.ps1 b/e2eTests/Workflows/RunTestNextMajor.ps1 index eab284776..8978f08df 100644 --- a/e2eTests/Workflows/RunTestNextMajor.ps1 +++ b/e2eTests/Workflows/RunTestNextMajor.ps1 @@ -2,13 +2,9 @@ Param( [switch] $wait, [string] $repository, - [string] $branch = "main", - [string] $insiderSasToken + [string] $branch = "main" ) - if ($insiderSasToken) { - SetRepositorySecret -repository $repository -name 'INSIDERSASTOKEN' -value $insiderSasToken - } $workflowName = 'Test Next Major' $parameters = @{ } diff --git a/e2eTests/Workflows/RunTestNextMinor.ps1 b/e2eTests/Workflows/RunTestNextMinor.ps1 index c89cabe06..5884588d8 100644 --- a/e2eTests/Workflows/RunTestNextMinor.ps1 +++ b/e2eTests/Workflows/RunTestNextMinor.ps1 @@ -2,13 +2,9 @@ Param( [switch] $wait, [string] $repository, - [string] $branch = "main", - [string] $insiderSasToken + [string] $branch = "main" ) - if ($insiderSasToken) { - SetRepositorySecret -repository $repository -name 'INSIDERSASTOKEN' -value $insiderSasToken - } $workflowName = 'Test Next Minor' $parameters = @{ } diff --git a/e2eTests/scenarios/BuildModes/runtest.ps1 b/e2eTests/scenarios/BuildModes/runtest.ps1 index 7b978b6e8..671923de5 100644 --- a/e2eTests/scenarios/BuildModes/runtest.ps1 +++ b/e2eTests/scenarios/BuildModes/runtest.ps1 @@ -8,8 +8,7 @@ Param( [string] $pteTemplate = $global:pteTemplate, [string] $appSourceTemplate = $global:appSourceTemplate, [string] $adminCenterApiToken = ($global:SecureAdminCenterApiToken | Get-PlainText), - [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText), - [string] $insiderSasToken = ($global:SecureInsiderSasToken | Get-PlainText) + [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText) ) Write-Host -ForegroundColor Yellow @' diff --git a/e2eTests/scenarios/GitHubPackages/runtest.ps1 b/e2eTests/scenarios/GitHubPackages/runtest.ps1 index e58ecce4f..778c75570 100644 --- a/e2eTests/scenarios/GitHubPackages/runtest.ps1 +++ b/e2eTests/scenarios/GitHubPackages/runtest.ps1 @@ -8,8 +8,7 @@ Param( [string] $pteTemplate = $global:pteTemplate, [string] $appSourceTemplate = $global:appSourceTemplate, [string] $adminCenterApiToken = ($global:SecureAdminCenterApiToken | Get-PlainText), - [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText), - [string] $insiderSasToken = ($global:SecureInsiderSasToken | Get-PlainText) + [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText) ) Write-Host -ForegroundColor Yellow @' diff --git a/e2eTests/scenarios/IncludeDependencies/runtest.ps1 b/e2eTests/scenarios/IncludeDependencies/runtest.ps1 index e21b20505..58ff35bf3 100644 --- a/e2eTests/scenarios/IncludeDependencies/runtest.ps1 +++ b/e2eTests/scenarios/IncludeDependencies/runtest.ps1 @@ -8,8 +8,7 @@ Param( [string] $pteTemplate = $global:pteTemplate, [string] $appSourceTemplate = $global:appSourceTemplate, [string] $adminCenterApiToken = ($global:SecureAdminCenterApiToken | Get-PlainText), - [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText), - [string] $insiderSasToken = ($global:SecureInsiderSasToken | Get-PlainText) + [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText) ) Write-Host -ForegroundColor Yellow @' @@ -85,8 +84,8 @@ $repoPath = (Get-Location).Path # Launch Current, NextMinor and NextMajor builds $runTestCurrent = RunTestCurrent -branch $branch - $runTestNextMinor = RunTestNextMinor -branch $branch -insiderSasToken $insiderSasToken - $runTestNextMajor = RunTestNextMajor -branch $branch -insiderSasToken $insiderSasToken + $runTestNextMinor = RunTestNextMinor -branch $branch + $runTestNextMajor = RunTestNextMajor -branch $branch # Wait for CI/CD workflow to finish WaitWorkflow -runid $run.id diff --git a/e2eTests/scenarios/ReleaseBranches/runtest.ps1 b/e2eTests/scenarios/ReleaseBranches/runtest.ps1 index e0d41b13f..f29e80eb4 100644 --- a/e2eTests/scenarios/ReleaseBranches/runtest.ps1 +++ b/e2eTests/scenarios/ReleaseBranches/runtest.ps1 @@ -8,8 +8,7 @@ Param( [string] $pteTemplate = $global:pteTemplate, [string] $appSourceTemplate = $global:appSourceTemplate, [string] $adminCenterApiToken = ($global:SecureAdminCenterApiToken | Get-PlainText), - [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText), - [string] $insiderSasToken = ($global:SecureInsiderSasToken | Get-PlainText) + [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText) ) Write-Host -ForegroundColor Yellow @' diff --git a/e2eTests/scenarios/SpecialCharacters/runtest.ps1 b/e2eTests/scenarios/SpecialCharacters/runtest.ps1 index 72d1a6e5b..f2df2794c 100644 --- a/e2eTests/scenarios/SpecialCharacters/runtest.ps1 +++ b/e2eTests/scenarios/SpecialCharacters/runtest.ps1 @@ -8,8 +8,7 @@ Param( [string] $pteTemplate = $global:pteTemplate, [string] $appSourceTemplate = $global:appSourceTemplate, [string] $adminCenterApiToken = ($global:SecureAdminCenterApiToken | Get-PlainText), - [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText), - [string] $insiderSasToken = ($global:SecureInsiderSasToken | Get-PlainText) + [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText) ) Write-Host -ForegroundColor Yellow @' diff --git a/e2eTests/scenarios/UseProjectDependencies/runtest.ps1 b/e2eTests/scenarios/UseProjectDependencies/runtest.ps1 index eab1bfa37..ccec7ccb3 100644 --- a/e2eTests/scenarios/UseProjectDependencies/runtest.ps1 +++ b/e2eTests/scenarios/UseProjectDependencies/runtest.ps1 @@ -8,8 +8,7 @@ Param( [string] $pteTemplate = $global:pteTemplate, [string] $appSourceTemplate = $global:appSourceTemplate, [string] $adminCenterApiToken = ($global:SecureAdminCenterApiToken | Get-PlainText), - [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText), - [string] $insiderSasToken = ($global:SecureInsiderSasToken | Get-PlainText) + [string] $licenseFileUrl = ($global:SecureLicenseFileUrl | Get-PlainText) ) Write-Host -ForegroundColor Yellow @' @@ -90,8 +89,8 @@ $run = RunCICD -branch $branch # Launch Current, NextMinor and NextMajor builds $runTestCurrent = RunTestCurrent -branch $branch -$runTestNextMinor = RunTestNextMinor -branch $branch -insiderSasToken $insiderSasToken -$runTestNextMajor = RunTestNextMajor -branch $branch -insiderSasToken $insiderSasToken +$runTestNextMinor = RunTestNextMinor -branch $branch +$runTestNextMajor = RunTestNextMajor -branch $branch # Wait for all workflows to finish WaitWorkflow -runid $run.id