There are multiple ways to generate the Service Principal for Azure AD. Say, through portal, CLI or PowerShell. I always used Azure portal for this registration. But started liking CLI way of generating principal which is very simple and easy to register and generate the required keys and move on. Yes, many times you would find this step as a prerequisites or in mid way to continue say Azure Data Lake Analytics query or ADAL programming.
$ az login
$ az account list -o table
$ az ad sp create-for-rbac --name MikkyDemoTraining --years 1
Ps: Take note of the password value for later references, otherwise you may need to regenerate again.