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

Publish per Tenant App #8

Open
antonyotto opened this issue Apr 23, 2020 · 8 comments
Open

Publish per Tenant App #8

antonyotto opened this issue Apr 23, 2020 · 8 comments

Comments

@antonyotto
Copy link

antonyotto commented Apr 23, 2020

Hi Kine,

thanks for the tools.
I'm trying to setup the pipelines to publish App to online sandbox. I received below error in the pipeline and the App is successfully published. Any idea why ?

Thanks.

020-04-23T05:46:24.6853430Z ##[debug]Caught exception from task script.
2020-04-23T05:46:24.6885409Z ##[debug]Error record:
2020-04-23T05:46:24.8596776Z ##[debug]Get-ALAppPublicationStatus : Cannot index into a null array.
2020-04-23T05:46:24.8610876Z ##[debug]At C:\Users\xxxx\Documents\WindowsPowerShell\Modules\NVRAppDevOps\1.0.10\Upload-PerTenantApp.ps1:35 char:23
2020-04-23T05:46:24.8624420Z ##[debug]+ ... $Status = Get-ALAppPublicationStatus -AppId $AppId -AppSecret $AppS ...
2020-04-23T05:46:24.8638220Z ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-04-23T05:46:24.8659418Z ##[debug] + CategoryInfo : InvalidOperation: (:) [Get-ALAppPublicationStatus], RuntimeException
2020-04-23T05:46:24.8673187Z ##[debug] + FullyQualifiedErrorId : NullArray,Get-ALAppPublicationStatus
2020-04-23T05:46:24.8687722Z ##[debug]
2020-04-23T05:46:24.8713010Z ##[debug]Script stack trace:
2020-04-23T05:46:24.8746510Z ##[debug]at Get-ALAppPublicationStatus, C:\Users\xx\Documents\WindowsPowerShell\Modules\NVRAppDevOps\1.0.10\Get-ALAppPublicationStatus.ps1: line 35
2020-04-23T05:46:24.8759320Z ##[debug]at Upload-PerTenantApp, C:\Users\xxx\Documents\WindowsPowerShell\Modules\NVRAppDevOps\1.0.10\Upload-PerTenantApp.ps1: line 35
2020-04-23T05:46:24.8774389Z ##[debug]at , C:\Users\xxx\Downloads\vsts-agent-win-x64-2.165.2_work_tasks\publishbcapppertenant_047393e1-82e4-4d24-8275-237409bb378e\1.0.3\publishtenanttask.ps1: line 27
2020-04-23T05:46:24.8787079Z ##[debug]at , : line 1
2020-04-23T05:46:24.8801035Z ##[debug]at , : line 22
2020-04-23T05:46:24.8821032Z ##[debug]at , : line 18
2020-04-23T05:46:24.8835506Z ##[debug]at , : line 1
2020-04-23T05:46:24.8861615Z ##[debug]Exception:
2020-04-23T05:46:24.8914370Z ##[debug]System.Management.Automation.RuntimeException: Cannot index into a null array.
2020-04-23T05:46:24.8926562Z ##[debug] at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
2020-04-23T05:46:24.8943100Z ##[debug] at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) 2020-04-23T05:46:24.8958536Z ##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) 2020-04-23T05:46:24.8974329Z ##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) 2020-04-23T05:46:24.8991809Z ##[debug] at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) 2020-04-23T05:46:24.9006563Z ##[debug] at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) 2020-04-23T05:46:24.9018984Z ##[debug] at System.Management.Automation.PSScriptCmdlet.RunClause(Action1 clause, Object dollarUnderbar, Object inputToProcess)
2020-04-23T05:46:24.9033338Z ##[debug] at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
2020-04-23T05:46:24.9045536Z ##[debug] at System.Management.Automation.CommandProcessorBase.Complete()
2020-04-23T05:46:24.9331913Z ##[error]Cannot index into a null array.
2020-04-23T05:46:24.9342420Z ##[debug]Processed: ##vso[task.logissue type=error]Cannot index into a null array.
2020-04-23T05:46:24.9344123Z ##[debug]Processed: ##vso[task.complete result=Failed]

@kine
Copy link
Owner

kine commented Apr 23, 2020

Hi @antonyotto,
have re-read the log you sent and it seems that the problem is, that the call reading the status have not returned anything. It could be some timing issue or I do not know. Will try on my side. Have it worked before? Are you getting this each time or when you re-run the stage it goes trough?

@kine
Copy link
Owner

kine commented Apr 23, 2020

Hmm... unable to test on my side, because we have activated MFA on our users accounts to fulfill MS requirements and thus I am unable to publish the apps from pipeline (no support for service accounts yet and the current way doesn't support MFA). This is rendering the Password Grant OAuth unusable (but of course, it was never recommended to use this grant type, but it was only possible way).

@antonyotto
Copy link
Author

Hi Kine,
Thanks for the reply, this is the first time I used it and I tried few times but the result is the same
I will try to run it directly from Powershell and see if it work.

Thanks,

@antonyotto
Copy link
Author

antonyotto commented Apr 23, 2020

It works if I directly use powershell script instead of using task publishbcapppertenant

Upload-PerTenantApp -AppId [xx] -AppSecret [xx] -Tenant [xx] -AppPath "C:\artifact\Default publisher_TestBuild_1.4.0.0.app" -Environment Sandbox -APIVersion v1.0 -Credential $mycreds -WaitForResult
Getting OAuth token...
Getting companies...
Getting uploading extension to company 83b8f35c-fb52-ea11-bb59-00155df3a615 (CRONUS NZ)...
Getting last publishing status from company 83b8f35c-fb52-ea11-bb59-00155df3a615...
Last status: TestBuild Default publisher 1.4.0.0 InProgress
Getting last publishing status from company 83b8f35c-fb52-ea11-bb59-00155df3a615...
Last status: TestBuild Default publisher 1.4.0.0 InProgress
Getting last publishing status from company 83b8f35c-fb52-ea11-bb59-00155df3a615...
Last status: TestBuild Default publisher 1.4.0.0 InProgress
Getting last publishing status from company 83b8f35c-fb52-ea11-bb59-00155df3a615...
Last status: TestBuild Default publisher 1.4.0.0 Completed

@kine
Copy link
Owner

kine commented Apr 24, 2020

Ok. If it works manually and not in pipeline, than double check that all parameters in the pipelines are passed correctly. Are you using your own agent or hosted?

@antonyotto
Copy link
Author

antonyotto commented Apr 24, 2020 via email

@kine
Copy link
Owner

kine commented Apr 24, 2020

Ok, than the problem must be in the parameters of the step. Could you send me log from the pipeline? I want to see the xxxx-expanded.yaml file from the full logs.

@antonyotto
Copy link
Author

Sorry. I have remove the pipeline. I will re-create it and send you the log. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants