Off the top of my head what I would say is that although your NewSchedListItem function returns a Deferred.promise(), what is happening is that it is returning that object into the scope of the anonymous function you use in your then handler, and not out to the then handler itself, so it is not handled correctly in the chain.
What you need to do is return ...
The bug from Sharepoint still remains. I've wasted a lot of time before find this post. ContextToken received in ItemAdded doesn't contains RefreshToken that the TokenHelper needs in order to create a ClientContext.
After found this post i've tried with ItemUpdating and ItemAdding and my code works!
When registering a new app on the appregnew.aspx page of my
on-premises farm, I am not seeing it in my Azure AD environment
This is how it's supposed to work.
Should this work on-premises? Is there some other configuration to the
farm that must be done?
I don't think such configuration exists.
When doing the appregnew.aspx process on a ...