While running an azure build pipeline (yml version) is there any programmatic way (inside the pipeline itself) to know if the current pipeline is running on the ms-hosted agent or self-hosted agent?

We have one pre-defined variable called 'Agent.Name' which gives the agent name.

But it keeps changing the agent name (Hosted, Azure)
Agent.Name=Hosted, Agent.Name=Azure

Is there any way to determine the type of agent at the pipeline run time.

```
      - task: Bash@3
        displayName: Show Agent Name
        inputs:
          targetType: 'inline'
          script: |
            echo $(Agent.Name)

```