Deployment script is running under machine account and not under test agent account

Recently one of the customer asked an interesting question that his test agent is running under a local account (machineName\myaccount) but the deployment script is not running under that account and is rather running under a machine account. This was happening because the deployment script is actually executed by the lab agent, a separate service named “visual studio lab agent” on the lab machine, and not by the test.agent. The lab agent on that machine was running under the default “system” account.

The reason for using lab agent and not test agent to execute the script is because the lab agent runs under a high privilege machine account while test agent runs under a very low privilege account and changing the privilege of the test account was not an option as it is used to execute code (read tests).

Comments (2)
  1. Aaron says:

    Is there any way to change this so the deployment runs under the test agent account?

    In our situation, the deployment item needs to start up an interactive process that runs through the entire test run.

  2. You should change the service account of "visual studio lab agent" to achieve this. Please try this out and let me know in case it does not work.

Comments are closed.

Skip to main content