4
votes

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.

1
Hi Kevin Desp; can we ask what you've tried so far? For example, adding an extra parameter to the extension to specify the html file? - Vince Bowdren
Hi, thank you for your comment, Etienne's comment gave me the solution ! - Kevin Desp

1 Answers

2
votes

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.