Azure-sdk-for-net: [DOC] Add Cognitive Services requires custom subdomain for TokenCred to docs

Created on 16 Jun 2020  路  5Comments  路  Source: Azure/azure-sdk-for-net

TokenCredential requires that the cognitive service be created with a subdomain.

This should be added to docs and readmes.

https://docs.microsoft.com/en-us/azure/cognitive-services/authentication#create-a-resource-with-a-custom-subdomain

See #12777

azsdke2e

Client Cognitive - Form Recognizer

All 5 comments

Looks like already there, but I missed it.

https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.AI.FormRecognizer/1.0.0-preview.3/api/index.html#create-formrecognizerclient-with-azure-active-directory-credential

Note that regional endpoints do not support AAD authentication. Create a custom subdomain for your resource in order to use this type of authentication.

Reopening with this suggestion:

I think part of it is that I didn't know there were two models.
Maybe a section in readme to talk about the two models or a link to a doc that does

It looks like the error message has been updated to be more clear when AAD auth is attempted without a custom subdomain name:
(BadRequest) Please provide a custom subdomain for token authentication, otherwise API key is required. (Please see https://aka.ms/cogsvc-authenticatewithtoken)

@maririos - I suggest that we call this out better in docs. It's there, but would be good to explain the difference and what each one looks like.

Fair point

Was this page helpful?
0 / 5 - 0 ratings