How to setup build agent and create a build definition manually

If you run into any issue with your build machine deployment and would like to manually retry the build agent setup and build definition creation, then follow these steps (These steps are for a build environment machine deployed from LCS. Developer machine will not have the folder and files mentioned below)

Setup build agent

  1. Open powershell command prompt as Administrator
  2. Go to C:\DynamicsSDK and run the following script -
    • C:\DynamicsSDK> .\SetupBuildAgent.ps1 -VSO_ProjectCollection "https://yourproject.visualstudio.com/DefaultCollection" -AosWebsiteName "<Name of Local AOS website>" -VSOAccessToken "<Your VSTS access token>" -AgentName "< Optional - Some recognizable agent name if you want>" -AgentPoolName "<Optional - If you have created a new agent pool you can add this here, otherwise we use Default agent pool>" -Force
    • -Force switch is required if there was previous attempt to setup the build agent on that machine. It will ensure cleanup of the old agent and configuring it again.
  3. Once the script run completes you should be able to see the new agent added to your agent pool.

Create new build definition

  1. Open powershell command prompt as Administrator
  2. Go to C:\DynamicsSDK and run the following script -
    • C:\DynamicsSDK> .\BuildEnvironmentReadiness.ps1 -VSO_ProjectCollection "https://yourproject.visualstudio.com/DefaultCollection" -ProjectName "<Name of the project you want build definition to be uploaded under>" -VSOAccessToken "<Your VSTS access token>" -AosWebsiteName "<Name of Local AOS website>" -AgentPoolName "<Optional - If you have created a new agent pool you can add this here, otherwise we use Default agent pool>" -Branch "<Optional - branch you are trying to build, default is Main>" -BuildDefinitionName "<Optional - Custom build definition name, default is AX7 - Build <branch name>" -Force
    • Note - The -Force switch is useful if you want to overwrite the build definition and AXModulesBuild.proj file which is already present under your project.
  3. Once the script run completes you should be able to see the new build definition added to your project.

 

Note - You can find out your Local AX Website Name by opening up IIS manager. Here it is "AOSService"

AOS website name