I am using virtual machine scale set agents. I want the agent to run with admin privileges, to run interactive UI tests and to be able to access SQL server on the VM using integrated security. The easiest way I can think of for this is to have it run under a specific user account. How can I configure this?
I am afraid that Azure VMSS Agent doesn't support setting the user used to run the agent.
By default, it will create the user AzDevOps and run the agent under the AzDevOps Account.
The AzDevOps Account will be added to the Administrator Group and have admin privileges.
When we create the VMSS Agent, it will automatically use the following inheritance script to configure the VMSS Agent:
Windows Agent: Configuration File
Linux Agent: Configuration File
We are not able to change the script configuration during the agent generation.
If the interactive UI tests need additional permissions to the account, you need to grant the permission to the AzDevOps Account.
Note: If you are using Windows VMSS Agent, you can enable the option: Configure VMs to run interactive tests.
For more detailed info, you can refer to this doc: Azure Virtual Machine Scale Set agents