2

We have an MSBuild we're running on Jenkins using the Azure Slave Plugin.

The jobs seem to run on the slave as user nt authority\system. How can we change this to a user of our choice?


So far, we are using default init script for the slave VMs (the VM template has everything preinstalled - JDK, Visual Studio, etc)

The job runs as Ant => Powershell [=> MSBuild, Azure commands]]

The last step (deployment commands) is the problem. We are logging into Azure with a certificate. Powershell:

$secpasswd = ConvertTo-SecureString <...> -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("...", $secpasswd)
Login-AzureRmAccount -ServicePrincipal -Tenant $mytenant -Credential $mycreds

This succeeds! but says the user has no subscriptions.

The build works fine when run by the correct user, through an RDP session.

The Jenkins job is trying to run as nt authority\system. I think it is failing to reach the Windows certificate store.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Iain
  • 1,797
  • 1
  • 20
  • 38

0 Answers0