I would like to list all Azure locations via some API (I need to generate some config files for every region, and use the exact naming that Azure does to avoid typos). I found this question, but it only lists regions a particular subscription is authorized to use.
I want to list all regions that exist whether my subscription has access or not.
az account list-locations -o table
will give you a table like: