Microsoft Translation Fails

Issue #19 resolved
Marco Wobben created an issue

Using the Microsoft translation service fails on missing region specification.

Providing the translation service with just the configurable Subscription Key fails in my case. Somehow both the end-point and the region needs to be specified to make the calls work. Therefor these specifications need to be configurable in the BTM settings. Such as (taken from the CURL examples):

‌ -H "Ocp-Apim-Subscription-Region:westeurope"

But even the:
"https://api.cognitive.microsofttranslator.com/….”

Comments (7)

  1. Anders Melander repo owner

    According to the API specification at https://docs.microsoft.com/da-dk/azure/cognitive-services/translator/reference/v3-0-reference#authentication

    Ocp-Apim-Subscription-Region Use with Cognitive Services multi-service and regional translator resource.

    The value is the region of the multi-service or regional translator resource. This value is optional when using a global translator resource.

    Since I’m using the Global (non-regional) endpoint api.cognitive.microsofttranslator.com I do not need to specify the Ocp-Apim-Subscription-Region parameter.

    I think the problem might be that your Azure Cognitive Services resource is tied to a specific region. The resource I’m testing with has Location=Global.

    I will see what I can do about about supporting other regions.

  2. Anders Melander repo owner

    I can confirm that the region of the Azure resource needs to be “Global” so I guess that when the API documentation mentions “global translator resource” it’s talking about the subscription and not the web service.

    I have made a new version which will allow you to configure the region in BTM but I will not have time to upload it until later today.

  3. Log in to comment