-
Notifications
You must be signed in to change notification settings - Fork 188
[Idea] Running PageScriptingTests and BCPT with selfhosted Containers #2171
Description
Discussed in #2001
Originally posted by ChrisBlankDe October 28, 2025
Idea Description
We want to allow running Page Scripting Tests in a self-hosted (Alpaca) container.
We are currently facing several problems:
(1) First, the pipeline failes ("... not supported on cloud pipelines yet") when you define PageScripting tests and set the AuthContext. We use the Auth Context to pass the container's credentials through the process.
See: https://github.com/microsoft/navcontainerhelper/blob/4c298652c5db938cc25ba6fe4e7c2519c49628bd/AppHandling/Run-AlPipeline.ps1#L841-L857
(2) Secondly, the Page Scripting Tests are only executed if the container itself was created ($createContainer).
See: https://github.com/microsoft/navcontainerhelper/blob/4c298652c5db938cc25ba6fe4e7c2519c49628bd/AppHandling/Run-AlPipeline.ps1#L2881
Case 1 could be solved by analyzing the bcauthcontext more deeply before automatically concluding that a SaaS environment is being used. For this purpose, one could use, for example, the scopes (https://api.businesscentral.dynamics.com/) or the audience (https://api.businesscentral.dynamics.com) Claim of the jwt. (The same applies to the bcpt tests)
For case 2, “Running Page Scripting Tests” should be outsourced to a function that can be overwritten. “Running BCPT tests” can serve as a blueprint for this.
Contribution (Optional)
- I would be open to contributing to this idea (implementation, documentation, testing, etc.)