If you are looking how to achieve the same goal with Windows agents and PowerShell see Print all environment variables in Azure DevOps for Windows Agents with Powershell.
If you’d like to see all the environment variables configured during your build or release on Linux agent just add the Bash task with:
printenv
so it looks like
and when you’ll execute your build or release pipeline you should be able to see all the environment variables: