If your build and release pipelines are in VSTS, then you've got a convenient option to build and deploy using a Microsoft-hosted agent. When you use a Microsoft-hosted agent, we take care of the maintenance and upgrades. So for many teams this is the simplest way to build and deploy. You can try it first and see if it works for your build or deployment. If not, you can set up a self-hosted agent.
You can try a Microsoft-hosted agent for no charge. If your build or release doesn't succeed, the issues will be reported in the logs.
Use a Microsoft-hosted agent
To use a Microsoft-hosted agent pool, first decide which queue to use:
|If your development team uses...||...then choose this queue|
|Visual Studio 2017||Hosted VS2017|
|Development tools on Ubuntu||Hosted Linux|
|Docker containers||Hosted Linux or Hosted VS2017|
|.NET Core||Hosted Linux (optimal) or Hosted VS2017|
|Development tools on macOS||Hosted macOS (see notes below)|
|Visual Studio 2013 or Visual Studio 2015||Hosted|
Then, while editing your build pipeline, on the Options or General tab or Process step, for the Agent queue, select the queue you decided on.
Notes on choosing Hosted macOS:
- This option affects where your data is stored. Learn more
- For manual selection of tool versions on this Microsoft-hosted agent, see Q & A below.
- To disable the Hosted macOS agent pool for all projects, disable the
Hosted Agentcheckbox under Admin settings > Agent pools > Hosted macOS.
- To disable the Hosted macOS agent pool for a specific project, disable the
Hosted Agentcheckbox under Project settings > Agent pools > Hosted macOS.
Software on Microsoft-hosted agents is updated once each month.
- Inventory of software currently installed on the Hosted VS2017 agent.
- Inventory of software currently installed on the Hosted Linux agent.
- Inventory of software currently installed on the Hosted macOS agent.
- Inventory of software currently installed on the Microsoft-hosted agent.
Capabilities and limitations
Provide at least 10 GB of storage.
Can run jobs for up to 6 hours (30 minutes on the free tier).
Currently utilizing Microsoft Azure general purpose virtual machine sizes (Standard_DS2_v2 and Standard_DS3_v2)
Microsoft-hosted agents do not offer:
The ability to log on.
The ability to drop artifacts to a UNC file share.
The ability to run XAML builds.
Potential performance advantages that you might get by using self-hosted agents which might start and process builds faster. Learn more
If Microsoft-hosted agents don't meet your needs, then you can deploy your own self-hosted agents.
Avoid hard-coded references
When you use a Microsoft-hosted agent, you should always use variables to construct any references to resources used by your build. We recommend that you avoid making hard-coded presumptions about resources provided by Microsoft-hosted agents (for example, the drive letter or folder that contains the repository).
Q & A
I can't select a Microsoft-hosted agent and I can't queue my build or deployment. How do I fix this?
By default, all project contributors in an organization have access to the Microsoft-hosted agents. But, your organization administrator may limit the access of Microsoft-hosted agents to select users or projects. Ask the owner of your VSTS organization to grant you permission to use a Microsoft-hosted agent. See agent queue security.
I need more agents. What can I do?
A: All VSTS organizations are provided with a single agent and a limited number of free minutes each month. If you need more minutes, or need to run more than one build or release job concurrently, then you can buy concurrent jobs.
I'm looking for the Microsoft-hosted XAML build controller. Where did it go?
The Microsoft-hosted XAML build controller is no longer supported. If you have an organization in which you still need to run XAML builds, you should set up a self-hosted build server and a self-hosted build controller.
How can I manually select versions of tools on the Hosted macOS agent?
To manually select a Xamarin SDK version to use on the Hosted macOS agent, before your Xamarin build task, execute this command line as part of your build, replacing the Mono version number 5.4.1 as needed (also replacing '.' characters with underscores: '_'). Choose the Mono version that is associated with the Xamarin SDK version that you need.
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_4_1"
Mono versions associated with Xamarin SDK versions on the Hosted macOS agent can be found here.
Note that this command does not select the Mono version beyond the Xamarin SDK. To manually select a Mono version, see instructions below.
If you use the Xcode task included with VSTS and TFS, you can select a version of Xcode in that task's properties. Otherwise, to manually set the Xcode version to use on the Hosted macOS agent, before your
xcodebuildbuild task, execute this command line as part of your build, replacing the Xcode version number 8.3.3 as needed:
/bin/bash -c "sudo xcode-select -s /Applications/Xcode_8.3.3.app/Contents/Developer"
Xcode versions on the Hosted macOS agent can be found here.
To manually select a Mono version to use on the Hosted macOS agent, before your Mono build task, execute this script in each phase of your build, replacing the Mono version number 5.4.1 as needed:
SYMLINK=5_4_1 MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK echo "##vso[task.setvariable variable=DYLD_FALLBACK_LIBRARY_PATH;]$MONOPREFIX/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH" echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH" echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
We recommend that you migrate your XAML builds to new builds.