Skip to main content
In this quickstart, you use the Azure Language in Foundry Tools language detection feature to identify the language of input text. You can get started using your preferred client library, the REST API, or the Microsoft Foundry portal. If you don’t have an Azure subscription, create a free account before you begin.

Troubleshooting

IssueResolution
You get a 401 or 403 error when calling the API.Confirm your key and endpoint are correct for the same Azure AI resource. If you recently changed role assignments, wait a few minutes and try again.
You get an error about missing environment variables.Confirm LANGUAGE_KEY and LANGUAGE_ENDPOINT are set in your environment before you run the sample.
The Foundry experience doesn’t match the steps.In the Foundry portal, use the version toggle to switch between Foundry (classic) and Foundry (new), then follow the matching tab in the Foundry section.
The API returns unknown as the detected language.The input text might be too short or ambiguous. Provide a longer text sample or set the Country/region hint to improve accuracy.
The API returns an InvalidCountryHint error.Confirm the country/region hint code is a valid ISO 3166-1 alpha-2 code (for example, US, FR, JP).

Clean up resources

If you no longer need the resources you created in this quickstart, delete the individual resource or the entire resource group. Deleting the resource group also deletes all other resources associated with it.