Pass data from Azure DevOps release to release tab - tfs

I am developing an extension for Azure DevOps. Details of my extension are as below
Supported environment
Azure DevOps
TFS 2017
TFS 2018
DevOps server 2019
DevOps server 2020
Language: Typescript
Contribution Points :
ms.vss-distributed-task.task
ms.vss-releaseManagement-web.release-summary-tab
Scopes :
vso.build
vso.build_execute
vso.work_write
vso.release
vso.release_execute
My task is running in the release pipeline and generates some data. I want to pass these data to the release tab once the release is completed. And display some arranged information in the release tab. further user should able to view information related to a particular old release in the tab by navigating to that relase as well.
Please be kind enough to provide some guidelines for achieving this task. Please let me know if you need any additional information.

Here are two ideas for getting data from release pipeline:
Present the data you need in the task's running log and then use REST APIs to get the log. Here are several REST APIs:
Releases - Get Task Log: This REST API can get log of a specific task, which only supports plain texts.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/environments/{environmentId}/deployPhases/{releaseDeployPhaseId}/tasks/{taskId}/logs?api-version=6.0-preview.2
Releases - Get Logs: This REST API download a zip file that contains log of all the tasks.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/logs?api-version=6.0-preview.2
Write the data you need to a file and then use Copy Files task to get the file outside the release.

Related

AzureDevOps API to retrieve build results based on build id

We are trying to use Microsoft Azure DevOps API and retrieve following information for each build under each project in Azure DevOps organization. Ultimate goal is to retrieve these datils using C# code and use as a data to make some decisions in one of our dashboard. As we can see, these details available in the summary of the build once build completed (in Azure DevOps build summary page).
Unit Test Status
Code Coverage
Build Status
Deployment Status
Automated Test Execution Status
We have referred this Microsoft official documentation in our research. And found that below GET methods has some information that may help with our research, but unfortunately these does not contains all the information that we are looking for.
Build
Builds
History
Could someone help us by recommending possible candidate API's to efficiently extract this data?

Can reports be automatically generated on a scheduled basis using TFS data?

The current situation: We're manually putting together a weekly report using the information available to us in TFS. It's a mind-numbing process that takes each scrum master several hours a week to piece together. The reports include information on sprint progress, blocked stories/features, workload per team, etc.
My question: Is there a way of automating this process to run on a weekly basis and export the results to an Excel file? TFS data must be housed in a database somewhere, but I'm not sure how restricted access to this database is.
After you create and publish reports, you can use Report Manager to view, organize, and configure those reports. This could be achieved by using Report Manager. Take a look at this tutorial: View, organize, and configure reports using Report Manager
After you create and publish reports in SQL Server Report Designer,
you can use SQL Server Reporting Services' Report Manager to view,
organize, and configure those reports. By using Report Manager, you
can group related reports in folders, adjust parameters and data
sources, and schedule automated reports.
You can also configure different methods by which your reports are
saved. For example, you can save a copy of a report (sometimes
referred to as a snapshot) as report history. You can also export and
save reports and have reports copied automatically to a file share.
If you want to import report to Excel, you could write a small PowerShell script using Rest API to query info such as related work items, then you add a scheduled job that'll execute that script .

How to retrieve the Agent for a specific Release

The TFS Rest API allows me to get a specific Release for a Team Project
Ex. https://bla.visualstudio.com/MySuperProject/_apis/release/releases/666
I already found, how to get the related Pool of the Release. But is it possible to retrieve the Agent where the Release was deployed using the TFS Rest API ?
Thanks
You can get the release with all the details by calling REST API as shown below. You should use youraccount.vsrm.visualstudio
https://yourVSTSAccount.vsrm.visualstudio.com/yourproject/_apis/release/releases/releaseid
example
https://myac.vsrm.visualstudio.com/Project%20X/_apis/release/releases/106
gives the release agent in deployment steps as shown below

Does TFS Record the Parameters to a Build?

When queueing a new build, we get the option to change the default parameters. Do these changes get recorded somewhere, either in the TFS Operational Store or in the TFS Data Warehouse?
These parameters should be available in the Team Foundation Build Operational Store, according to the behavior described in http://msdn.microsoft.com/en-us/library/ms244687.aspx.
My advice is to log them as part of the build workflow, then the log will be stored with the build outputs. If you read the ALM Ranger Build Guidance they suggest taking this approach, and I believe the BRDLite customized Build Process Template that ships with the guidance does this: http://rabcg.codeplex.com/

How to get code of different version of a web application build on tfs 2008 server

I have been created a web project on tfs server and set a build for this application, which builds the application daily. I want to give a specific version of build to testing team, but if that version was build successfully before two or three days, how can I get the source code of that particular build which was build successfully a few days before.
If I understand correctly, you'll need to roll back to the Changeset you are looking for. This artcile will explain how to do that.
http://msdn.microsoft.com/en-us/library/ms194956(VS.80).aspx

Resources