Announcements: Microsoft Translator Moves to the Azure portal

Microsoft Translator is now available in the Azure portal. The Microsoft DataMarket platform retired on April 30, 2017.

For Microsoft Translator API subscribers previously subscribed in Microsoft DataMarket, the move to the Azure portal requires a small code change in your applications. This page provides you with the information to move to the new platform.

Benefits of switching to Azure

The move to the Azure portal includes:
  • Introduction to a new Pay-As-You-Go offer.
  • Price discounts for higher monthly volume commitments including overage.

In addition:

  • The free subscription tier continues to be offered for monthly use up to 2 million characters.
  • New users to the Azure portal can sign up for a free 30-day Azure subscription trial, which includes a $200 USD credit (ore the equivalent in your currency), to spend on any Azure Service, which includes the Microsoft Translator API.
  • Existing Azure customers can include a subscription to the Microsoft Translator API as part of the overall Azure purchase.

 How to sign up for Microsoft Translator on Azure

1.     Sign up for a Microsoft Azure account (credit card required)

2.   After you have created an Azure account, subscribe to Azure. You will not be charged for Azure unless you use it. Then sign into the Azure portal at http://portal.azure.com.

3.     Add a Microsoft Translator API subscription to your Azure account.

  • Select the "+ New" option.
  • Select "AI + Cognitive Services" from the list of Azure services.
  • Select either "Translator Text API" or "Translator Speech API".
  • Press the "Create" button when you're ready to create your Microsoft Translator API subscription.
  • Complete the fields and press the "Create" button and you're now subscribed to Microsoft Translator.

4.      Retrieve your authentication key.

  • Go to "All Resources" and select the Microsoft Translator API subscription account you are subscribed to.
  • Select the "Keys" option and copy your subscription key to access the service. Learn more on why Azure generates two keys

5.      Learn, test and get support on the API 

Information for Microsoft Translator Hub users 

Your applications can use your existing and your newly created customized systems if you are subscribed to the Microsoft Translator Text API in the Azure portal. 

How to update your code

For Microsoft Translator API users previously subscribed in DataMarket, to continue using the Microsoft Translator API from the Azure portal, you will need to replace the app authentication using your Microsoft DataMarket Client ID and Client Secret with your new Azure key. The single Azure key is used to request an Azure token for the Microsoft Translator service.

Refer to the documentation for getting an Azure token. Learn more on why Azure generates two keys.



Below is an example of requesting an Azure token for the Translator service in C#. You can view a fully functional simple console app in C# for requesting a token on GitHub.

 

Example:

authTokenSource = new AzureAuthToken("https://api.cognitive.microsoft.com/sts/v1.0/issueToken");

            var token = await authTokenSource.GetAccessTokenAsync(this.AzureSubscriptionKeyForText);

 

using System;

using System.Net.Http;

using System.Threading.Tasks;

 

namespace Microsoft.MT.Api.Client

{

    /// <summary>

    /// Client to call Cognitive Services Azure Auth Token service in order to get an access token.

    /// </summary>

    public class AzureAuthToken

    {

        private const string OcpApimSubscriptionKeyHeader = "Ocp-Apim-Subscription-Key";

 

        public Uri ServiceUrl { get; private set; }

 

        /// <summary>

        /// Creates a client to obtain an access token.

        /// </summary>

        /// <param name="serviceUrl">URL of the service to target.</param>

        public AzureAuthToken(string serviceUrl)

        {

            if (string.IsNullOrWhiteSpace(serviceUrl)) throw new ArgumentNullException(nameof(serviceUrl));

 

            Uri actualUri;

            if (!Uri.TryCreate(serviceUrl, UriKind.Absolute, out actualUri))

            {                

                throw new ArgumentException(nameof(serviceUrl), $"Invalid service URL: {serviceUrl}");

            }

            this.ServiceUrl = new Uri(serviceUrl);

        }

 

        /// <summary>

        /// Gets a token for the specified subscription.

        /// </summary>

        /// <param name="subscriptionSecret">Subscription secret key.</param>

        /// <returns>The encoded JWT token.</returns>

        public async Task<string> GetAccessTokenAsync(string subscriptionSecret)

       {

            using (var client = new HttpClient())

            using (var request = new HttpRequestMessage())

            {

                request.Method = HttpMethod.Post;

                request.RequestUri = this.ServiceUrl;

                request.Content = new StringContent(string.Empty);

                request.Headers.TryAddWithoutValidation(OcpApimSubscriptionKeyHeader, subscriptionSecret);

                var response = await client.SendAsync(request);

                response.EnsureSuccessStatusCode();

                var token = await response.Content.ReadAsStringAsync();

                return token;

            }

        }

 

        /// <summary>

        /// Gets a token for the specified subscription. The token is prefixed with "Bearer ".

        /// </summary>

        /// <param name="subscriptionSecret">Subscription secret key.</param>

        /// <returns>The encoded JWT token, prefixed with "Bearer ".</returns>

        public async Task<string> GetBearerAccessTokenAsync(string subscriptionSecret)

        {

            return "Bearer " + await this.GetAccessTokenAsync(subscriptionSecret);

        }

    }

}

 

For more Azure documentation, visit https://azure.microsoft.com/en-us/documentation/articles/?term=portal

Resources for getting started


Edited on August 30, 2017

Translator

  1. Announcements: Microsoft Translator Moves to the Azure portal
  2. API - Translator Data Centers
  3. API and Hub: Confidentiality
  4. API - Translator Text: How to report an issue with the API
  5. API - Translator Speech: Microsoft Translator Speech API references
  6. API - Translator Text / Speech: Get a report of your consumption
  7. API - Translator Text / Speech: Using the API key directly in the call. No more token.
  8. API - Translator Text / Speech: Why are there two keys for my API subscription?
  9. API - Translator Text: Using Neural MT Systems
  10. API - Translator Text: My CAT tool isn't working and is asking for the Client ID and Client Secret
  11. API - Translator Text: Limits
  12. API - Translator Text: How Microsoft Translator counts characters
  13. API - Translator Text: Gender selection in the Speak() method
  14. API - Translator Text: Trados plugin for Microsoft Translator
  15. API - Translator Text: Java- Using SSL with the Microsoft Translator API
  16. API - Translator Text: European datacenter
  17. API - Translator Text: Languages detected by the Detect() method
  18. API - Translator Text: Using the Collaborative Translation Framework (CTF)
  19. API - Translator Text: First few Microsoft Translator API requests succeed, then the calls fail
  20. API - Translator Text: Microsoft Translator with IP filtered firewalls
  21. API - Translator Text: Profanity filtering in the TranslateArray() method
  22. Hub: API Preview released
  23. Hub: Translator Hub Resource Guide
  24. Hub: August 2016 Release notes
  25. Hub: Deployment of a custom system requires a Microsoft Translator Text API subscription in the Azure portal
  26. Hub: Capacity of custom Microsoft Translator Hub systems
  27. Hub: Building a custom system using a dictionary only
  28. Hub: Deployment of a custom system requires a Microsoft Translator subscription in the Azure portal
  29. Business Applications: Security and Privacy in Microsoft Office Products

Feedback and Knowledge Base