title | description | ms.topic | ms.prod | ms.technology | ms.assetid | ms.manager | ms.author | author | ms.date | monikerRange |
---|---|---|---|---|---|---|---|---|---|---|
Deploy a build and release agent on Windows |
Learn how to use Windows Build and Release agents to build and deploy your Windows and Azure code for VSTS and TFS. |
conceptual |
devops |
devops-cicd |
20409B8F-A3A9-49A0-A418-1840BD7ADA8E |
douge |
alewis |
andyjlewis |
3/14/2018 |
>= tfs-2017 |
VSTS | TFS 2018 | TFS 2017 | TFS 2015 | Previous versions (XAML builds)
To build and deploy Windows, Azure, and other Visual Studio solutions you'll need at least one Windows agent. Windows agents can also build Java and Android apps.
Before you begin:
- If your code is in VSTS and a Microsoft-hosted agent meets your needs, you can skip setting up a private Windows agent.
- If your code is in an on-premises Team Foundation Server (TFS) 2015 server, see Deploy an agent on Windows for on-premises TFS 2015.
- Otherwise, you've come to the right place to set up an agent on Windows. Continue to the next section.
[!INCLUDE include]
Make sure your machine is prepared with our Windows system prerequisites.
If you're building from a Subversion repo, you must install the Subversion client on the machine.
[!INCLUDE permissions]
- Log on to the machine using the account for which you've prepared permissions as explained above.
- In your web browser, sign on to VSTS or TFS, and navigate to the **Agent pools** tab: [!INCLUDE [include](_shared/agent-pools-tab.md)]
- Click **Download agent**.
- On the **Get agent** dialog box, click **Windows**.
- Click the **Download** button.
- Follow the instructions on the page.
::: moniker range="vsts"
https://{your-account}.visualstudio.com
::: moniker-end
::: moniker range=">= tfs-2017 < vsts"
https://{your_server}/tfs
::: moniker-end
::: moniker range="vsts"
Choose PAT, and then paste the PAT token you created into the command prompt window.
::: moniker-end
::: moniker range=">= tfs-2017 < vsts"
Important
Make sure your server is configured to support the authentication method you want to use.
When you configure your agent to connect to TFS, you've got the following options:
-
Alternate Connect to TFS using Basic authentication. After you select Alternate you'll be prompted for your credentials.
-
Negotiate Connect to TFS as a user other than the signed-in user via a Windows authentication scheme such as NTLM or Kerberos. After you select Negotiate you'll be prompted for credentials.
-
Integrated (Default) Connect a Windows agent to TFS using the credentials of the signed-in user via a Windows authentication scheme such as NTLM or Kerberos. You won't be prompted for credentials after you choose this method.
-
PAT Supported only on VSTS and TFS 2017 and newer. After you choose PAT, paste the PAT token you created into the command prompt window. Use a personal access token (PAT) if your TFS instance and the agent machine are not in a trusted domain. PAT authentication is handled by your TFS instance instead of the domain controller.
Note
When using PAT as the authentication method, the PAT token is used only for the initial configuration of the agent. Learn more at Communication with VSTS or TFS.
::: moniker-end
For guidance on whether to run the agent in interactive mode or as a service, see Agents: Interactive vs. service.
If you configured the agent to run interactively, to run it:
.\run.cmd
If you configured the agent to run as a service, it starts automatically. You can view and control the agent running status from the services snap-in. Run services.msc
and look for "VSTS Agent (name of your agent)".
If you need to change the logon account, don't do it from the services snap-in. Instead, see the information below to re-configure the agent.
[!INCLUDE include]
To remove the agent:
.\config remove
After you've removed the agent, you can configure it again.
To learn about other options:
.\config --help
The help provides information on authentication alternatives and unattended configuration.
[!INCLUDE include]
::: moniker range="tfs-2017"
TFS version | Agent version |
---|---|
2017 RTM | 2.105.7 |
2017.3 | 2.112.0 |
::: moniker-end
::: moniker range="vsts" [!INCLUDE include] ::: moniker-end
Run the agent with self-signed certificate
Run the agent behind a web proxy
::: moniker range="vsts"
Create a .env
file under agent's root directory and put environment variables you want to set into the file as following format:
MyEnv0=MyEnvValue0
MyEnv1=MyEnvValue1
MyEnv2=MyEnvValue2
MyEnv3=MyEnvValue3
MyEnv4=MyEnvValue4
::: moniker-end
::: moniker range="vsts" [!INCLUDE include] ::: moniker-end
::: moniker range="vsts" [!INCLUDE include] ::: moniker-end
::: moniker range="< vsts" [!INCLUDE include] ::: moniker-end