azureazure-cognitive-servicestext-analytics-api

Cognitive services text translation authentication issue


I'm utilizing Azure's Cognitive Services Text Analysis API. I'm attempting to authenticate by passing my secret key for an access token via these instructions: https://learn.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference

I POST my Ocp-Apim-Subscription-Key to https://eastus.api.cognitive.microsoft.com/sts/v1.0/issueToken and get the following error:

{"error":{"code":"401","message": "The issueToken Operation under Token API V1.0 API is not supported with the current subscription key and pricing tier TextAnalytics.S."}}

I'm performing this authentication request using The Info Lab's macro in Alteryx - https://www.theinformationlab.co.uk/2017/09/26/translate-foreign-language-text-alteryx/ - I had to edit URL in the macro to add the "eastus" as the region in the issueToken request. Before I did that, I was getting an AccessDenied error response. At least now I know it's logging on to my resource because it will change the last letter in the error from "F" (free) to "S" to "S1" which are the pricing tiers I was switching between.

I have a pay-as-you-go subscription and I switched the resource to use Free, S, and S0 pricing tiers. Still always getting the same error. Please help!

Thank you

All provided in my summary.

I expect to get an authenticated token.


Solution

  • Per my understanding, you want to use Azure translator API and want to get an authenticated token specified by region. Based this doc mentioned , if you want to get a region based token, you should use Cognitive Service’s multi-service subscription . You can create a multi-service subscription by this link and you can get a token by its region and key as below :

    enter image description here

    For differences between Single-service resource and Multi-service resource , as official mentioned :

    Multi-service resource: Access multiple Azure Cognitive Services with a single key and endpoint. Consolidates billing from the services you use.

    Single-service resource: Access a single Azure Cognitive Service with a unique key and endpoint for each service created. Use the free tier to try out the service.

    As we know except for translation service , there are many other services on Azure cognitive service . So when you create a Multi-service resource , you can call all Azure Cognitive Services . If you just need one or two kind Azure Cognitive Services or you want to get a separate billing of them, you can create Single-service resources separately.

    In a wold, the differences between them is more about management instead of service.

    Hope it helps.