Deployment groups are the recommended approach to use with VSTS for setting up release management based automated deployments. Can two team projects of same VSTS account with two deployment groups, have same machine as the target? Was a question in a forum and below steps describe how to achieve it.
If the script from the VSTS to setup executed as it is, when the second deployment group target is deployed the first one gets overridden. So there will be target attached to only one deployment group with the default PowerShell script execution to create deployment group target.
You can use steps below to achieve multiple deployment group targets in azure VM or any single machine.
1. Copy the target registration PowerShell script to a notepad. Then replace the
with a local path of your preference for agent for example
This will make the agent installed for project X deployment group setup in g:\vstsagentprojX.
in the script with project specific name for example
3. Then register the agent for Project X deployment group and it will be configured in the specified folder,
and with a unique service name since you have provided a project specific name for agent.
4. Follow steps similar to the other project and change its PowerShell script to have the
replace with project specific path for local folder say
Then change --agent $env:COMPUTERNAME to a project specific name such as
Then run the script to create the deployment group agent for the second project.
You should have two targets in two team project deployment groups, online.