How to set up standard Cognitive Services API Integration in Dynamics 365 (with some custom bits too!)

The release of Dynamics 365 at the end of last year saw some new features available for public preview. One of the features in preview is the Cognitive Services integration, currently available in the US. The Cognitive Services APIs are a group of APIs that span across different categories such as vision or text analytics. A large number of them have a Machine Learning component where a model will be created and then adjusted over time based on the data that it feeds upon, however not all of them require this and instead perform computation without having the ‘learning’ ability.