The service and how you reach it
Azure Language in Foundry Tools extracts and analyzes information from text. You reach it through a provisioned Microsoft Foundry resource, which gives you an endpoint and an authentication key. Requests go over a REST interface in JSON, or through a language-specific SDK (Python, C#, JavaScript).
Key concept · Two ways to authenticate
Key-based — pass an AzureKeyCredential built from the resource key. Microsoft Entra ID — pass DefaultAzureCredential(), which uses the running context's identity; this is recommended for production because it avoids embedding secrets. Both create a TextAnalyticsClient against the resource endpoint. Note: the portal home shows the project endpoint/key; the resource-level endpoint and key live under the Admin tab on the Operate page.
Language, then who and what
Language detection returns a language name, its ISO 6391 code (e.g. en, fr), and a confidence score from 0–1. It handles content stores of unknown-language text and chat apps that must adapt to the user. Constraints: 5,120 characters per document, 1,000 documents per request. Mixed-language text returns the dominant language at a lower score; unparseable input returns (unknown) with score 0.
Key concept · Named Entity Recognition
NER (recognize_entities()) finds entities and sorts them into predefined categories and subcategories: Person, Location, DateTime, Organization, Address, Email, URL, PersonType (a job title/role such as "CEO"), and more. Each result gives the entity text plus its category, so "Satya Nadella … CEO of Microsoft … February 4, 2014" resolves to Person, PersonType, Organization, and DateTime.
Finding and hiding personal data
PII detection (recognize_pii_entities()) identifies sensitive items — names, addresses, phone numbers, emails, Social Security numbers, credit-card numbers, organizations, dates — for cleaning customer feedback, protecting medical or legal records, and meeting privacy rules.
Key concept · Extraction vs. redaction
The same call returns both: an entity list (text, category such as USSocialSecurityNumber, and a confidence score) and a redacted_text string where each detected value is masked with asterisks. You tag each document with its language (e.g. "en") and can submit a batch. So one request both tells you what sensitive data is present and hands back a share-safe version of the text.
A note on scope: Azure Language also offers sentiment analysis, summarization, and key-phrase extraction, but these are now deprecated capabilities kept for backward compatibility — the current module centers on detection, NER, and PII.
Chapter 16 quiz
Fourteen questions on provisioning, language detection, entity recognition, and PII. Answer first, then expand Show answer.
Part A · Multiple choice
What does Azure Language give you when you provision its Foundry resource?
- A A fine-tuned model only
- B An endpoint and an authentication key
- C A vector database
- D A container registry
Show answer
B. Requests go to the endpoint, authenticated with the key (or Entra ID).
Which authentication method is recommended for production?
- A Microsoft Entra ID via DefaultAzureCredential
- B Hard-coded key in source
- C No authentication
- D A shared password
Show answer
A. It uses the running context's identity and avoids embedding secrets.
What does language detection return alongside the language name?
- A A sentiment score
- B An ISO 6391 code and a confidence score (0–1)
- C A translation
- D A redacted string
Show answer
B. e.g. English, "en", 0.9.
What is the maximum document size for a language-detection request?
- A 512 characters
- B 5,120 characters
- C 50,000 characters
- D Unlimited
Show answer
B — 5,120 characters, with up to 1,000 documents per request.
Which NER category represents a job title or role like "CEO"?
- A Person
- B PersonType
- C Organization
- D Address
Show answer
B — PersonType. Person is the individual; PersonType is their role.
A single PII call returns which two things?
- A A translation and a summary
- B An entity list and a redacted_text string
- C Only a boolean flag
- D An image and a caption
Show answer
B. The detected entities plus a masked version of the text.
Part B · True or false
Mixed-language text returns the dominant language, usually at a lower confidence score.
Show answer
True. The score reflects the marginal strength of that call.
Unparseable input returns "(unknown)" with a confidence score of 0.
Show answer
True. Often caused by character-encoding issues.
NER returns only the entity text, not its category.
Show answer
False. It returns both the text and the category (and subcategory).
Sentiment analysis and summarization are the module's primary, current capabilities.
Show answer
False. They're deprecated (kept for backward compatibility); the focus is detection, NER, and PII.
You must tag each document with its language when calling PII recognition.
Show answer
True. e.g. language="en".
Part C · Short answer
Name three NER entity categories.
Show answer
Any three: Person, Location, DateTime, Organization, Address, Email, URL, PersonType.
Where in the portal do you find the resource-level (not project) endpoint and key?
Show answer
The Admin tab on the Operate page — viewing the parent resource.
Give three types of sensitive data PII detection can find.
Show answer
Any three: names, addresses, phone numbers, emails, Social Security numbers, credit-card numbers, organizations, dates.