-
Notifications
You must be signed in to change notification settings - Fork 14
How to use
All you need to do is:
- add the "RunAs" TeamCity Build Feature or use the advanced options "Run as" of any build step
- specify the user name for RunAsUser. For Windows the following formats are acceptable: username or username@domain or domain\username
- specify the password
That's it! Once the build is run, the plugin runs all commands under the specified Windows user account.
Sometimes there is a case when all build steps on a TeamCity agent should be runned under the specific user account. To use this scenario you should:
-
Disable UI extensions for runAs plugin via TeamCity server parameters. For example using the
-Dteamcity.runas.ui.enabled=false
command line argument -
Configure runAs tool settings using the TeamCity configuration parameters or in the file
buildAgent\conf\buildAgent.properties
for each build agent: run_as_user - for user name, secure:run_as_password - for password and run_as_additional_args - for additional command line arguments for runAs tool. For example the filec:\buildAgent\conf\buildAgent.properties
may contain the following additional lines:
run_as_user=MyUser
secure\:run_as_password=MyPassword