How to setup and use VSTS for five user - visual-studio

Our office uses VSS as source control. Just come to know that VSTS is free for five users and our team is very small with 5 devs.
I have never use VSTS. so i have few questions. please answer pointwise and with detail along with images if possible.
how to create an account for VSTS?
how to upload our local project exist on my pc to VSTS
how could I send an invitation to other 4 developers in our team, as a result, they can clone our uploaded project on their own pc and start working?
I got one link which is showing how to Add Local Project to GIT in VSTS but I need to know how to add a project to TFVC in VSTS.

Create an account
Go to VisualStudio.com, log in using MSA, pick an available account name and register. If you have an Azure subscription and an Azure Active Directory, you can also create the account from the Azure portal, that way you can use your company-account to log on.
Upload local project
When you create your first project you get to choose whether you want TFVC or Git. Once the project is created, getting your sources in differs depending on your choice.
If you pick TFVC you must create a local workspace on your machine, copy the sources into that directory, then check them in.
Invite other users
To add other users to VSTS they need to have an MSA account or to be part of your AAD (depending on how you setup your account). Then go to the Users hub in the VSTS admin panel and add them to your account. The first 5 basic users are free. If users have an MSDN account (pro or higher) they do not count towards the free user limit as VSTS access is included in the subscription.

Related

Create a custom TFS user and grant/deny permissions on it

First a brief explanation about who we are and how we work. We are a small team and we work together with a consultancy in our own project. We work with a main branch and then we create development branches from it each time we need to implement a new feature. When that feature is implemented we merge main branch into development branch and we test it. Once tests are ok, we finally merge development branch into main branch and we test again. If all test are passed in main branch, then we deploy/publish it to production.
Now what we are trying to do is to create a user for consultancy in our TFS system in order to this user can/cannot do following things:
Consultancy cannot create branches from main branch (summarizing they cannot create branches in TFS repository). We will create development branches for them and we will grant permissions for them over each development branch created.
Allow consultancy to get latest versions from development branch and map it into their local computer.
Allow consultancy to work in the development branch by using check-ins and check-outs. Consultancy can do all operations in development branch except merge it into main branch.
Allow consultancy to merge main branch into development branch but not vice versa.
The goal of this is to keep our TFS repository under control.
So how can we create a user in TFS following above rules? Note that each time we create a development branch for consultancy we must grant/deny the corresponding permissions on this user.
You can add Windows user or Windows group in TFS. TFS use the authentication with windows user/ domain user(Active Directory) to access the server. TFS can't create users directly. There are no TFS own users.
Additional: About the relationship with TFS and Active Directory
TFS does not write to Active Directory (AD) nor "has it's own
Active Directory".
TFS stores users and groups, permissions and security, into its own
database. To integrate with Windows Security by running a background
job
every hour and reading users and groups from AD.
You may have to add that user in your AD, and give him access to TFS, finally assign them corresponding permission for each branch, Main & Dev.
To manage branch permission , you could either choose
In Web Portal--Project Settings--Repositories--Branch
In Visual Studio--Right Click--Advanced--Security
For each branch's permission setting, you could directly manage that user's or create a group then add that consultancy in the group, manage the group's permission.
Check in
Check out/Pend a change in server workspace
Manage branch: Users cannot create branches from a branch for which
they do not have the Manage Branch permission.
Merge: Can merge changes into this path.
More details about the description of each permission please take at a look our official tutorial here--TFVC (object-level)

TFS 2015 Publishing build artifacts using file share option failed

