az cli:
az account list | jq '.[].id'
Powershell:
Get-AzSubscription
Resources:Powershell docsClI docs