6

I need to display HTML content in a new tab in the build summary of an Azure DevOps pipeline. The HTML file is generated from a task of the pipeline. How to do that?

I have followed this guide (https://github.com/microsoft/vsts-extension-samples/tree/master/build-results-enhancer) which explains briefly how to build an extension that shows an HTML file content in a new tab but this HTML file is included in the extension and can't come from a build task.

Now, I'm able to display a new tab with HTML content in it but this content is in the extension package. I can't choose what file to display.

Kevin Desp
  • 63
  • 1
  • 5

1 Answers1

2

have you looked at this file in the github repo you mentionned https://github.com/microsoft/vsts-extension-samples/blob/master/build-results-enhancer/src/enhancer/tab.ts there is a commented out section from like 22 to 38 that does exactly what you want. You need to upload the html file produced in the build using the ##vso[task.addattachment] command (you can do this as a powershell task in the build and then just consume the html attachment.

Etienne
  • 1,075
  • 5
  • 9
  • My bad, I didn't pay attention to the comments but that was the solution... Thank you very much for your help ! – Kevin Desp Jul 08 '19 at 08:40
  • What is that html file has javascript in it and is dependent on other files for showing data images. When it will be available as a tab.. will it have access to those files.. Because with some already existing extension we faced this problem where the html file cannot access those dependencies and looks like a broken html file – Gaurav Khurana Apr 12 '22 at 09:57