Create your free Microsoft Azure Account

Some of the challenges on our site require a Microsoft Azure account in order for you to use Microsoft's Cognitive Services API. This API provides functions to analyse images, understand text, convert audio to text and more. For each Microsoft Cognitive API function you want to use, you need to create a resource in your Microsoft Azure account and then get an API key for that resource.

For example, if you want to OCR read text from an image, you would need an API key from the Computer Vision collection of services.

If you wanted to analyse faces, you would need a different API key for the Face collection of services

The challenges on this site require keys for the following

  • Microsoft Match Game
    • Only one key needed
      • Computer Vision API Key
  • Who's Who
    • Two keys needed
      • A Face API key
      • A Computer Vision API key

Creating a Trial Microsoft Azure Account

If you already have a Microsoft Azure account you can use this, otherwise, you can create a trial account in one of three ways:

1. If you are a student, you can use this link below to create a free academic account with $100 of free credit: Visit aka.ms/azure4students

2. You can sign up for a free trial with £150 of free credit, however you will need to supply mobile phone information and a credit card, but Microsoft will not charge this unless you upgrade your account to a paid account (please see Microsoft Ts and Cs). Visit azure.microsoft.com/en-gb/free

3. You can sign up for a limited 7 day trial to just the Cognitive Services APIs that we will need for the event and you will not need to enter phone numbers and credit card details - if you would prefer to do that, please click here for instructions.

  • The 7 day trial signup gives you API keys for Computer Vision as soon as you login, you do not have to create resources as described in the Getting the API Keys section below.
  • NOTE: The 7 day trial only allows the use of resources in West Central US, so, you will need to update the template source code to point to West Central US region as described in the instructions page.

Getting the API Keys

Once your account has been created you will be signed into the Azure Portal. Click on 'Create a resource' as highlighted in the screen below:

wiwsignup3.png

We'll get a Face API key in this example, but, you follow the same steps for each API key that you need.

Getting a Face API Key

Select 'AI + Cognitive Service' and then 'Face API':

wiwsignup4.png

This will display a new window to allow you to create the service:

wiwsignup1.png

Here are details about the options you need to choose in this dialogue box.

  • Name - Enter a name so you can identify your service. This name will appear on your Azure dashboard e.g. 'face_api'.
  • Subscription - Select 'Azure for Students' or 'Free Trial'.
  • Location - Select 'West Europe'. You have to know the location you create services in. When you call the API, you will call it using a URL for the region the service exits in, so. make sure to use West Europe in this example.
  • Pricing tier
    • Choose an appropriate pricing tier. If you have a trial with free credit, you can select a pricing option that increases the number of calls you can make per minute or per second. If you are on a trial that does not have free credit you may be restricted to the 20 calls per minute tier. This will slow down your ability to make moves in games and could be a disadvantage.
      • Select free 'S0 (10 calls per second) if you can
  • Resource group - Create a new group and give it a descriptive name so you can identify it later if you need to. Maybe call it 'AIGaming Challenges'.
  • Pin to dashboard - Tick this option so that you will see the service on your dashboard when you login.

Once you have clicked 'Create' it will create the API service and after a few moments you will be directed to the screen as shown below:

wiwsignup5.png

Then click on 'Keys' in the section 'Grab your keys' and you will be redirected to the window as shown below:

wiwsignup6.png

IMPORTANT Take a note of 'Key 1' as you will need this when creating your bot (note in the picture above part of the key is blanked out for security reasons). You can use either Key 1 or Key 2, both are valid keys for this service.

That's it, you have created an API key for the Face Microsoft Cognitive API service. You will use this key in the code you write to access the Microsoft Cognitive API services.

If you just need a Face API key, you can skip to the next section, but, just for completeness, we included a similar section below that gets an API key for the Vision API

Getting a Vision API key

Click on 'Create a resource', select 'AI + Cognitive Service' and then 'Vision API':

wiwsignup7.png

This will display a new window to allow you to create the service:

wiwsignup2.png
  • Name - Enter the name of your service as it will appear on the Azure dashboard e.g. 'Vision_api'.
  • Subscription - Select 'Azure for Students' or 'Free Trial'.
  • Location - Select 'West Europe'.
  • Pricing tier - Select free 'S1 (10 calls per second)
  • Resource group - Select the existing group e.g. 'Group_test'.
  • Pin to dashboard - Tick to place an icon the dashboard for the service.

Once you have clicked 'Create' it will create the API service and after a few moments you will be directed to the screen as shown below:

wiwsignup8.png

Then click on 'Keys' in the section 'Grab your keys' and you will be redirected to the window as shown below:

wiwsignup9.png

IMPORTANT Take a note of 'Key 1' as you will need this when creating your bot (note in the picture above part of the key is blanked out for security reasons).

Using the API Keys in our Demo Code

The API keys you created through the above process can now be used in the demo code supplied in our Online Code Editor. Wherever you need an API key, we will have highlighted the place that you need to insert it with the following code:

headers_face = {'Ocp-Apim-Subscription-Key': 'YOUR-MICROSOFT-FACE-API-KEY-HERE'}
headers_vision = {'Ocp-Apim-Subscription-Key': 'YOUR-MICROSOFT-COMPUTER-VISION-API-KEY-HERE'}

If you want to use any of the other Microsoft API calls you will need to go through a similar process of selecting and creating the services.

When creating the service for some of the API calls be mindful of the location you select - if you choose something other than Western Europe, you will need to tailor the URLs when calling the APIs from your code. In the examples below you can see that all our demo code API URLs expect API keys to be from the West Europe location:

face_api_url = 'https://westeurope.api.cognitive.microsoft.com/face/v1.0/detect'
face_compare_api_url = 'https://westeurope.api.cognitive.microsoft.com/face/v1.0/verify'
ocr_vision_api_url = 'https://westeurope.api.cognitive.microsoft.com/vision/v1.0/ocr'
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License