I wanted to created a demo app that does automatic deployment. In other words once I check-in my code changes, the changes can be seen on the published website. I did the following steps:
I created an .NET project on Visual Studio 2017, published the project with IIS instructions from here and here. I published my project to a local file on my machine;
The I did Continuous Delivery and Release Management using TFS 2015 and created a build and release definitions from here;
The final step was to use the Copy File to and Publish Artifacts tasks, using file share option to drop the contents to the publish folder I've created. So when I check-in my changes using TFS, the changes will be seen online.
Here is the configuration for the build definition:
The folder in the file share path is shared to everyone, and the path is correct (when I type it in the browser, I can see the folder's contents).
The error I keep getting is the following:
Publishing build artifacts failed with an error: Unable to create
directory '{p}'. Unable to verify the directory exists: '{testDir}'.
If directory is a file share, please verify the share name is correct,
the share is online, and the current process has permission to access
the share. \localhost\builddrop\drop \localhost\builddrop\drop
I've been trying to solve this for 2 days with no luck, but I could not find similar issues... I would like to know what is causing this error, or if you have any hints or tips that will get me closer to the solution.
Thanks to #Maxsur answer I realized that I did not install a build agent, which is needed for in case you want to publish your code into a file share.
I did that by going to the team foundation server web portal clicked on the gear sign, and chose Agent Queues and followed the steps. Additionally you will also need to acquire a token by clicking on your profile icon then choosing security and add new token.
Reference: https://learn.microsoft.com/en-us/vsts/pipelines/agents/v2-windows?view=vsts
Try to check (and change) an account for your build agent service.
It can be found at Windows Services -> VSTS Agent on build machine (or TFS server if it used as build machine).
This service can run under "local service" account, which cannot access network shares (even on local machine!).
Try to change this account to Administrator (for example) or setup one by guidelines of MSDN
In your Publish Artifacts Task, you've specified //localhost/builddrop/ in File share path, which is not correct. You need to specify the File share path as below:
\\servername\builddrop

Manage project in VSTS does not keep the changes

As you can see in the picture I have project administrator permission and I added some projects to Project Administrators group.
Today I created 2 new projects. And VSTS groups stuck to Custom group.
I don't know why I have a new group which is called Custom even I don't have it in Security/Groups.
I can't change Custom to Project Administrators and for other users to Contributor.
After all, I created a Test project and I didn't get any issues.
How can I fix the problem? Thanks
Custom simply means you're a member of one or more groups that are not in the list of:
Project Administrators
Project Contributors
Project Readers
The project's Default Team
For example, you're a member of a Team (Teams are represented as a security group). Or you're a member of any custom created group within the project. These custom groups are not shown in the Manage projects dialogue.
I do not see the behaviour of not being able to change the values, the only reason I can think of is that your user doesn't have permissions to manage permissions in those projects. Have you tried changing the security directly through the project's own Security tab?

How to silo git repos for teams in VSTS

I am currently setting up a VSTS project for our team, and want to follow the MS approved 'One project with multiple areas' approach. I'd would like to silo the git repos on a per team basis (similar to how the work items work), however the teams all have the same members. Is this possible? Here's an example...
I create a project in VSTS, let's call it MainProject. I also have a team of 4 developers, and they are all members of a group in VSTS called MyDevGroup.
Under MainProject, I set up two teams, and two areas, let's call them Main Project / Team1 and MainProject / Team2. I add the group MyDevGroup separately to the security for those two teams. At this stage, if one of the team access this through VS, they can see those two teams, and if they were to add a new Work Item, depending on which team they had currently selected, it would assign it to the correct area. This is great.
I also create two git repos, let's call them MainProject / Repo1 and MainProject / Repo2, and assign Team1 at a contributor level to Repo1, and Team2 to Repo2. However, in VS, if the user is currently looking at MainProject / Project1 team, they can still clone either repo - they see both.
This is problematic, as you can imagine a scenario where a user might have the Team1 team selected in VS, but accidentally check out Repo2 and work on it.
So, is there a way to restrict a repo to a team?
EDIT: Further to this, I realise that once you open the solution in a particular repo, close VS then re-open it, it will refer to the correct repo. However it doesn't keep the reference to the correct team. It keeps the last team opened rather than the team I'd selected for the solution. Is there a way to have VS keep the team I had selected when I closed the solution?
EDIT 2: Duplicate of this - VSTS/TFS GUI: Auto-switch repository per team view?
As per this link, this is not possible with the current functionality of VSTS. Hopefully this will be possible in the future.

Team City not able to fetch source code from TFS for build

I know little about this, but it has fallen to be at work to look into. I know a really tiny bit about TFS, and a little less than that about Team City, but do have access to both.
I have a Team City project that watches for commits to a TFS repo. When someone checks in files, TeamCity fetches them, then builds the project and publishes it via web deploy to our 'Dev' environment. This process is much less automated for higher grade environments like UAT etc.
Now, suddenly about two weeks ago, someone changed something, and when do a build in TeamCity I get two error messages. The first seems more introductory, that there has been a problem:
Failed to collect changes, error: Failed to get current version of TFS
root. TF400324: Team Foundation services are not available from server
applogix-projects.visualstudio.com\DefaultCollection. Technical
information (for administrator): The remote name could not be
resolved: 'applogix-projects.visualstudio.com'
The second error message, displayed on the same screen as the first, is slightly more technical, and even includes a fairly verbose stack trace, which I will omit until clearly necessary. The 2nd message:
Failed for the root '"Hollard - MLAM - Web" {instance id=4, parent
internal id=1, parent id=HollardMlamWeb_HollardMlamWeb, description:
"tfs: https://applogix-projects.visualstudio.com/DefaultCollection
$/Hollard - MLAM/HollardMLAM/Hollard.MLAM"}: Failed to get current
version of TFS root. TF400324: Team Foundation services are not
available from server
applogix-projects.visualstudio.com\DefaultCollection. Technical
information (for administrator): The remote name could not be
resolved: 'applogix-projects.visualstudio.com'
Those remove names that cannot be resolved within Team City, e.g. applogix-projects.visualstudio.com\DefaultCollection resolves fine when I paste it into a browser, and it directs me to our Visual Studio Online location for the project.
What I would appreciate as an answer here is an overview how the TFS fetch and TC build basically occur, and then some settings in TeamCity and or VS Online TFS that could be causing something like this.
It might be worth noting that if I pull the 'official' publish profile for Dev, and manually straight from VS Publish wizard, the app builds OK is well deployed to the Dev environment.
You need to check VCS settings in your teamcity build. Follow below steps:
Go to Edit Configuraton settings
Click on Version Control Settings
Check TFS URL and other settings
Check Configuring VCS Roots for more details.
If the credentials are incorrect then Visual Studio Online will report that it does not exists to prevent hackers.
Tge most likely issue is that the credentials are invalid. You should check that the user still exists and has the correct permission. You may have to use the "alternative credentials" from a users profile.
You can use the TFS Credential Viewer to get master unattended credentials for your VSO account, however these are the keys to the kingdom, so protect them.

Resources