You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to display custom metadata about the self-hosted agent, so that it's visible in the pipeline output. For example the current agent version or image name or anything else.
A nice place to show it would be at the beginning of the job output, for example:
Is there any way to do this, for example by passing some env variables to the agent binary?
Versions
Azure DevOps / Ubuntu
Environment type (Please select at least one enviroment where you face this issue)
Self-Hosted
Microsoft Hosted
VMSS Pool
Container
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Operation system
Ubuntu
Version controll system
Git
Azure DevOps Server Version (if applicable)
No response
The text was updated successfully, but these errors were encountered:
@ivanduplenskikh Do you mean to put in your pipeline tasks some custom code that would read the agent version via e.g. environment variable and display this to the output?
This has a big disadvantage in that you need to modify pipelines code itself to do so. The pipeline code must now have knowledge that it's running on a build agent that has some env variable defined. And you need to remember to update all the pipelines.
What I was look for is something that would print this information even before the actual pipeline tasks start execution. We run the self-hosted agent in container (like here https://learn.microsoft.com/en-us/azure/container-apps/tutorial-ci-cd-runners-jobs?tabs=bash&pivots=container-apps-jobs-self-hosted-ci-cd-azure-pipelines#build-the-azure-pipelines-agent-container-image) but anything being printed out in start.sh script do not show up in the pipeline output.
@nosalan, the agent/pipeline doesn't have any built-in mechanism for printing any kind of additional metadata to the beginning of output.
Only with creating additional pipeline step which can parse information that you need and add it to output with commands described in link above.
Describe your question
I would like to display custom metadata about the self-hosted agent, so that it's visible in the pipeline output. For example the current agent version or image name or anything else.
A nice place to show it would be at the beginning of the job output, for example:
Is there any way to do this, for example by passing some env variables to the agent binary?
Versions
Azure DevOps / Ubuntu
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Operation system
Ubuntu
Version controll system
Git
Azure DevOps Server Version (if applicable)
No response
The text was updated successfully, but these errors were encountered: