AI-102 Cheatsheet
Designing and Implementing a Microsoft Azure AI Solution
Download free PDFPlan, secure and operate AI services
Choose and provision the service
- **Azure AI services** provide pretrained capabilities through REST APIs and SDKs. A supported **multi-service resource** shares credentials and billing across capabilities; specialized services can require separate resources.
- **Vision** describes images; **Custom Vision** learns business-specific image labels or objects; **Document Intelligence** extracts document structure and fields; **Language** analyzes text; **Speech** processes audio.
- **Azure AI Search** indexes and retrieves content. **Azure OpenAI** generates responses or embeddings. **Content Safety** assesses harmful content. Select the capability before choosing an API client.
- **Resource Manager** provisions resources through the management plane; inference uses the service data endpoint. Resource definitions include **kind**, **location**, **SKU** and properties. F0 denotes a free SKU where supported.
- **Keys and Endpoint** supplies connection settings. Use the endpoint and region of the actual resource; display names, subscription IDs and tenant IDs are not inference credentials. **az cognitiveservices account show** retrieves account details.
Authentication and least privilege
- **Microsoft Entra ID** tokens and **managed identities** avoid application-held secrets where supported. Grant the service data role needed for inference; management access and data access are separate permissions.
- **API keys** authorize access to a resource. Store them in **Key Vault** or protected configuration; never embed them in client apps, images, source control or shell history.
- **Two-key rotation** preserves service: move clients to a valid alternate key, regenerate the exposed key, update clients, then rotate the remaining key when needed. Regenerating Key2 changes only that key.
- **Cognitive Services OpenAI User** supports inference with Entra ID and viewing deployments. **Cognitive Services OpenAI Contributor** adds dataset upload, fine-tuning and deployment management; resource creation and key management need other permissions.
- **Least privilege** scopes assignments to the needed resource and actions. Separate dataset editing, model publishing, inference and key regeneration; use a narrowly scoped custom role when built-in roles are broader than required.
Private connectivity and data boundaries
- **Private endpoints** expose a service through a private IP in a virtual network. Configure **private DNS**, routing and endpoint approval so clients resolve and reach that private address.
- **Public network access** and firewall rules control the public endpoint separately. Disable or restrict public access when private-only connectivity is required; creating a private endpoint alone does not close the public endpoint.
- **Service endpoints** identify allowed subnets to a supported public service endpoint. **IP firewalls** restrict callers by address; neither changes the endpoint into a private IP.
- **Network restrictions** control reachability; **RBAC** controls allowed operations. A private cloud endpoint still processes data in Azure. For local-only processing, choose a supported on-premises container and assess all data flows.
Containers, diagnostics and reliability
- **AI containers** package supported inference services for a Docker host or orchestrator. Typical startup settings include **Eula=accept**, **Billing** with the resource endpoint, and **ApiKey** for billing authorization.
- **Connected containers** normally require billing connectivity even when inference stays local. Fully disconnected operation requires an explicitly supported arrangement; intermittent internet access is not an offline license.
- **Model/input mounts** supply required model packages; output mounts retain configured logs. Inject secrets at runtime through protected settings. Use **Azure Container Registry** and registry roles to control image distribution.
- **Diagnostic settings** route resource logs and metrics to Log Analytics, Storage or Event Hubs. **Activity Log** records resource management changes; **Application Insights** traces application requests, failures and dependencies.
- **429 throttling** calls for bounded retries, backoff and capacity analysis. Monitor latency, error rates, usage and saturation; increasing application concurrency without extra service capacity can worsen throttling.
Responsible AI and human oversight
- **Fairness** examines unequal performance across groups. **Inclusiveness** supports varied abilities, languages and access needs. Test representative inputs and offer accessible alternatives such as captions, alt text and speech.
- **Reliability and safety** require validation, failure handling and ongoing monitoring. **Privacy and security** protect consent, sensitive data, retention and access. **Transparency** explains AI use, capabilities and limitations.
- **Accountability** assigns responsibility and review paths. Use human approval for consequential decisions and uncertain extraction results; model confidence does not establish that a decision is appropriate.
- **Data minimization** limits what is collected, logged and retained. Configure supported logging opt-out controls for sensitive inputs and separately manage application logs, diagnostic destinations and stored outputs.
Anomaly detection concepts
- **Univariate detection** examines one time series, such as temperature. **Multivariate detection** models relationships among correlated signals, such as temperature, pressure and rotation speed.
- **Batch detection** evaluates a supplied historical window. **Streaming detection** evaluates arriving points against history. A **change point** describes a shift in the series rather than an isolated spike.
- **Time-series preparation** aligns timestamps, handles missing values and preserves appropriate sampling intervals. Validate alerts against operational events; an anomaly score alone does not identify a physical cause.
- In legacy service scenarios, **Anomaly Detector** supplies anomaly inference and **Metrics Advisor** adds metric diagnostics and incident workflows. Separate the detection model, alert routing and human investigation.
Build generative AI and safety solutions
Models, deployments and capacity
- **Chat models** generate text from messages. **Embedding models** turn text into numeric vectors for similarity and retrieval. **Image-generation models** create images from prompts; choose by task rather than model family popularity.
- **Deployment name** identifies the model endpoint used by an application in deployment-based Azure OpenAI APIs. Configure the resource endpoint, deployment and authentication; a model catalog name is not automatically the deployment name.
- **System**, **user** and **assistant** messages supply instructions, requests and conversation examples. Maintain relevant conversation history within the model context budget.
- **Tokens** determine context use and much of inference cost. Input, conversation history, retrieved passages and output share the applicable budget; an output-token limit can truncate a response.
- **Capacity and quota** depend on the model and deployment type. Evaluate both requests per minute and tokens per minute, expected response length and bursts; do not assume one universal RPM-to-TPM conversion.
Prompting and generation controls
- **Priming** sets task, audience, tone and constraints in instructions. **Few-shot examples** demonstrate desired request/response behavior. Specify an output structure and validate generated fields before using them.
- **Temperature** adjusts sampling randomness. Lower values generally reduce variation; higher values encourage variety. A low temperature does not guarantee factual accuracy or identical responses.
- **Top P** limits sampling to a cumulative probability mass. Tune temperature or Top P deliberately and evaluate results; changing both together makes behavior harder to diagnose. Support varies by model.
- **Frequency penalty** discourages repeatedly used tokens; **presence penalty** discourages reusing tokens that have appeared at all. These controls influence repetition and topic variety, not factual grounding.
- **Evaluation** uses representative prompts to compare correctness, groundedness, safety, latency and cost. Clear instructions and examples often improve a prototype before fine-tuning is justified.
Grounding, embeddings and fine-tuning
- **Retrieval-augmented generation (RAG)** retrieves relevant company content and supplies it as context. Use it for changing facts and private knowledge; keep retrieved content within the caller's access permissions.
- **Embeddings** map semantically related text to nearby vectors. Embed documents and queries with compatible settings, then compare with a supported metric such as **cosine similarity**. Vector similarity is not a truth score.
- **Chunking** splits long documents into coherent passages. Preserve source identity and useful metadata; retrieve focused evidence rather than filling the prompt with unrelated documents.
- **Fine-tuning** adapts supported models to demonstrated behavior, style or task patterns. It does not replace retrieval for frequently changing facts. Use curated training examples and a separate validation set.
- **JSONL** stores one training example per line. Follow the target model's required schema, such as chat messages or legacy prompt/completion pairs; validate and deduplicate data before starting a training job.
Moderation and prompt attack protection
- **Azure AI Content Safety** assesses text and images for **hate**, **sexual**, **violence** and **self-harm** content. Inspect category severity and apply application-specific blocking or review thresholds to inputs and outputs.
- **Severity** is not a percentage probability. Text APIs can expose a full 0-7 scale or a trimmed scale; image category outputs use 0, 2, 4 and 6. Zero indicates no detected harm in that category, not universal safety.
- **Blocklists** capture organization-specific offensive terms. Combine term matching with contextual classifiers; spelling variants, quotation and legitimate use can change moderation outcomes.
- **Prompt Shields**, including jailbreak risk detection, target attempts to override instructions. **Protected material detection** addresses matching protected content. These checks solve different problems from harmful-language classification.
- **Content filters** enforce moderation around a model deployment; temperature and penalties are not safety filters. Test sample content in moderation tools, then monitor false positives and missed harmful cases in production.
Analyze images, faces and video
Image analysis and accessible output
- **Image Analysis** supplies pretrained visual features. **Tags** are descriptive labels; **captions/descriptions** form readable sentences for alt text; **object detection** supplies labels and bounding boxes.
- **Brands** identify supported logos. **Image type** features distinguish clipart or line drawings where supported. Request the actual features needed rather than interpreting every returned value as a custom class.
- **Bounding boxes** describe a location and dimensions in the image coordinate system. Preserve the image size and coordinate convention when drawing overlays or evaluating detected regions.
- **Smart cropping** uses a region of interest to retain salient content in a thumbnail. It serves a different purpose from resizing without content awareness.
- **Language support** differs by feature and API. Request a supported language for tags or descriptions and validate localized alt text; use moderation services to assess inappropriate content separately.
OCR and asynchronous read operations
- **OCR/Read** extracts printed or handwritten text. Prefer document-oriented extraction when the task also requires tables, layout or named business fields; a caption is not a transcription.
- **Asynchronous analysis** returns an operation reference before processing finishes. Poll with a delay until **succeeded** or **failed**; do not treat **not started** or **running** as a final result.
- **Results** can include pages, lines, words, locations and confidence. Keep reading order and page references when indexing text; handle empty results, unsupported content and failed operations.
- **URL input** requires the service to retrieve the file. **Binary/stream input** sends the file directly. Sending binary avoids first staging a file in Blob Storage, but cloud inference still sends the content to Azure.
Custom Vision training and deployment
- **Classification** labels an entire image. **Multiclass** assigns one mutually exclusive label; **multilabel** permits several. **Object detection** locates and can count individual objects using bounding-box labels.
- **Training workflow:** create a project, select the task/domain, upload representative images, label classes or regions, train an iteration, evaluate, then publish to a prediction resource.
- **Precision = TP / (TP + FP)** measures how often positive predictions are correct. **Recall = TP / (TP + FN)** measures how many actual positives are found. Thresholds trade false positives against missed detections.
- **Average precision** summarizes detection quality across confidence thresholds. Object detection also depends on localization quality. Evaluate on held-out images and realistic lighting, angles and backgrounds.
- **New labels or products** require reviewed labeled examples, retraining, evaluation and publishing. **Smart Labeler** suggests labels; a reviewer must validate them before they become reliable training data.
- **Compact domains** enable supported model exports for device inference. Choose a compatible target such as Core ML, TensorFlow or ONNX. Move/copy projects between environments and publish the intended iteration; cloud publication alone does not create an offline model.
Face detection, recognition and liveness
- **Detect** locates faces. **Verify** compares identity one-to-one; **Identify** searches enrolled identities one-to-many. **Find Similar** ranks faces, with identity-oriented matching distinct from appearance similarity.
- **Person groups** associate people with persisted face examples. In group-based workflows, create people, add their face images, train the group and check training status before identification.
- **Face lists** store persisted face references for similarity search; large collections use supported large-scale structures. Temporary detected face IDs and persisted enrollment IDs have different lifetimes.
- **Detection models** affect detection quality; recognition models affect identity matching. Evaluate difficult inputs such as blur and profile views, and use compatible recognition settings across enrollment and queries.
- **Liveness detection** assesses whether capture presents a real person or a spoof. Face rectangles, head movement and pupil distances alone do not establish liveness, attention or intent. Biometric features require appropriate access and consent.
Video Indexer and spatial analysis
- **Azure AI Video Indexer** extracts timestamped insights such as transcripts, visual text, topics, entities and people where enabled. Retrieve the insights JSON to connect a search result to the relevant video segment.
- **Video ingestion** can use supported uploads or a service-accessible download URL. A sharing page is not necessarily a direct media URL; choose an ingestion path appropriate to file size and access restrictions.
- **Custom language models** improve domain vocabulary in transcription. **Custom person models** associate enrolled names and faces. **Custom brands** and exclusions refine brand insights where supported.
- **Player widgets** present video and captions; **insights widgets** expose searchable extracted information. Configure the caption locale and keep timestamps aligned when embedding both.
- **Spatial Analysis** measures people in physical spaces, such as occupancy or movement across zones. Use speech recognition for spoken questions; translate transcripts when multilingual text output is required.
Understand language and process speech
Text analysis and custom language tasks
- **Language detection** identifies the language of input text. **Sentiment analysis** returns sentiment labels and confidence for documents or sentences; **opinion mining** links assessments to specific targets.
- **Key phrase extraction** summarizes salient phrases for topic summaries or word clouds. It does not return every non-stopword and should not be treated as a deterministic list of nouns.
- **Named Entity Recognition (NER)** finds typed spans such as people, locations and organizations. **Entity linking** disambiguates mentions against a knowledge base; recognition and linking are distinct operations.
- **PII detection** identifies sensitive spans such as credit card numbers and can return redacted text. **Custom NER** learns business-specific spans such as internal product codenames; custom classification labels whole documents.
- **loggingOptOut** controls supported service input logging. It does not erase copies held by your application. Inspect per-document errors and confidence rather than assuming one successful batch means every item succeeded.
Intents, utterances and entity components
- **Intent** is the action a user wants, such as FindContact. An **utterance** is an example request; an **entity** captures a parameter such as city, address or date. Different locations do not require different intents.
- **Learned entities** capture variable text using context and labeled examples. **List components** match a closed vocabulary of canonical values and synonyms. **Regex components** match predictable textual patterns.
- **Prebuilt components** recognize common values such as dates or numbers with less custom labeling. Use learned context when the same prebuilt type appears in several roles within an utterance.
- **CLU entities** can combine learned, list, prebuilt and regex components. Configure overlap and required-component behavior deliberately; a list synonym can return a normalized key.
- In legacy **LUIS**, **phrase lists** are model features, and **Pattern.any** marks a variable span inside a pattern. Example utterances teach intents; entities extract data. These concepts should not be substituted for one another.
Train, evaluate and deploy language models
- **Model lifecycle:** define intents and entities, add varied labeled utterances, split training and test data, train, review performance and deploy the selected model. Authoring clients and prediction clients serve different purposes.
- **None/out-of-scope examples** teach the model to reject unsupported requests. Balance examples across intents and include confusing near-matches rather than simply adding more positive examples to one intent.
- **Precision, recall and F1** reveal different error patterns. Review entity spans, confusion between intents and held-out evaluation results in Model performance or authoring APIs before deployment.
- **Active learning** uses uncertain real requests for human labeling and model improvement. Legacy LUIS query logging supports this review; accepting suggestions still requires training and publishing to update production.
- **Export/import** moves project definitions between resources. In legacy LUIS, an active authoring version is distinct from a published slot or container package. Validate runtime endpoints and permissions after migration.
Text and document translation
- **Translator text translation** accepts text and a required target language. Omit the source language when supported automatic detection is appropriate; specify it when known and useful.
- **to** selects the target language; **textType=html** preserves HTML structure during text translation. **toScript=Latn** requests Latin-script transliteration where supported; script conversion and language translation differ.
- **Key-based requests** use a subscription key and, when required, the subscription region plus the correct content type. A region value is not a replacement for the resource credential.
- **Geographic endpoints** constrain supported processing geography. Choose the approved geography and resource setup for sovereignty requirements; a global endpoint is not an automatic regional guarantee.
- **Document Translation** preserves supported Word, PowerPoint and other document formatting. Provide source and target storage access, optional glossary settings, start the translation job and poll its status.
Speech recognition and translation
- **SpeechRecognizer** converts speech to text. **TranslationRecognizer** combines recognition and translation. Configure the source locale, such as en-GB, and add supported target languages such as fr, de or es.
- **Continuous recognition** processes ongoing audio using result events; single-utterance recognition handles one bounded utterance. Capture final recognized text separately from translated text for a source-language transcript.
- **AudioConfig** selects microphone, file or stream input. Match the declared stream format to the bytes; compressed MP3 streaming requires supported decoding dependencies rather than pretending it is raw PCM.
- **Phrase lists** bias recognition toward domain terms. **Custom Speech** uses relevant text and/or labeled audio to improve supported models. Training audio and transcript formats must match the selected dataset requirements.
- **Authentication** uses supported resource credentials or tokens. Entra-based Speech scenarios require the appropriate role and endpoint configuration, including a custom subdomain where required; network isolation does not itself authenticate a caller.
Neural speech and accessible reading
- **SpeechSynthesizer** converts text or SSML into audio. Select a supported neural voice and locale; the **voices/list** operation enumerates available voices for the endpoint.
- **SSML** controls delivery: **voice** selects a voice, **prosody** adjusts rate/pitch/volume, **break** adds pauses, and **mstts:express-as** selects supported speaking styles or roles.
- **Style**, **role** and **effect** solve different needs. Style changes emotional delivery; role can simulate a supported age/gender persona; voice effects can optimize supported playback scenarios such as vehicle audio.
- **Custom Neural Voice** requires appropriate access, voice-talent consent and curated recordings with transcripts. The talent consent recording is distinct from the training audio corpus.
- **Immersive Reader** supports accessible reading with features such as read-aloud, focus, language support and a picture dictionary. Use it when the goal is improved comprehension rather than extracting document fields.
Extract and validate document information
Select a Document Intelligence model
- **Document Intelligence**, formerly Form Recognizer, extracts text, layout and structured information. **Read** focuses on OCR; **Layout** adds structure such as tables and selection marks.
- **Prebuilt receipt** extracts merchant, transaction and total fields. **Prebuilt invoice** extracts invoice details, addresses, amounts and line items. Prefer a suitable prebuilt model when it meets the required schema.
- **Custom template models** suit consistent visual layouts. **Custom neural models** handle greater layout variation for a common field schema, such as differently formatted surveys or contracts.
- **Custom classification** identifies a document type; **custom extraction** returns its fields. Compose compatible extraction models when an application needs to route among several trained form formats.
- **Format and feature support** depend on model and API. Analyze PDF/image inputs with the relevant model; handwriting, barcodes and office documents require explicit support or enabled features. Do not assume an older business-card model reads QR codes.
Build and improve custom extraction
- **Training workflow:** place representative samples in Blob Storage, connect the project with authorized access, label required fields/tables, train, evaluate on separate examples and record the model ID.
- **Training data** must represent layout variation, scan quality and the real field values. Blob containers and sample labels supply the dataset; an Azure Files share is not interchangeable with a configured Blob training source.
- **Schema consistency** keeps labels meaningful across samples. Include examples of optional fields, repeated rows and multi-page documents; distinguish missing values from incorrectly extracted values.
- **New formats** call for representative examples and retraining or an additional suitable model. Lowering an application confidence threshold does not teach the extractor a new layout.
Analyze results and route exceptions
- **Analysis clients** submit documents using a model ID and bytes or a reachable URI. The operation is asynchronous: wait or poll to a terminal status, then inspect the structured result.
- **Fields** include typed values and may include confidence and bounding regions. Tables contain rows, columns and cells; handwriting information can appear in style metadata. Keep original page context for review.
- **Field confidence** helps route uncertainty. Set business-specific review thresholds for critical fields, such as merchant or total; a high score on one field does not validate every field or the entire document.
- **Human review** handles low confidence, inconsistent totals and missing required values before writing to a database. Separate document extraction from consequential judgments such as treatment or dosage decisions.
Implement search and knowledge mining
Indexes, data sources and indexers
- **Index** defines the searchable schema and stores documents. **Data source** defines a supported store and its access settings. **Indexer** pulls data into the index on demand or on a schedule.
- **Push indexing** sends documents from application code and supports custom data acquisition. When an on-premises source lacks a suitable indexer, export or synchronize data, or push it through an application pipeline.
- **Blob indexers** extract supported file content and metadata. Scanned pages need OCR enrichment; text embedded in a file and text visible only in pixels are different ingestion cases.
- **Parallel ingestion** partitions large input sets into nonoverlapping containers or virtual folders with corresponding data sources/indexers. Provide enough service capacity and avoid overlapping writes to accelerate indexing.
Field attributes and query experience
- **Key** uniquely identifies a document. **Searchable** enables full-text matching; **retrievable** includes a field in results. **Filterable** permits predicates; **facetable** supplies facet counts; **sortable** supports ordering.
- **Analyzers** tokenize and normalize searchable text, including language-specific behavior. An analyzer does not choose which fields are returned; use retrievable settings and result field selection for that.
- **Facets** summarize categories for navigation. A category used for full-text search, result display and drill-down needs the corresponding searchable, retrievable, facetable and filterable capabilities.
- **Suggesters** identify fields for typeahead. **Autocomplete** completes query text; **suggestions** return matching documents. Call the appropriate endpoint with the suggester name and query text.
- **Synonym maps** relate equivalent terms and attach to supported searchable fields. They expand term matching; **semantic ranking** reranks candidates and **vector search** matches embeddings for different retrieval needs.
Skillsets and enrichment mappings
- **AI enrichment pipeline:** document cracking extracts content; a **skillset** adds derived values; mappings write values into the index. Attach an appropriate billable AI resource for substantial built-in enrichment workloads.
- **OCR skills** extract text from normalized images. **Merge** combines relevant text streams; language detection, translation, key phrases and sentiment enrich the resulting text.
- **EntityRecognitionSkill** extracts categories such as locations, people and organizations. **EntityLinkingSkill** links mentions to known entities. An embedding skill creates vectors rather than geographic labels.
- **Custom Web API skills** call an HTTPS service, such as a Function wrapping Document Intelligence. Requests and responses use a **values** array with **recordId** and data; return per-record errors or warnings appropriately.
- **Skill context and input paths** select nodes in the enrichment tree. **Field mappings** map source data to index fields; **outputFieldMappings** map enriched outputs. Skill outputs do not appear in an index automatically.
Knowledge-store projections
- **Knowledge store** persists enriched results in Azure Storage independently of the search index. Its skillset definition supplies storage access and projection groups.
- **Table projections** produce rows and columns for analysis or reporting. Table definitions include **tableName**, **generatedKeyName** and **source**, which points to the relevant enrichment node.
- **Object projections** save JSON representations in Blob Storage. **File projections** persist normalized image binaries; they do not store arbitrary PDF text as a searchable document.
- **Shaper skills** organize enriched nodes into projection-friendly structures. Choose the shape for downstream analysis; an index optimized for search and a knowledge store optimized for analytics need not have the same schema.
Search authorization and capacity
- **Admin keys** permit management and write operations; **query keys** provide read query access. Rotate a compromised query key by creating a replacement, updating callers and deleting the exposed key.
- **Query keys** do not limit callers to particular query expressions or document groups. Enforce application policy in a trusted backend and use supported identity-based data roles for access control.
- **Security trimming** stores allowed user/group identifiers in filterable fields. The backend obtains trusted caller memberships and adds the mandatory filter to every request; do not trust a client-supplied permission list.
- **Replicas** primarily add query throughput and availability. **Partitions** primarily add storage and indexing capacity. **Search units** reflect replicas multiplied by partitions; diagnose throttling before scaling.
- **Customer-managed keys** use Key Vault and a service identity for supported encryption at rest. They do not resolve throttling or authorize queries. Maintain key access and evaluate encryption overhead separately.
Design question answering and conversational bots
Knowledge-based question answering
- **Custom question answering** returns answers from curated content. Create a project, add supported URLs/files or Q&A pairs, review extraction, test and deploy. Legacy **QnA Maker** uses knowledge-base terminology.
- **Alternative questions** map different phrasings to one answer. **Follow-up prompts** guide multi-turn navigation. **Chit-chat** supplies conversational tone; it does not teach missing product facts.
- **Active-learning suggestions** require human acceptance or rejection. Save/train and deploy or publish accepted changes before expecting production responses to improve.
- **Score thresholds** route weak matches to a default answer, clarifying question or escalation. **Metadata filters** restrict candidate answers; ranker choices and score thresholds serve different purposes.
- **Connection settings** identify the runtime endpoint, project/knowledge base and credential. Legacy QnA Maker separates authoring from its hosted answer endpoint and uses Search plus application hosting resources.
Bot hosting, channels and testing
- **Bot application code** handles activities at a messaging endpoint, commonly **/api/messages**. An **Azure Bot resource** registers channel connectivity; the application still needs a host such as App Service.
- **Identity configuration** must match the bot registration, tenant/application type and supported credentials. An app registration and client secret are part of legacy secret-based deployment; protect and rotate the secret.
- **Bot Framework Emulator** tests a running local or remote bot interactively. **ngrok** or a suitable tunnel exposes a local endpoint when external services must reach it; Composer is an authoring tool.
- **Channels** connect clients such as Teams or Direct Line. In legacy voice-bot workflows, **Direct Line Speech** combines Speech with bot messaging and requires compatible speech settings and WebSockets.
- **Activity handlers** respond to messages, conversation updates and member additions. Add welcome logic for newly joined users without welcoming the bot itself, and verify the configured credentials during authentication tests.
Dialogs, prompts and interruptions
- **Prompts** request input, validate it and retry when invalid. **Waterfall dialogs** collect values in a sequence. **Component dialogs** package reusable dialog flows; **adaptive dialogs** use triggers and conditions.
- **Dialog triggers** respond to recognized intents or events. Handle help and cancellation while a transaction is in progress; clear the relevant dialog stack when cancellation is confirmed.
- **Validation** checks dates, required fields and choices before an external action. Confirm consequential operations with the user and retain enough state to explain or recover from failures.
- **Inactivity reset** uses recorded activity time and application logic to clear conversation/dialog state after the chosen interval. Do not assume all storage providers automatically expire a conversation.
- **Skills and routing** delegate specialized tasks to other bots or language models. Legacy **Dispatch/Orchestrator** chooses a handler from the user request; routing is separate from translation or sentiment analysis.
State scopes and persistence
- **User state** stores information associated with the user; **conversation state** stores information for a conversation. Use **property accessors** to get and update typed state values.
- **Dialog scope** follows the active dialog and ends with it. **Turn scope** lasts for one activity-processing turn. Choose the narrowest lifetime that fits the data.
- **SaveChangesAsync** persists state updates at the end of a turn in SDK workflows. Updating an in-memory object without saving does not guarantee it survives the next request.
- **MemoryStorage** is volatile and unsuitable for durable state across restarts or multiple instances. Use a supported shared store, control concurrent updates and limit retention of personal information.
Cards, language generation and localization
- **Hero cards** emphasize a large image; **thumbnail cards** use a smaller image and text. **Adaptive Cards** combine structured text, images, actions and inputs; channel support determines rendering behavior.
- **Carousels** present several options with images when supported. Supply useful alt text and localized labels, and make warnings such as low stock visible through conditional presentation.
- **Language generation (.lg)** templates build dynamic responses with expressions and parameters. **coalesce()** selects the first available value for a fallback; generation templates do not replace recognition models.
- **LUDown (.lu)** describes language-understanding content. Localization must cover utterances, entity synonyms, prompts, cards and speech settings. Translating an authoring file still requires evaluation and deployment of the target-language model.