View Source

h1. Situation
Set up QuickBuild the same as tutorial [One build For One Agent], except that build agents should be started in Azure as necessary. Launched build agents should be able to be closed if they are idle for specified amount of time to save cost.

h1. Resolution
# Set up QuickBuild according to resolution section of tutorial [One Build For One Agent].
# Login to QuickBuild as administrator and switch to administration menu, then follow the _plugin management_ link, and edit plugin setting of _Azure Plugin_ to provide Azure authentication file.
# Create appropriate build agent custom image following [this guide|launch node in Azure#create build agent image] if necessary.
# Switch to grid page and follow the _Cloud Profiles_ link to bring out the cloud profiles page. Add a cloud profile with _node launch setting_ specified as _Launch Windows Node into Azure_ or _Launch Linux Node into Azure_ and fill relevant node launch options. Specifically the _custom image resource id_ should be filled with resource id of the build agent image you created previously.
# QuickBuild will proceed to do a test launch of your defined cloud profile to grab system/user attribute of node launched by your profile. Grabbed system/user attributes will be used afterwards to match against node matcher setting of build steps to determine which profile has to be used to launch node if no active agents satisfy the criteria. Only after test launch the profile can be used by builds to launch node on demand. Normally the test launch should be done within five minutes, if it takes too long, please check resource status as well as agent log at Azure side.
# Now run the build. If configured correctly, QuickBuild will launch build agent using your defined cloud profile to run the build. By default the launched build agent will stay active for 30 minutes before terminating. If more builds are set to run in the same time, more agents will be launched to accommodate the concurrency. You may check all launched instances by examining the _active launched nodes_ tab of certain cloud profile, and may manually terminate them there.