Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to Publish my app To AppSource but i get this Error Message: Cannot bind argument to parameter 'authContext' #829

Closed
fofanasbsi opened this issue Nov 17, 2023 · 5 comments
Labels
Need more info Please add more info about how to repro the problem

Comments

@fofanasbsi
Copy link

fofanasbsi commented Nov 17, 2023

Hello Freddy,
I've been trying to migrate my app in AppSource in the CI/CD under github actions, but I'm getting this error.
I don't know what mistake I'm making.

Error: Unexpected error when running action. Error Message: Cannot bind argument to parameter 'authContext' because it is null., StackTrace: at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v4.0\Deliver\Deliver.ps1: line 467 <- at <ScriptBlock>, D:\a\_temp\d055374f-e5ff-4f35-bea8-30781453e01c.ps1: line 4 <- at <ScriptBlock>, <No file>: line 1 
[87](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:90)Error: Process completed with exit code 1.

Run microsoft/AL-Go-Actions/Deliver@v4.0 
[46](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:46) with: 
[47](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:47) shell: powershell 
[48](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:48) parentTelemetryScopeJson: 7b22506172616d6574657273223a7b7d2c22456d6974746564223a66616c73652c22436f7272656c6174696f6e4 
[49](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:49) type: Release 
[50](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:50) projects: * 
[51](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:51) deliveryTarget: AppSource 
[52](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:52) artifacts: current 
[53](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:53) goLive: N 
[54](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:54) actor: fofanasbsi 
[55](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:55) token: *** 
[56](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:56) atypes: Apps,Dependencies,TestApps 
[57](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:57) env: 
[58](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:58) ALGoOrgSettings: 
[59](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:59) ALGoRepoSettings: 
[60](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:60) Settings: {"keyVaultCertificateUrlSecretName":"","microsoftTelemetryConnectionString":"InstrumentationKey=84bd9223-67d4-4378-8590-9e4a46023be2;IngestionEndpoint=https://westeurope-1.in.applicationinsights.azure.com/","type":"AppSource App","sendExtendedTelemetryToMicrosoft":false,"appBuild":7,"installTestApps":[],"versioningStrategy":0,"installApps":[],"installTestLibraries":false,"runNumberOffset":0,"codeSignCertificatePasswordSecretName":"codeSignCertificatePassword","vsixFile":"","country":"us","partnerTelemetryConnectionString":"","doNotRunTests":false,"githubRunner":"windows-latest","generateDependencyArtifact":true,"excludeEnvironments":[],"keyVaultCertificatePasswordSecretName":"","rulesetFile":"","licenseFileUrlSecretName":"licenseFileUrl","enableExternalRulesets":false,"memoryLimit":"","keyVaultClientIdSecretName":"","testFolders":[],"doNotBuildTests":false,"environments":[],"companyName":"","assignPremiumPlan":false,"artifact":"","ghTokenWorkflowSecretName":"ghTokenWorkflow","enableTaskScheduler":false,"enableCodeCop":false,"repoVersion":"1.0","doNotPublishApps":false,"unusedALGoSystemFiles":[],"githubRunnerShell":"powershell","appFolders":[],"runs-on":"windows-latest","cacheKeepDays":3,"bcptTestFolders":[],"updateDependencies":false,"cacheImageName":"my","treatTestFailuresAsWarnings":false,"AppSourceProductId":"adafcdca-c504-4fb6-8b23-081d4a7c0922","additionalCountries":[],"enableUICop":false,"customCodeCops":[],"appDependencies":[],"doNotRunBcptTests":false,"appDependencyProbingPaths":[],"useCompilerFolder":false,"installTestFramework":false,"keyVaultCodesignCertificateName":"","keyVaultName":"","installOnlyReferencedApps":true,"obsoleteTagMinAllowedMajorMinor":"","applicationDependency":"18.0.0.0","applicationInsightsConnectionStringSecretName":"applicationInsightsConnectionString","shell":"powershell","failOn":"error","templateUrl":"https://github.com/microsoft/AL-Go-AppSource@main","projects":[],"projectName":".","testDependencies":[],"appRevision":0,"codeSignCertificateUrlSecretName":"codeSignCertificateUrl","configPackages":[],"useProjectDependencies":false,"appSourceCopMandatoryAffixes":["\u003caffix\u003e","BingMaps"],"buildModes":[],"templateBranch":"","installPerformanceToolkit":false,"PullRequestTrigger":"pull_request_target","doNotSignApps":false,"repoName":"AppSource","fullBuildPatterns":[],"alwaysBuildAllProjects":false,"skipUpgrade":false,"installTestRunner":false,"adminCenterApiCredentialsSecretName":"adminCenterApiCredentials"} 
[61](https://github.com/fofanasbsi/AppSource/actions/runs/6903051034/job/18780979659#step:5:61) Secrets: {"appSourceContext":""}
@freddydk
Copy link
Contributor

If you could include the full log of the deliver action, then I might be able to see what's wrong.
My assumption is that your AppSourceContext secret is somehow wrong

@freddydk freddydk added the Need more info Please add more info about how to repro the problem label Nov 22, 2023
@Steven-SBSI
Copy link

Hello,

Here is the full log, is it enough or do you need more details ?

Let me know.

@Steven-SBSI
Copy link

Run microsoft/AL-Go-Actions/Deliver@v4.0
Run $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
Downloading BcContainerHelper latest version from CDN
Import from C:\ProgramData\BcContainerHelper\6.0.0\BcContainerHelper\BcContainerHelper.ps1
BcContainerHelper version 6.0.0
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Applying settings from D:\a\AppSource\AppSource.github\AL-Go-Settings.json
Applying settings from D:\a\AppSource\AppSource.AL-Go\settings.json
No settings found in D:\a\AppSource\AppSource.github\Publish To AppSource.settings.json
No settings found in D:\a\AppSource\AppSource.AL-Go\Publish To AppSource.settings.json
No settings found in D:\a\AppSource\AppSource.AL-Go\fofanasbsi.settings.json
Artifacts latest
Projects:
.
Project 'AppSource'
Analyzing artifacts matching -main--*
https://api.github.com/repos/fofanasbsi/AppSource/actions/artifacts?per_page=100&page=1
Matching artifacts:

  • AppSource-main-Apps-1.0.19.0
    Downloading artifact AppSource-main-Apps-1.0.19.0
    https://api.github.com/repos/fofanasbsi/AppSource/actions/artifacts/1057241345/zip
    D:\a\AppSource\AppSource.artifacts\AppSource-main-Apps-1.0.19.0.zip
    Analyzing artifacts matching -main--*
    https://api.github.com/repos/fofanasbsi/AppSource/actions/artifacts?per_page=100&page=1
    Matching artifacts:
  • No matching artifacts found
    WARNING: Could not find any Dependencies artifacts for projects *, version latest
    Artifacts:
  • AppSource-main-Apps-1.0.19.0
    Applying settings from D:\a\AppSource\AppSource.github\AL-Go-Settings.json
    Applying settings from D:\a\AppSource\AppSource.AL-Go\settings.json
    No settings found in D:\a\AppSource\AppSource.github\Publish To AppSource.settings.json
    No settings found in D:\a\AppSource\AppSource.AL-Go\Publish To AppSource.settings.json
    No settings found in D:\a\AppSource\AppSource.AL-Go\fofanasbsi.settings.json
    Analyzing repository
    Checking type
    Checking appFolders, testFolders and bcptTestFolders
    Application Dependency 2***.0
    Updating app- and test Dependencies
    Analyzing Test App Dependencies
    No performance test apps found in bcptTestFolders in .AL-Go\settings.json
    Azure.Storage Module is available in version 2.1.0
    Using Azure.Storage version 2.1.0

Authentication failed
AppSource MainAppFolder .\AppSourceWorkFlow
Main App File:

  • MohamedFOFANA_AppSourceWorkFlow_1.0.19.0.app
    Library App Files:
  • None
    Submitting to AppSource
    AL-Go action ran: Deliver Telemetry Correlation Id: 2a9c1a20-13e2-46ee-9381-f314d6c5e66d
    Error: Unexpected error when running action. Error Message: Cannot bind argument to parameter 'authContext' because it is null., StackTrace: at , D:\a_actions\microsoft\AL-Go-Actions\v4.0\Deliver\Deliver.ps1: line 467 <- at , D:\a_temp\1b3f568e-2686-4437-8937-055075aff443.ps1: line 4 <- at , : line 1
    Error: Process completed with exit code 1.

@freddydk
Copy link
Contributor

freddydk commented Dec 8, 2023

It looks like your AppSourceContext secret is empty???
AppSourceContext secret needs ot be compressed JSON containing the ClientId and ClientSecret for the app you have registered in partner center.

Example:

{"clientID":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","clientSecret":"ixxxxxxxxxxxxxxxxxx","tenantID":"yourtenant.com","Scopes":"https://api.partner.microsoft.com/.default"}

@Steven-SBSI
Copy link

No, not empty but with wrong information.

Thanks.
Steven

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need more info Please add more info about how to repro the problem
Projects
None yet
Development

No branches or pull requests

3 participants