Skip to content

Latest commit

 

History

History
77 lines (50 loc) · 3.03 KB

File metadata and controls

77 lines (50 loc) · 3.03 KB

Native agent installation

Prerequisites

Before attempting a first install, you will need to install these dependencies on your PC:

  • .NET 8.0 SDK.
  • .NET Framework 4.8.
  • Optional Windows updates and/or manual installation of serial port drivers for your nanoFramework-compatible device(s).

Agent installation

Download the latest repository source.

Download the latest agent installation runner. instructions

By default, the agent will advertise almost all your environment variables, including the username, some key directories, and many other elements. You can get rid of this by setting up the VSO_AGENT_IGNORE environment variable. Run the script with this specific setup to create this environment variable before you set up the configuration.

From your source download directory, open the terminal as administrator, then:

.\capabilities.ps1 -IgnoreAllEnv $True -SkipCapabilities $True

Follow the instructions, which will look like this:

Then, you can run ./config.cmd, where you will be prompted for:

  • the server URL: https://dev.azure.com/nanoframework
  • the authentication, use the default PAT
  • paste your Personal Access Token when asked
  • the agent pool is: TestStream
  • use the default _work directory
  • select whether you want to install the agent as a service

Copy the capabilities.ps1 file to the C:\agent folder.

Setup agent capabilities

Once you've run the previous configuration, you'll need to create a configuration.json file in the C:\agent directory (or wherever you placed the directory).

The configuration should reflect the devices you have and the associated serial ports. As an example:

{
  "capabilities": {
    "ESP32_REV0": "COM7"
  }
}

You can add as many nanoFramework-compatible hardware devices as you want. It is important to set the serial port used properly for each device added.

Important

You can also share the same hardware device with different nf-interpreter versions. Although they'll share the same serial port, at a single point in time only 1 remote pipeline is running, so there won't be any conflict with the serial ports used.

Then in PowerShell, run the following commands:

cd C:\agent
$env:AZP_TOKEN="yourPersonalAccessToken"
.\capabilities.ps1

The token will only be used during capability setup, and will then be deleted from the environment and from a temporary file that is created.

Important

You will have to run this script every time you change the capabilities, meaning, adding or removing hardware.

Run the agent

Depending on what you have chosen during the installation, it will either run as a service, or on demand. You could also create an OS task for your specific needs.

Important

When the Personal Access Token expires, you will need to rerun the configuration with your new one, there will not be a warning that it has expired.