Azure

🌐 How to Create and Explore the Translator Service in Microsoft Azure

8 1
Written by shohal

Azure Translator is a powerful AI service that enables real-time language translation in your applications. In this guide, we’ll walk through creating a Translator resource, exploring its features, and understanding how to use it in a real-world scenario.

✅ Prerequisites

🚀 Step 1: Create a Translator Resource

Log in to the Azure Portal
Open https://portal.azure.com in a browser and log in with your Microsoft account.

Create a new resource

  • Click on + Create a resource.
  • Search for Translator in the Marketplace.
  • Select Translator, then click Create.

Configure the Translator Resource
Fill out the form with the following details:

  • Subscription: Your Azure subscription
  • Resource group: Create a new one or choose an existing group
  • Region: Select a region (e.g., East US, West Europe)
  • Name: Enter a unique name (e.g., translator-demo-01)
  • Pricing tier: Select Standard S0

Click Review + Create, then Create again to deploy the resource.

🔍 Step 2: Explore the Translator Resource

Once deployed:

  1. Navigate to the newly created Translator resource.
  2. On the Overview page, locate the Try it section.
  3. In the From: Auto detect field, type: cssCopyEdit
Welcome to Azure AI Fundamentals

What You’ll See:

  • The Request JSON appears under View request showing how the text is packaged for the Translator API.
  • The Response JSON appears under View response showing:
    • Detected language
    • Confidence score
    • Translated text
    • Language code

💡 Step 3: Review Sample Code

Click on the Sample Code tab to view how to make translation requests using popular languages like:

  • C#
  • Java
  • Python
  • JavaScript

In each code sample, look for where to insert your Translator key and endpoint. Typically, you’ll find lines like:

subscription_key = "YOUR_KEY_HERE"
endpoint = "https://YOUR-REGION.api.cognitive.microsofttranslator.com"

This is how your app would securely access the Translator service.

Create a Translator resource

You can use the Translator service by creating either a Translator resource or an Azure AI services resource.

For this exercise, create an Translator resource in your Azure subscription.

  1. In another browser tab, open the Azure portal at https://portal.azure.com, signing in with your Microsoft account.
  1. Click the Create a resource button and search for Translator. Select create. You will be
1 1
  1. taken to a page to create a Translator resource. Configure it with the following settings:
2 1
  1. SubscriptionYour Azure subscription.
  2. Resource groupSelect or create a resource group with a unique name.
  3. RegionChoose any available region.
  4. NameEnter a unique name.
3 1
  1. Pricing tier: Standard S0
4 1
  1. Review and create the resource, and wait for deployment to complete. Then go to the deployed resource.
5 1

Explore Translator service

We can explore the capabilities of the Translator service in the Azure Portal.

  1. In the Azure portal, in the deployed resource, review the Overview page.
6 1

  • In the Try it section of the Overview page, under the From: Auto detect section, type the text Welcome to Azure AI Fundamentals. Notice the JSON that appears in correspondence in the View request section.
7 1
  • In the View response section, view the JSON. Behind the scenes, a request has been sent to the Translator service. The response includes the detected source language with a confidence score, a translation using the alphabet of the output language, and an output language code.
  • The demo in the Try it section shows what it would look like if you created a simple translation application with a user interface. In the case of the demo, as soon as you type in text, a request is made to the Translator service. How could you make this request? Check out the Sample Code tab. Here you see examples of code in different programming languages that could be used to make the request.
  • Identify the lines in the code samples where you need to include your Translator service’s Key and Endpoint. With your key and endpoint, you would be able to send a request to the Translator service, and receive a response like you saw in the demo.
  • Navigate to the left hand menu. Under Resource Management, select Keys and Endpoint. If you were to build an application, you would find your key and endpoint here.

🧹 Step 5: Clean Up (Important!)

  1. When you’re done experimenting:
  2. Go back to your Resource Group
  3. Click Delete Resource Group
  4. Confirm deletion to avoid charges

We hope these questions helped reinforce your Microsoft Azure Translator Service knowledge! Got more Azure questions or suggestions? Drop a comment below or check out more tutorials at Techtweet.xyz.

About the author

shohal

Leave a Comment