Announcements: Action Required before April 30, 2017 - Microsoft Translator Moves to Azure

Microsoft Translator is now available for purchase in the Azure portal. For current Microsoft Translator API subscribers 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
  • A new billing and usage dashboard

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 Trial, which includes a $200 USD credit to spend on any Azure Service, or the equivalent in your currency.
  • Azure customers can include a subscription to Microsoft Translator as part of the overall Azure purchase.

 

What you need to know about your subscription

You may subscribe to the Microsoft Translator API in the Azure portal anytime. Beginning January 1, 2017, service access on Microsoft DataMarket is limited to the monthly volume plan subscribed. You will not be able to upgrade or downgrade your subscription tier, you can only cancel. 

IMPORTANT: If you're using CTF (Collaborative Translations Framework), migrate your CTF translations before April 30, 2017 by following these simple steps using the CTF mapper.

You can have two Translator API subscriptions on the two portals at the same time as you move from the Microsoft DataMarket portal to the Azure portal.

*DataMarket Subscription Cancellations*

  • After you begin using the Translator API subscription in the Azure portal, cancel your DataMarket subscription or you will continue to be charged for the subscription (charged at the beginning of the billing period). 
  • Any remaining Microsoft Translator API subscriptions in DataMarket will then be automatically canceled on April 30, 2017.

 

How to sign up for Microsoft Translator on Azure

1.     Sign up for a Microsoft Azure account. 

2. After you have an account, 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 Intelligence from the list of services.
  • Select Cognitive Services APIs.
  • Select the API Type option.
  • Select either Text Translation or Speech Translation
  •  In the Pricing Tier section, select the pricing tier that fits your needs.
  • Fill out the rest of the form, and press the Create button
  • You are now subscribed to Microsoft Translator!

4.      Retrieve your authentication key.

  • Go to All Resources and select the Microsoft Translator API you subscribed to.
  • Go to the Keys option and copy your subscription key to access the service.

5.      Learn, test and get support on the API 

 

Information for Microsoft Translator Hub users 

Please keep in mind to plan ahead in changing your applications and subscribe to the Microsoft Translator API on the Azure portal before April 30, 2017.

If you are currently subscribed to the Microsoft Translator API on Microsoft DataMarket at https://datamarket.azure.com/home, the Hub will begin prompting you to associate your Hub workspace with a new Translator API subscription on the Azure portal. If you have multiple Hub workspaces, you do not need to associate them with a new subscription on the portal all at the same time. You can associate each workspace with a new subscription on the portal independent of each other.

Your applications can use your existing and your newly created customized systems no matter if you are subscribed to the Microsoft Translator API on Microsoft DataMarket or on the Azure portal. 


How to update your code

To begin using the Microsoft Translator subscription from Azure, you will need to replace the app authentication using your Microsoft Data Market 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.



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


Additional questions?

View customer questions or add your own on the Microsoft Translator Azure forum at aka.ms/TranslatorAzureForum

Feedback and Knowledge Base