Some news on VSTS

Posted on


Below some news about TFS Cloud version, you have new option of navigating on your dashboard, you reduce number of your clicks by 3, you have also new basic task in your release management, you can add manual intervention on server with instruction, you have new option when you download an extension, you must pay in order take first download or update of extesion ..

Create and integrate custom POWER BI reports for TFS

Posted on Updated on


For the generation of project monitoring reports conducted with the TFS platform, you can either use the basic building block SSRS, or use the new generation platform of Microsoft POWER BI reports.

You have a set of basic reports, those offered by SSRS but also many others.

publishing reports on the version of VSTS is a is housed by AZUR site.

The URL is accessible from the portal TFS …

GC.Collect

Get Release Management Datas With API REST TFS

Posted on Updated on


Microsoft has released a documentation of the VSTS and TFS integrating REST APIs. In the recent past we were using the client object model and API to interact with TFS. But it was very difficult for client which don’t have .Net Framework installed, and after installation of this later, you must to have Visual Studio, install dependencies on TFS assemblies, know C# …..
Now you can interact with VSTS and TFS via POWERSHELL scripts, or another language, with simple instructions.
It implies also an openness to other technologies and also ease of use.
You specify different HTTP verbs (such as GET, PUT, POST and PATCH) and the connection point to a specific URI (Uniform Resource Identifier) to interact with the API.
In our post we will define the URI of our TFS server, our project collection and also that of the team project.

$UriCollectionProject =  $TFSInstanceURL+"/"+$ProjectCollection+"/_apis/projects?api-version=2.2-preview.1"
$CollectionResponse = Invoke-RestMethod -Method Get -Credential $credential -ContentType application/json -Uri $UriCollectionProject  

When pointing to TFS, you can pass a username and password (masked as a secret variable) through
So we must to add theses lines below

$User = "Aghilas.yakoub"
$Password = "MyPassword" 
$securePassword = $Password | ConvertTo-SecureString -AsPlainText -Force  
$credential = New-Object System.Management.Automation.PSCredential($User, $securePassword)  

Us in this post we will try to list Releases runned by a specific person.
So secondly we will try to retrieve the list of team projects in a collection.
Emeber that a collection contains a set of project and a project contains a set of releases.
Below calling a GET on the URL of the collection.

$UriCollection =  $TFSURL+"/"+$ProjectCollectionName+"/_apis/projects?api-version=2.2-preview.1"
$CollectionResponse = Invoke-RestMethod -Method Get -Credential $credential -ContentType application/json -Uri $UriCollection

$CollectionResponse contains set of team projects.

foreach ($project in $CollectionResponse.value)
{
    $TeamProject= $project.Name 
	….
}

Now in a second time we will try to retrieve the list of release on a team project.
We will use the following suffix: /_apis/release/releases?api-version=2.2-preview.1

Ref : https://www.visualstudio.com/en-us/docs/integrate/api/rm/releases#get-a-release

#Construct URI for query team prpject and his releases
$Uri = $TFSURL +"/"+$ ProjectCollectionName +"/"+$TeamProject+"/_apis/release/releases?api-version=2.2-preview.1"

#Get response of previous uri
$releaseresponse = Invoke-RestMethod -Method Get -Credential $credential -ContentType application/json -Uri $Uri 

Now we must just get created releases by Aghilas


    foreach ($releaseInstance in $releaseresponse.value)
    { 
	If($releaseInstance.createdBy –eq “Aghilas”)
	{
             ......
        } 
    }

GC.Collect

Document your extension TFS before publish – Markdown

Posted on Updated on


This post is here in order to help you to improve quality on published extension on market place, because we have lot of extensions without documentation, so it’s very hard to use theses, we can add documentation easily by defining markdown.
We have set of steps to follow in order to document.

1. Create your markdown file , add readme.md to your library, if you have one extension library with set of task, suggest you to have one mardown for all tasks.

Remarks: Your file don’t need to be copied in content, let default options.

readme

Below samples of common syntax of markdown :

