Microsoft Teams – Integration with Visual Studio Team Services using PowerApps.

Within Microsoft Teams it is possible to create PowerApps by adding a new tab and then select the PowerApps Icons.

This of course gives you unlimited options to create new applications without any coding work. Today, I tried to create an app that helps me maintain my Visual Studio Team Services backlog within Microsoft Teams.

I selected my app and then the app that I created in PowerApps is added to my set of tabs in my Microsoft Teams channel. Note that the app only becomes available after you have created it within PowerApps.


So far I’ve only created the app form a blank template. Next step will be to update my data source. This should be easy. I’ve done this many times with SharePoint lists so what could possibly happen.

Within my PowerApp I’ve added a Gallery control.

As you will notice the Data source is not correct yet and some sample data is being used.

Simply add the data source by selecting Visual Studio Team Services or click on +New connection if you haven’t connected to  Visual Studio Team Services before

And you will find that the Visual Studio Team Services data is available.

That was easy!

But, my data source still says CustomGallerySample, Aahhh.

I did notice that the Visual Studio Team Services connection is marked with Preview, but this must be a really early preview as the only thing you can do with it is see its existence. Well, at least we might now know what is coming up.

Not wanting to give up yet. I started to reopen the app that I just created.

So even though initially it looked like the connections didn’t work. The data source does seem to be available.

So in my Gallery control, I’m now running the ListAccounts. ( I could have done something like VisualStudioTeamServices.ListAccounts().value.accountName to get all the account names, but I’m connected to a few customer accounts and therefore for the purpose of the screenshots in this post I’ve simplified things a bit)

Then I’ll try to display the accountName:

Then an helpful tooltip appears:

Ok, So I’m still getting the wrong data type returned but at least my connection is recognised. I would like to get some text back. So by using the Last(…) function I’m picking up one of the accounts connected to my account that I used to connect to the data source.

Ok, Now we are up and running. Now I can use the ListIterations using the above account and the project name and team name:


Ok, this is only the start of the app.

I’ve create a PowerApp that now lets me queue a new build and start a release using PowerApps. So anybody in my development teams can now release software to Triad‘s customer’s test systems by just clicking on a button in Microsoft Teams. This already has saved us a lot of time and more importantly many mistakes are avoided.

What else can be done using PowerApps? First I’m having a look at the options available within the VisualStudioTeamServices connection. The following Methods/Functions are available:

  • ListAccounts
  • ListBuildDefinitions
  • ListGitRefs
  • ListgitRepositories
  • ListIterations
  • ListProjects
  • ListReleaseDefinitions
  • ListTeamMembers
  • ListTeams


The ListAccounts function retrieves the list of accounts the user is a member of. So this is when you login to VSTS and when you are connected to multiple organisations you will get a dialog asking you which account to connect to.



This returns a record with the following fields

  • accountId – This is a guid of the account
  • accountName – this is the name of the account
  • accountOwner – This doesn’t seem to be set in my environment so not sure if this is working yet
  • accountType – Either personal or business
  • accountUri – The Uri of the account for this is something like https:/ /
  • organzationName – This is always blanks for my environments.
  • isSelected – this is set to true when the current item is selected.


The ListBuildDefinitions function retrieves a list of build definitions that you have created as part of your project in VSTS



where project is the name of the projewct returned by the ListProject method described below.

ListBuildDefinitions returns a record with the following fields

  • id – This is a guid of the build
  • name – this is the name of the build
  • _links – This returns web objects. ThisItem._links.web.href gets the url of a web, but I’m not sure what this is referring to as i’m not getting any results back
  • revision – the revision of the build
  • type – Either build or draft


The ListGitRefs function retrieves the list of references (branches, tags, etc) in a git repository.


The ListGitRepositories retrieves the list of Git repositories in a project. These are all the forks that have been created within the project.




The ListIterations function retrieves a list of iterations for a project



This returns an object with the following fields:

  • Id – the id of the iteration
  • Name – the name of the iteration e.g. Iteration 1
  • Path – The path to the iteration. e.g. Project\Iteration 1
  • Url – The url of the iteration
  • _links
  • Attributes – this contains the start and finish date of the iteration
  • IsSelected – is this iteration selected?


The ListProjects function retrieves a list of projects for an account



  • name – the name of the project. You will need to use this in for example the ListBuildDefinitions
  • id – the unique id of the project
  • url – the url of the project
  • isSelected – is this project selected?


The ListReleaseDefinitions function retrieves a list of release definitions that you have created as part of your project in VSTS


The ListTeamMembers function retrieves a list of members in a team


Lists the list of teams in a project



this will return an object with the following field for the team

  • name – the name of the team.
  • id – the unique id of the team
  • url – the url of the team
  • description – the description of the team
  • isSelected – is this teamselected?


Ok, all of the above only list information. Is it possible to do anything other than listing information? Yes there is!


The CreateRelease will create a release using the Release Definition IDs as you can get them using the ListReleaseDefinitions function


VisualStudioTeamServices.CreateRelease(“ContextIS”,”triad”,ThisItem.Id,{Description:”Test”,IsDraft:true,Reason:”Test from PowerApps”})



The CreateWorkItem function lets you update workitems, so now you can manage your backlog directly form Microsoft Teams


When you want a build to happen you could use your continuous integration configuration triggers on code check-in, but imagine that you could get this done by clicking on a button in Microsoft Teams? QueueNewBuild makes this possible!


Like the create work item, it is also possible to update work items using UpdateWorkItem.


So now it is all a matter of finding new use cases and implement them using PowerApps. OK, the options might be a bit limited, but I can definitely see many needs that could be implemented with new applications in PowerApps.


For more  details  in the available options please have a look at the article below:



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: