microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

[BUG]: Data issue with Azure PowerShell telemetry - ADO telemetry data not recorded. #20301

Open Alex-wdy opened 1 month ago

Alex-wdy commented 1 month ago

New issue checklist

Task name

AzurePowerShell

Task version

12.2.0

Issue Description

When checking the telemetry data of Azure PowerShell, querying the data from ADO, it was found to be empty. The root cause is that the environment variable AZUREPS_HOST_ENVIRONMENT of Azure PowerShell is not set.

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Window 11

Relevant log output



### Full task logs with system.debug enabled

<details>
  <pre> [REPLACE THIS WITH YOUR INFORMATION] </pre>
</details>

### Repro steps

_No response_
EshitaD commented 2 weeks ago

Hi @Alex-wdy, i didn't see version 12 for Azure Powershell task, can you please let us know how you are using version 12 for Azure Powershell task? And also, can you please provide me the debug logs and repro steps. image

YanaXu commented 2 weeks ago

Hi @EshitaD , we're using Azure PowerShell task v5 together with Azure PowerShell v12.0.0. You can check the source code of Azure PowerShell task. It should set an env variable AZUREPS_HOST_ENVIRONMENT for recording telemetry. Better to set both AZURE_HTTP_USER_AGENT and AZUREPS_HOST_ENVIRONMENT. You can take Azure PowerShell Action for example. It's for GitHub Actions, similar as Azure PowerShell task in Azure Pipeline.