Getting started with DevTest Labs Custom Artifact Development
As a part of a recent Rangers project, our team of experts set out to develop custom artifacts for use with DevTest Labs. Some of the great contributions that have been assimilated into the azure-devtest-labs GitHub repo include:
- Install Google Chrome (Esteban)
- JDKs for Linux (Darren)
- Set up Web Deploy server (Martin)
- Install Sublime Text (Igor)
- Install Slack (Igor)
- NPM Package (Derek)
- Selenium Grid (Oscar)
- Apt-Get (Derek)
- Yum Package (Derek)
- gVim (Cream) for Windows (Derek)
Additional out of band work continues with:
- Install Chef DK on Linux VMs
- Install GUI on Linux VMs
- Run DSC Scripts
- Install Chef DK on Windows VMs
We learned a lot of lessons during this project, and we'd like to start by sharing some practical guidance to anyone who may be interested in developing custom artifacts for use with DevTest Labs VMs. Part 1 of this series will center around getting your development environment ready to develop artifacts.
Recommended Tools
The team used the following tools to create, edit and refine DevTest Lab artifacts:
- Visual Studio Code
- JSON editor
- Provides intellisense for JSON file
- git client - push changes to VSTS git/Github repositories
- Git
- Clone VSTS git repositories
- Clone Github repositories
- Git Credential Manager for Windows
- Securely caches your git credentials in Windows credential store.
- Enter your credentials only once to connect to git repositories.
- Next time, credentials are seamlessly reused so you don’t have to type them again.
Development Environment Setup
To quickly get started with VS Code and start developing artifacts, please use the following as a guide. For Linux development, please be sure to swap out C:/
for the directory of your choice.
Also, for Linux, please use the appropriate package manager (apt-get, yum, zypper, etc.) to download and install Git and related credential manager. You can download the latest Linux bits from the Visual Studio Code site. This will effectively bypass steps 1 and 2.
- Install Chocolatey (Windows)
- Run the following in a new command shell as administrator (Start -> type
cmd
-> Right-click and “Run as Administrator”)
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
- Run the following in a new command shell as administrator (Start -> type
- Install Git, Visual Studio Code and Git Credential Manager for Windows
- Run
cmd
as administrator
choco install git visualstudiocode git-credential-manager-for-windows
- See: choco install command
- Run
- Clone vsarAzureDevTest VSTS git repository
- Run
cm``git clone https://%ACCOUNT-NAME%.visualstudio.com/DefaultCollection/%TEAM-PROJECT%/_git/%REPO% C:/%WORK-FOLDER%
- See git clone
- Example
git clone https://almrangers.visualstudio.com/DefaultCollection/ALM/_git/vsarAzureDevTest C:/ALMRangers-DTL
- Enter
user name
andpassword
(wherepassword
may be a Personal Access Token)
- Run
- Clone the github repository
- Example:
git clone https://github.com/Azure/azure-devtestlab.git C:/Azure-DTL
- Example:
- Open Visual Studio Code and open the work folder folder, example C:/ALMRangers-DTL.
Now you are ready to start developing your custom artifact.
Next ... in Developing Custom Artifacts for DevTest Labs: Tips and Tricks will cover some essential Do's and Dont's when developing artifacts.
Stay tuned!