1
votes

Can I publish an html report somewhere in Azure DevOps that is secured to members of the project?

For example, I want to run repostat, or some similar tool, via a scheduled pipeline on my Azure Repos (e.g. the repo that backs the Azure Project Wiki) and publish the results somewhere that is linkable from the Project Wiki.

What are my options?

1

1 Answers

3
votes

If you want to display the html report in azure devops, i am afraid i cannot be done currently.

There are user voices have been submitted to microsoft. You can go vote them up. See here, this thread, and this thread.

Howerver, You can publish the html report to azure devops server as build artifacts by using publish build artifacts task in your pipeline.

- task: PublishBuildArtifacts@1
  inputs:
    pathToPublish: path/to/htmlReportFolder
    artifactName: HtmlReport

Then you can get the report in the build summary page.

enter image description here

You can retain this build artifacts by check the retain option in the build summary page. Or set a retention policy for the build.

enter image description here

To secure your html report. You can go the security Manage page from your pipeline runs page to modify the access permission for this build.

enter image description here

There is also an Publish HTML extension you might find useful. You can install this extension in your organization and add Publish HTML task in your pipeline to publish the html report.

Another option you can check out is to create a git repo to host the html report. You can add a script task to run git commands. For example scripts in powershell task.

git config --global user.email "[email protected]"
git config --global user.name "name"

#clone the htmlReportRepo in the agent folder
git clone https://$(system.accesstoken)@dev.azure.com/org/proj/_git/htmlReportRepo

#copy the html report to the htmlReportRepo repo 
Copy-Item path/to/report.html -Destination htmlReportRepo/report.html -Force 

cd htmlReportRepo
# commit the new html report.
git add .
git commit -m 'message'
# push back to htmlReportRepo azure repo.
git push https://$(system.accesstoken)@dev.azure.com/org/proj/_git/htmlReportRepo/ HEAD:master -q