azure translation authorization error

Terry 1 Reputation point
2020-08-19T10:05:50.353+00:00

Hi

I create a cognitive services resource in my portal and create the text translate in this service.

I try the sample(Authenticating with a global resource) as below

https://learn.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference

but error occurred

error message :
{"error":{"code":401000,"message":"The request is not authorized because credentials are missing or invalid."}}

Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
338 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Андрей Симагин 11 Reputation points
    2020-08-27T06:24:46.71+00:00

    My Error when I want create Translator

    Не удалось вычислить функцию: [filter(parse('[{"label": ""Бесплатный" F0 (до 2 млн символов на перевод в месяц)", "value": "F0"}, {"label": ""Стандартный" S1 (оплата по мере использования)", "value": "S1"}, {"label": ""Стандартный" S2 (ежемесячное обязательство — 250 млн символов)", "value": "S2"}, {"label": ""Стандартный" S3 (ежемесячное обязательство — 1 млрд символов)", "value": "S3"}, {"label": ""Стандартный" S4 (ежемесячное обязательство — 10 млрд символов)", "value": "S4"},{"label": "C2 (ежемесячное обязательство — 62,5 млн символов)", "value": "C2"},{"label": "C3 (ежемесячное обязательство — 250 млн символов)", "value": "C3"},{"label": "C4 (ежемесячное обязательство — 2,5 млрд символов)", "value": "C4"}]'),(dropdownItem) => contains(map(filter(basics('checkSkuAvailableApi').value, (sku) => sku.skuAvailable), (availableSku) => availableSku.skuName), dropdownItem.value))]

    2 people found this answer helpful.

  2. romungi-MSFT 41,856 Reputation points Microsoft Employee
    2020-08-19T13:45:22.663+00:00

    @Terry Could you please check if you are using the authentication headers in your request? You could use the bearer token with authorization header or Ocp-Apim-Subscription-Key with the secret value of your resource. If you have created a global translator resource then you should use the Ocp-Apim-Subscription-Key header instead.

    1 person found this answer helpful.