There is a bug where if you want to test another (not published) Runtime by editing the Runbook, selecting the Runtime and hitting Test Pane
and Start
, the original (published) Runtime is used instead of the newly selected one.
In my example you can see that "bezcommon" Runtime is published.
Now lets say I want try to test the Runbook with "scommon" Runtime.
After starting the test run even the API call shows "scommon" as a used Runtime in the PUT request.
But the request response contains the published Runtime instead of the selected one as can be seen in the picture below
And according to the test job results the published Runtime was used.
How to test this?
Create two runtimes:
Runtime 'With3rdPartyModule'
- here import some 3rd party PowerShell module
Runtime 'Without3rdPartyModule'
- don't import the 3rd party module
Create a Runbook with following PowerShell code: Get-Module -listavailable
In the Runbook choose 'With3rdPartyModule' Runtime, publish the change and run it.
Now edit the Runbook and choose the second a.k.a. 'Without3rdPartyModule' Runtime and run a test job.
Now compare the results. You should see that the result contains your 3rd party module outputted in both cases!