# This is an H1
## This is an H2
###### This is an H6
*Italic characters*
_Italic characters_
**bold characters**
__bold characters__
~~strikethrough text~~
This is [an example](http://www.amayestech.com/) inline link.

You can also install markdown extension in order to modify easily :

extensionmd

After installing Markdown Editor, can view the design of my code, view small symbol M on my file.

extensionmdEditor

complete doc here : https://code.visualstudio.com/docs/languages/markdown

2. Register your readme.md file into manifeste extension by adding section of code below

register

3. For this sample we add images in readme.md, theses images must be copied to directory img (content / do not copy)
and registered into manifeste extension

registerimg

Now after packaging and publishing actions, if we go to market place manager, we can view documentation of your extension.

 

Integrate SLACK to TFS

Posted on Updated on


You can integrate SLACK into TFS by following theses steps, firstly create your team, define channels, define integrating step with TFS, and finally configure Service Hooks into TFS, and choices events to publish.
This post propose to follow just some steps in order to integrate them.

Go to this url : http://www.Slack.com
Define name for Slack Team, we choice Amayestech as name of our Team

slack1

In the second time we must define credentials of team’s owner, it’s me Aghilas Yakoub

slack2

When you have finished with creating of team, we send invitations to news users, in order to read and post messages to Slack channels.

slack3

Slack is organized with two sides, client side and admin side.
For configure Slack to receive posted messages from TFS, we must go to admin side and register Visual Studio Team Services.

slack6

slack5

For this subject Go to Confgure Apps
Select browse link
Select Install link
Select Add Visual Studio Integration

slack7

slack8

You find two configurations, you have for each channel one configuration,
It’s very important to save your GUID of channel;
This GUID will be registered into TFS Service Hooks.
https://hooks.slack.com/services/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

slack9

TFS View

After first configuration into Slack we go to TFS admin side
https://amayestech.visualstudio.com/Amayestech.Tech/_admin/_apps/hub/ms.vss-servicehooks-web.manageServiceHooks-project

slack13

Click on Create first subscription for this project and Click on Next Button

slack14

You have lot of triggers, one trigger for one behavior, for example you can post message after creating of WI, or after finished Release.

slack15

slack14

So we Create first trigger for complete build
We choice build attributes as name or status.

slack16

Click ion next
https://amayestech.slack.com/messages/general/search/integration/

slack17

Package and publish your extension TFS 2015 VNEXT

Posted on Updated on


In order apeak about solution , we explain just that we have two aspects to setup, packaging and publishing, we begin with our sample with packaging.

  • PACKAGING View

For the packaging we follow steps below in order to construct our package, the result of this step is vsix file.

1. Setup Node.js

2. Install vset tool with this command : npm install vset –save-dev

vnext12

3. Run Node.js command prompt tool (C:\Windows\System32\cmd.exe /k “C:\Program Files (x86)\nodejs\nodevars.bat”)

4. Locate you on directory of your extension

5. Run vset package command

vnext13

Your vsix is generated into your root irectory

vnext13

For information you can inspect content of your extension, by unzip your vsix

vnext15

  • PUBLISHING View

Before publish our extension it’s possible to visit differents extension avaiable on the cloud, it’s possible to download and install on premise version of tfs, in order to reuse.

We choose to publish our expansion on the market place on Azure

We follow theses steps, firstly we create a publisher, secondly

1. Go to https://marketplace.visualstudio.com/manage/publishers/
2. Choose to create a publisher by completing a unique Id

vnext10
After that
vnext9
3. Upload your extension by drag and drop your vsix
vnext11

4. Correct and adapt your manifest information

vnext16

5. Now it’s ok and my vsix is downloaded

vnext17

6. Share my extension on my account azure, an it’s possible to update my version on clickin on update button
vnext18

vnext19

7. Go to admin tfs section, and selection extension tab, clck on my extension target

vnext19

vnext20

8. On Build VNEXT find my created extension

vnext21

Create your extension TFS 2015 VNEXT

Posted on Updated on


Start by downloading a template project, you have two project templates, one dedicated to the integration part, another dedicated to the realization of custom build or release tasks.

In this post we will realize an extension that will aim to start an application pool, without managing this specify.

For the part back we will combine our extension with a shell script.

Begin with open Explorer Visual Studio extensions,

Install the following template :

vnext1

Below is a detail on the different of your solution.

Most of these directories will be deleted in the second time.

vnext2

Now we will start developing our own extension,

First, delete the files that we use nothing:

  1. Remove the test directory
  2. Remove typings directory
  3. Delete the file app.ts
  1. Add directory Sample
  2. Create a powershell file Sample.ps1
  3. Create a task manifest file task.json
  4. Create logo into directory

Below the output of created project

vnext3

  1. Edit the task.json by defining your layout based on controls and groups concepts, inputs are your controls typed with type propecty, and are grouped into groups, by using group property (Below sample of grouping, we have three groups)

vnext5

Below the task.json file after modify

vnext4

We have another section related to call code behind, for our project, code behind is powersell, it can be another type

  1. Implement your Code behind and match with your layout arguments

Ensure that arguments ps1 match with json arguments, in execution section on your json, ensure that you have referenced your target file.

 

vnext6.png

  1. For debugging after implementing, open your ps ise, you can find-it in C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe

Ensure that you have right of debugging by executing this script, and just click F5

vnext7

  1. Register your extension in the manifeste

vnext8.png

GC.Collect