- First create a VM with all the required software installed in it.
- Create a VM image out of the VM created . VM image creation is explained in previous post. Click here to see VM image creation post.
- Open Azure Cloud Shell and execute following commands.
az account set -s <your subscription ID>
- Create resource group to isolate all the resources linked with scale set agent.
az group create --location <location> --name <myresourcegroup>
- Create scale set agents using the VM image.
az vmss create --resource-group <myresourcegroup> --name <myscalesetname> --image <mycustomvmimage> --admin-username <myuser> --admin-password <mypassword> --instance-count <count> --disable-overprovision --upgrade-policy-mode manual --load-balancer '""'
- Once command executed successfully, scale set will be provisioned similar to follows.
- Now move to the Azure DevOps project settings and go to Agent pools.
- Click on Add pools to add new pool.
- Pane will be opened to enter new pool details. Select scale set and give other relevant information.
1 - Select scale set from the drop down
2 - Give name for the agent pool
3 - If selected "Automatically teat down virtual machines after every use" .It will delete the agent after use
4 - Maximum number of VMs create in the scale set on demand
5 - Number of VMs up and running in the scale set on idle state
You can use this agent pool in Azure DevOps builds and releases. Once build is triggered, agents will be provisioned on demand. Once build is completed, it will discard after some time. Hence, azure scale set agent users can use private agents in a cost effective way.
No comments:
Post a Comment