Long time user of Release Management, though only up until TFS 2015 previously. I used to achieve role based deployments by creating "machine groups" for each environment, listing the server FQDNs, ports and tags (roles) along with some credentials. I could then leverage these details in release definitions by specifying the machine name as the name of the machine group and then use the tags filter criteria to pin down which server roles the action would run against/on.
I'm now working on TFS 2017 and stated in the "machine groups" section is that the functionality is deprecated, rendering it unusable. Documentation online talks of its replacement: "deployment groups" but this only arrived in TFS 2018! So is TFS 2017 without any form of environment level role based deployment solution?! The machine groups tag suggests "use a comma delimited list of machine IP addresses or FQDNs together with ports in all your build and release definitions" - that seems like an unworkable solution to me! Please someone tell me I'm missing something!
Unfortunately TFS 2017 doesn't support Deployment groups.
Deployment group targets feature only available with TFS 2018 and later version including Azure DevOps. Please see Deployment groups for details.
So, to use the Deployment group you could upgrade to TFS 2018 or migrate to Azure DevOps.
In tfs 2017 you could list the machines use a comma delimited list of machine IP addresses or FQDNs together with ports... You can also create Task Group and set deployment settings in the task group, thus you can directly use that Task Group in your build definitions... Please see Task groups for builds and releases for details.
Related
Microsoft Visual Studio Team Foundation Server - Version 16.131.28106.2
Agent.OS Windows_NT
Agent.OSVersion 6.3.9600
Agent.Version 2.136.1
My TFS build agent is not identifying Visual Studio 2017(Enterprise) as a capability while running as a service(under a service account on my primary domain). That same agent does identify Visual Studio 2015 as a capability while running as a service under the same account as above.
I've updated the agent, removed and reconfigured the build agent in question, restarted the agent-service, and restarted the OS. I did notice that when this agent is first configured, the capability is briefly identified while the agent runs under the individual running the configure script, but when the agent switches over to running under the service account, the VS2017 capabilities disappear.
After noticing this, I gave the service account in question read and execute privileges on the root Windows install dir, 'Program Files (x86), and all directories and files associated with the VS2017 install, but this didn't help.
If I run a different build agent interactively(same version as listed above), VS2017 is identified as a capability, so I'm assuming there is something I need to do in regards to the service account I'm attempting to use.
For good measure, within the Visual Studio build task, I tried using the 'latest' option and the 'Visual Studio 2017' options. I also tried adding '/p:VisualStudioVersion=15.0' to the MSBuild args for this task.
Update: I also tried explicitly specifying the capabilities directly in the 'User-Defined' section, and I tried adding the capabilities through the use of environment variables on the agent host.
Have you ensured that the service account user is added as the role service account on the pool the agent is running on?
Also ensure that the service account is able to do the following in these Local Security Policies: "logon as a service", "act as part of the operating system", "Manage auditing and security log"
I can't say that this will be able to solve your problem, but I just know that these are necessary in the setups I handle.
You could also for quick and easy test add you service account as an administrator on the machine and test if it finds VS 2017 then. If it does, then you know you need to set some specific groups and permissions.
I am using TFS 2018. I successfully created a "Hello World" MVC and SQL Server project. I was able to build and release the project to the target server.
To make sure I had the method down correctly, I created a second "Hello World" MVC project. I was able to build it successfully. The only problem was that when I went to the "Deployment Groups", I didn't see anything there, even though the target server already has a Deployment Machine running.
I figured the problem is that I need to share the Deployment Machine. So I read the instructions for Deployment Groups here:
Add a deployment pool and group to another project
To manage a deployment pool, or to add an existing deployment pool and
the groups it contains to another project, choose the Manage link in
the Agent Pool section of the Deployment Group page. In the Deployment
Pools page, select the projects for which you want the deployment
group to be available, then save the changes.
When you navigate to the Deployment Groups page in the target
project(s), you will see the deployment group you added and you can
assign project-specific machine tags as required.
The problem is that while I have a "Deployment Group" page, I do not see any "Agent Pool", "Manage", or Deployment Group". (See screenshots immediately below).
Am I missing something obvious? Is this a case of the instructions really being meant for VSTS and/or Azure, but not TFS?
I selected the deployment group and see the machine that I registered on my target server.
Even when expanding the machine, I don't see any options to share.
In summary, what I do have to do in order to share this Deployment Machine, so that I can release different projects to the same server?
At the collection level, we do have a "Deployment Pool (similar to Agent Pools)". However, it is only available in VSTS for now.
Can you tell me if this feature will be integrated in the TFS 2018's next update ? and when this update should be available ?
We are hoping to get it in the next update in TFS. Tentatively in
TFS 2018 Update 2.
This feature seems will come up on TFS 2018 update2, details please refer this link: Why are deployment groups project specific?
Sharing of deployment group targets feature will be available with TFS 2018 Update 2. On earlier version, you have an option of installing multiple agents. Please note, multiple agents can run the deployments in parallel and can overstep on each other for shared resources.
If upgrading to update 2 is not a possibility, you can modify your registration script to make the computer name dynamic:
modify this:
--deploymentgroup --agent $env:COMPUTERNAME --runasservice
with this:
--deploymentgroup --agent $env:COMPUTERNAME-$destFolder --runasservice
$destFolder basically makes the agent name unique, allowing you to register the same machine in multiple deployment groups.
If you get a message saying
The request was aborted: Could not create SSL/TLS secure channel
run the following command before provisioning.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
So, I tried to upgrade my TFS 2015 to allow project with .NET 4.6.1.
I downloaded the Targeting Pack for .NET 4.6.1, ran it, restarted the server, ran my build configuration for the build agent by overwriting the old settings, and started my builds.
Now non of them will build :(
I think I miss setting a parameter somewhere.
This is my agent, which is registered, but never requested (for some odd reason):
Am I missing something?
According to your agent.version 1.95.3, seems you are using TFS2015 update3 which should definitely support .Net 4.6.1. And the system capabilities of your agent looks okay except the Number_OF_PROCESSOR. Your value is 1, but usually the default is 8. Did you manually change the value during the configure?
Recommend you follow below way to narrow down this issue:
First check in that if the build server is available and enabled in
TFS at https://YOURCOMPANYNAME:8080/tfs/_admin/_AgentQueue, and
your build agent should be “Green”.
Make sure the agent is in interactive mode.
Try to change a domain account which is a member of the Build
Agent Service Accounts group and belongs to "Agent Pool Service
Account" role, to see whether the agent would work or not.
Double check whether there are some Firewall interface block the
build, try to disable all related settings.
If it's still not work, delete that agent and re-deploy a new one following the detail steps in this article. You can also go through below similar questions to check if there is some useful info :
TFS 2015 On-premise issues
TFS 2015 build vNext - hangs with "Waiting for console output from
an agent..."
TFS 2015 Build agent won't start
I have some problems with our TFS 2015 Build in our off shore location.
We have our main TFS in Austria and an already working proxy (TFS 2013) in India.
I have created a TFS 2015 Buildagent which is also working but it is not able to gather the files from the proxy.
I have configured the build machine like it is stated on this Microsoft site:
https://msdn.microsoft.com/en-us/library/cc716770(v=vs.120).aspx
But it still downloads all the files from our TFS which takes up to 15 Minutes with a good connection.
The proxy was provided for older versions of TFS. One of the great features of the new build system is you can place the agent wherever your files are. Setup up the build agent where the files are instead of going through a proxy. You will still need to connect the build agent to the server but that may work better.
I would like to upload on my TFS 2015 some of the build tasks that are available here https://github.com/Microsoft/vso-agent-tasks.
I do have a problem with certain task as they do require a minimum agent version of 1.89.0. My build agents are 1.83.2 version.
Now, the question is, how do I update my agents for a given pool? If I do right click the agent pool on my TFS and choose update all agents option, nothing happens. I suppose because the latest version of my agent available on TFS is the 1.83.2.
Where can I find the latest version of it and how do I update it?
Note I'm working on premises TFS 2015 and not VSO.
Thanks
If you right-click the agent pool and choose "Update all agents", it will upgrade the agents to the version of the on-premise TFS server. For instance, if you initially installed some RC, and upgraded the server to RTM later, some agents might have lower version. Otherwise, as you mentioned, nothing will happen because all agents are up to date.
VSO has a different release model and updates/fixes to its agents are continuously delivered. That's why the version is constantly growing.
Technically it might be possible to grab the source code of the latest VSO agent tasks, and push it to the on-premise version of TFS 2015. However, it is considered an anti-pattern, and the behavior is undocumented and unsupported.
Let me quote build vNext developers from this discussion (see the bottom of the thread):
That is not a supported option. It is very likely that the agent we
have in VSO will not work with the on-prem server. You must use the
version of the agent that ships with your server.
And:
The behavior is undefined/untested. It may work, may not. The design
is for agents to get pulled forward via an auto update process
downloaded from your service. The auto update process may alter
configs/layout on disk, whatever. That future agent might call REST
apis that don't exist, etc... The primary focus for agents is on
forward compat so they can lazily get upgraded (via task minimum agent
demand, on restart or eventually a scheduled job).
Same answer as #Yan, but putting this here because the following error came from nowhere - so I think Microsoft updated the minimum requirements this week.
No agent found in pool Default which satisfies the specified demands:
msbuild
visualstudio
Agent.Version -gtVersion 1.95.0
For your own hosted agent just right click on the queue, or click the ... icon.
I had to restart the agent service after a few minutes as it didn't seem to want to by itself. Give it a chance to update properly before doing this.