Getting Started With Microsoft Azure Cognitive Services - Emotion APIs


In this article, you will learn how to get started with Microsoft Azure Cognitive Services – Emotion APIs.


I have come across many complicated articles with respect to Cognitive Services, but as I've been working on these services for the last six months, it's really not at all complex. Hence, I thought to start with writing simple, step-by-step articles on Cognitive services.

If you have landed directly on this article, I would recommend you read the following articles of mine.

As defined, Cognitive Services provide the best suit for having interactive, automated model of application. It helps to build powerful intelligence into applications to enable natural and contextual interactions.

Emotion API, as described by Microsoft, creates apps that respond to moods, recognize feelings, and get personal with the Emotion API. Using facial expressions, this cloud-based API can detect happiness, neutrality, sadness, contempt, anger, disgust, fear, and surprise. The artificial intelligence algorithms detects these emotions based on universal facial expressions, functioning even cross-culturally.

We will learn more about Emotion APIs in later articles. To start with, let's create Cognitive account to use Emotion API, using Azure Portal.

Here, let's assume that you already have Azure Portal Account. If not, create your free Azure account.

Once done with account creation, go to '+' =>  Intelligence + analytics => Cognitive Services APIs.

Fill in the below details.

  • Account Name - Unique name for Cognitive Emotion API account.
  • Subscription - Free; or in case of any subscription you have, must be selected here.
  • API Type - Cognitive services provide a set of awesome APIs. For this article, we will go with Emotion API
  • Pricing Tier - As per the API selected, pricing options will be listed. Select any among the listed options.
  • Resource Group - Can select existing Resource group or create new.

  • Account Name -  EmoCongwithKasam.
  • Subscription - I have selected my subscription.
  • Resource Group - Created a new resource group named as CodeCognitivewithKasam, for grouping the Cognitive related services
  • API Type - Cognitive Services provide a set of awesome APIs. For this article, we will go with Emotion API.

    Currently, the service is in Preview and hence only available at a Western US location. Once we select Emotion API from the list of APIs, the location would get set to ' West US'

  • Pricing Tier - For Emotion API selected, below pricing options are listed. Let's select Standard as pricing tier. You can go with basic, which is free and available in free trial account.

Click on "Legal Terms" option. A blade with detailed terms will be displayed. Read it carefully and then click, I Agree => Create.

After successful creation, you will be notified with the below message.

Click on Resource groups => CodeCognitivewithKasam (resource group selected) => Overview.

The newly created Emotion API Cognitive account will be listed, as seen below. Click on the account name.

Go to Overview and list all the details associated with Cognitive account.

In the Endpoint, the base URL of Restful Emotion APIs is provided by Microsoft. 

Click on "Keys" under Resource Management. This will list the key details (Key 1 , Key 2 ) which we will be using in our application to leverage the Cognitive Emotions Services.

We can also regenerate this Key by clicking Regenerate Key option available, as shown below.

Click on Quick Start for a quick introduction of Cognitive services, API documentation, and Developer's code of conduct, along with the details of SDK available for building apps with cognitive Emotion APIs


How easy it is to get started with Cognitive Services. By now, we saw how seamlessly we created Cognitive Services Emotion API account, using Microsoft Azure Portal.

We can use these Keys (being generated) to communicate with our app with supercool Cognitive Services Emotion APIs.

Similar Articles