Language API version 2023-01-01-preview is not available

Stas Khirman 0 Reputation points
2023-08-08T12:11:27.4466667+00:00

Hi all,

I'm trying to test AI Services to detect PII information inside of Hebrew text. According to documentation, it has to be supported since "2023-01-01-preview" model (https://free.blessedness.top/en-us/azure/ai-services/language-service/personally-identifiable-information/language-support?tabs=documents )

However, the following code

text_analytics_client = TextAnalyticsClient(
    endpoint=endpoint, 
    credential=AzureKeyCredential(key),
    default_language="he",
    api_version = "2023-01-01-preview"
)

returns error: API version 2023-01-01-preview is not available.

Do I have to somehow re-configure Azure service to get access to "preview" models? Or it have some additional approval process?

Regards

Stas

Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 25,761 Reputation points Volunteer Moderator
    2025-09-28T23:08:10.05+00:00

    Hello Stas Khirman,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    Regarding your issues, instead of, no definitive check that your endpoint/resource kind was the cause and to avoid any speculative region/sku/feature names. The below is the way out orderly:

    1. Step A: Start by confirming the resource kind and endpoint via Azure Portal (Overview blade) or Azure CLI:
         az cognitiveservices account show \
           --name <your-resource-name> \
           --resource-group <your-rg> \
           --query "{kind: kind, endpoint: properties.endpoint, sku: sku.name}" \
           -o json
      
      If your resource isn’t of kind AIServices or specifically an Azure AI Language resource, the API won’t match. - https://free.blessedness.top/en-us/cli/azure/cognitiveservices/account?view=azure-cli-latest
    2. B: Ensure you're using the latest version of the SDK: pip install --upgrade azure-ai-textanalytics Version 5.3.x+ defaults to the stable 2023-04-01 API, which avoids issues caused by older or preview versions. SDK Docs
    3. C: Avoid specifying outdated preview versions like 2023-01-01-preview. Let the SDK auto-select or explicitly use 2023-04-01:
         from azure.ai.textanalytics import TextAnalyticsClient
         from azure.core.credentials import AzureKeyCredential
         client = TextAnalyticsClient(endpoint="<your-endpoint>", credential=AzureKeyCredential("<your-key>"))
         result = client.recognizepiientities(["שמי דוד ואני גר בתל אביב. הטלפון שלי הוא 055-1234567"], language="he")
      
      This ensures compatibility with your resource and avoids version mismatch errors.
    4. D: Use curl to check if the preview version is supported:
         curl -X POST "https://<your-resource>.cognitiveservices.azure.com/language/analyze-text/jobs?api-version=2023-01-01-preview" \
           -H "Ocp-Apim-Subscription-Key: <your-key>" \
           -H "Content-Type: application/json" \
           -d '{"displayName":"PII Test","analysisInput":{"documents":[{"id":"1","language":"he","text":"שמי דוד… 055-1234567"}]},"tasks":[{"kind":"PiiEntityRecognition","taskName":"pii1"}]}'
      
      If you get a 400/404 error, the preview version isn’t supported in your region or by your resource. REST Docs
    5. E: If your current resource doesn’t support the needed API, create a new one with kind AIServices in a supported region:
         az cognitiveservices account create \
           --name my-language-resource \
           --resource-group my-rg \
           --kind AIServices \
           --sku S0 \
           --location westus2 \
           --yes
      
      This ensures full compatibility with the latest Azure Language APIs. Create Resource Guide
    6. F: Only register subscription-level previews if explicitly mentioned in Azure docs. Use:
         az feature register --namespace <namespace> --name <feature-name>
      
      Avoid guessing feature names and check the official documentation first. - https://free.blessedness.top/en-us/azure/azure-resource-manager/management/preview-features

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.