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.
![User's image](https://learn-attachment.microsoft.com/api/attachments/5e1bca57-dfd9-4235-b517-f4c093337429?platform=QnA)
Now lets say I want try to test the Runbook with "scommon" Runtime.
![User's image](https://learn-attachment.microsoft.com/api/attachments/cff4150b-b0ab-4f03-b5c3-89536a31cd13?platform=QnA)
After starting the test run even the API call shows "scommon" as a used Runtime in the PUT request.
![User's image](https://learn-attachment.microsoft.com/api/attachments/f0a54d97-1657-4cfa-9cf1-f0ff1e53d033?platform=QnA)
But the request response contains the published Runtime instead of the selected one as can be seen in the picture below![User's image](https://learn-attachment.microsoft.com/api/attachments/44ae0ae2-6234-470c-805c-d8a6d78299a8?platform=QnA)
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!