Secret Variables in Azure Pipelines

These are documented, but the documentation focuses on accessing within script (including Bash and PowerShell) tasks.

But what about access from other tasks?

Having gone into the Pipeline’s variables and saved a new secret value called TheSecretInPipelineVariable:

    # At the top
    variables:
      TheSecret: $(TheSecretInPipelineVariable)

    ...
    # Within a task
    - task: whatever
      displayName: "Task that uses a secret!"
      inputs:
        some_input: $(TheSecret)

Is the indirection via defining a script variable needed? No idea because it isn’t broken!