20
Views
3
Comments
Solved
[Azure Cognitive Services Connector] 401000: The request is not authorized because credentials are missing or invalid.
Question
Application Type
Mobile

Hi!

I am attempting to use the Server Action "Translate" from the folder "TranslatorTextAPI" in an application, but I'm getting the following error: "401000: The request is not authorized because credentials are missing or invalid".

I have done the following:

  1. I have created a "Translate resource" at in the Azure portal (https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation)
  2. I have entered my API key found in the Azure portal in Service Center (Site property: OcpApimSubscriptionKey_TranslatorTextAPI) 
  3. I have also attempted to set the "URL obtained from the Azure Portal" in Service Center, even though this value is equal to the default value in Service Center.


Is there something I have missed? Should for example my region be specified somewhere?


Best 

Martin



2022-02-18 15-32-27
João Almeida
Champion
Solution

Hi martin,

Yes, that's correct, the key should be "Ocp-Apim-Subscription-Region"

2018-09-25 20-12-57
João Martins Pereira
 
MVP

Hi Martin, yes definitive check the region and if all the API Keys are ok if needed generate new ones.

But seems that error is because of the region I got one similar using the QnA Maker.

Check also if your REST API inputs in OutSystems side are like this :

-Ocp-Apim-Subscription-Key

-CustomRegion

2023-12-14 14-46-57
Martin Hagen Myrestrand

Thank you for your response João. 


My current solution is to set my translate resource in the Azure portal to "Global", then modifying my TranslatorTextAPI URL (Service Center) to

"https://api-eur.cognitive.microsofttranslator.com/"

(This way we seem to at least limit the API to use european data centers)


To make sure that I understand you correctly:

Do you mean that I should enter "CustomRegion" as a header here (screenshot) to specify my region? 

2022-02-18 15-32-27
João Almeida
Champion
Solution

Hi martin,

Yes, that's correct, the key should be "Ocp-Apim-Subscription-Region"

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.