New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secret PAT Token does not work on Azure DevOps OnPremise #466
Comments
Hi @RealCoda, your Azure DevOps YAML definition should look like the following, so that the secret is explicitly picked up by Azure DevOps and sent to PR Metrics:
The key here is the You can find more information about this at https://github.com/microsoft/PR-Metrics/blob/main/docs/azure-pipelines-task.md. Could you ensure this is present? If it is, could you provide the YAML definition you're using so that I can debug further. Thanks! |
thx for commenting! As we can see in the debug log above, there is obviously a difference: I will test this further more and keep you updated. |
Hi @RealCoda, thanks for clarifying your scenario. I believe the key is the "Environment variables" section of the task definition: For this, the first column would list Unfortunately, my test Azure DevOps instance doesn't allow for classic pipelines to be used, so I can't validate this. If this works for you, I'd appreciate if you could let me know so that I can document it at https://github.com/microsoft/PR-Metrics/blob/main/docs/azure-pipelines-task.md for future reference. |
Summary
PAT Token can not be set to secret to work with PR Metrics in AzureDevops on Premise
Reproduction Steps
Use PR Metrics as a (last) task in some pipeline on Azure DevOps Server On Premise.
Add a pipeline variable called "PR_METRICS_ACCESS_TOKEN" to the pipeline and activate "secret"
-> leads to error "Could not access the Personal Access Token (PAT). Add 'PR_Metrics_Access_Token' as a secret environment variable."
if you deactivate "secret" it works like a charm.
Troubleshooting Undertaken
Additional Information
Versions
Version Azure DevOps Server 2022.1 (AzureDevOpsServer_20231128.1)
PR Metrics v1.5.11
Yaml
yaml export file says: (so it was really added)
Variable 'PR_METRICS_ACCESS_TOKEN' was defined in the Variables tab
Debug Log
The text was updated successfully, but these errors were encountered: