az cognitiveservices account list --resource-group <resource-group>Chat completion
A AI platform capability in Azure OpenAI that helps teams build, secure, observe, and govern intelligent applications with clearer ownership, safety, and operational context.
Source: Microsoft Learn - Work with chat completion models Reviewed 2026-05-12
- Exam trap
- Sending uncontrolled conversation history until token cost and latency become unpredictable.
- Production check
- Confirm owner, scope, resource IDs, region, tags, and environment before accepting the current state.
Article details and learning context
- Aliases
- None listed
- Difficulty
- fundamentals
- CLI mappings
- 5
- Last verified
- 2026-05-12
Understand the concept
In plain English
Chat completion is a model interaction pattern where an application sends system, user, and prior assistant messages and receives the model response for a conversation turn. In everyday Azure work, it helps teams build copilots, support assistants, summarizers, and workflow helpers while keeping prompts, deployments, token usage, authentication, and safety controls observable. You usually see it around Azure OpenAI deployments, Microsoft Foundry projects, SDK calls, REST requests, prompt templates, Application Insights traces, content filtering logs, and token dashboards.
Why it matters
Chat completion matters because chat completions can leak sensitive prompts, exceed quota, generate unsafe answers, or hide latency and cost problems unless requests are governed and observed. The business impact is rarely abstract: users see slower systems, missing data, failed sign-ins, confusing reports, or unexpected cost when the setting is misunderstood. A solid glossary entry gives architects and operators the same language for design reviews, support handoffs, and audit evidence. It also helps teams decide what to check first, which metric or log proves the current state, who owns remediation, and when a change should be rolled back instead of patched live.
Official wording and source
A AI platform capability in Azure OpenAI that helps teams build, secure, observe, and govern intelligent applications with clearer ownership, safety, and operational context. Microsoft Learn places it in Work with chat completion models; operators confirm scope, configuration, dependencies, and production impact.
Technical context
Technically, Chat completion appears as an API call to a deployed chat-capable model using a deployment name, endpoint, authentication method, messages array, and generation parameters. Engineers verify it through deployment name, model version, endpoint, request ID, message roles, token counts, latency, content filter outcomes, rate-limit headers, and application traces. Important configuration includes system instructions, message history policy, temperature, max tokens, response format, tool or data extensions, identity, private networking, quota, and logging boundaries. It often interacts with Azure OpenAI in Microsoft Foundry, Azure AI Search, Managed Identity, private endpoints, App Configuration, Application Insights, content safety controls, and application SDKs.
Exam context
Compare with
Where it is used
Where you see it
- In the Azure portal, Chat completion appears near Foundry model deployments, where operators confirm scope, owner, diagnostics, access, and production state before release or incident response.
- In CLI, ARM, SDK, REST, or Bicep output, Chat completion appears as messages, deployments, tokens, and latency, giving teams repeatable release and audit evidence during deployments and incidents.
- In logs, metrics, tickets, or reviews, Chat completion appears beside prompt traffic, token usage, safety events, and errors, linking symptoms to security, reliability, cost, and performance decisions quickly.
Common situations
- Design or inspect an AI workload before exposing it to users.
- Connect model, search, storage, identity, and monitoring decisions into one operating picture.
- Evaluate safety, quota, latency, and cost tradeoffs before scaling traffic.
- Document which resource, deployment, or capability owns a production AI behavior.
Illustrative Azure scenarios
These examples show how the concept can affect design and operations. They are illustrative scenarios, not customer claims.
Scenario 01 Customer support copilot Scenario, objectives, solution, measured impact, and takeaway.
Northwind Telecom, a communications provider, needed a support copilot that answered billing questions using governed Azure OpenAI chat completions.
- Reduce average agent research time by 40 percent
- Keep prompts and customer data protected
- Track token usage by support workflow
- Escalate low-confidence answers to humans
Developers built a chat completion workflow against an approved Azure OpenAI deployment in Microsoft Foundry. The application sent system instructions, customer-safe context, and user questions while retrieving grounding data from Azure AI Search. Managed identity authenticated backend services, private endpoints restricted network access, and Application Insights captured request IDs, latency, token counts, and filter outcomes without storing full sensitive prompts. Content safety rules and human escalation were documented in the runbook. Product owners reviewed conversation samples and cost dashboards before expanding to all support queues. The runbook also captured dashboard links, owner contacts, rollback criteria, and monthly review steps so operators could verify the design without tribal knowledge during incidents or release windows. Evidence from each change was saved with the deployment record for audit, support, and future capacity planning.
- Agent research time fell by 46 percent
- No full customer prompts were stored in telemetry
- Token cost was visible by workflow and queue
- Human escalation handled 14 percent of uncertain answers
Chat completions create business value when prompts, grounding, telemetry, safety controls, and cost ownership are engineered together.
Scenario 02 Clinical document summarizer Scenario, objectives, solution, measured impact, and takeaway.
CareBridge Analytics, a healthcare software vendor, needed concise visit summaries for clinicians reviewing long patient documents.
- Generate summaries in under eight seconds
- Avoid sending unnecessary patient data
- Record model deployment and filter evidence
- Keep clinicians in final control
The engineering team used chat completions with a deployment approved for clinical-assistive summarization. The service assembled minimal document excerpts, system instructions about format and limits, and user context from the clinical workflow. Private networking and managed identity protected the model endpoint, while telemetry captured deployment name, request ID, latency, token count, and content filter result. The application showed summaries as drafts, required clinician review, and logged acceptance feedback. Prompt templates were versioned with release artifacts, and quota dashboards alerted before throughput limits could slow clinics. The rollout plan included before-and-after measurements, escalation contacts, exception rules, and a control review with finance, security, and application owners. That evidence made the improvement repeatable and gave support teams a clear baseline when later incidents raised similar symptoms.
- Median summary latency was 5.6 seconds
- Prompt payload size was reduced by 52 percent
- Every generated draft included deployment and request evidence
- Clinician acceptance reached 81 percent after tuning
Chat completion systems need human workflow design and minimized context as much as model access.
Scenario 03 Engineering runbook assistant Scenario, objectives, solution, measured impact, and takeaway.
MetroBank Digital, a banking technology group, needed a runbook assistant for on-call engineers handling Azure incidents.
- Find approved runbook steps faster
- Avoid exposing secrets in prompts
- Prove which deployment answered each question
- Control token spend during major incidents
Platform engineers implemented a chat completion assistant using an Azure OpenAI deployment connected to curated runbook content through Azure AI Search. The system message required citation of internal runbook sections and refused to reveal secrets or invent commands. Application Insights traced request IDs, deployment names, token counts, latency, and content filter outcomes, while prompt logging stored only redacted metadata. Private endpoints and managed identity protected access. During incident simulations, responders compared assistant answers against approved runbooks before trusting the workflow. A cost guard reduced context size when incident traffic spiked. Release evidence included configuration snapshots, CLI output, representative metrics, and ticket notes, giving operations a durable baseline for training, audits, and later optimization work. The team also defined when to scale back, rotate credentials, or open a vendor support case.
- On-call lookup time dropped by 58 percent
- No secret values appeared in stored telemetry
- Incident token spend stayed under the approved threshold
- Runbook drift was found and corrected during simulations
A chat completion assistant is reliable only when its deployment, retrieval source, prompt rules, telemetry, and cost controls are observable.
Azure CLI
Use CLI, REST, SDK, or scripted queries for Chat completion because AI incidents need exact deployment, quota, identity, prompt, and telemetry evidence without exposing sensitive message content unnecessarily and to avoid portal-only evidence during reviews.
Useful for
- List model deployments and quota before launching a new chat feature.
- Capture token usage, latency, and filter outcomes during a production investigation.
- Verify endpoint, private networking, and identity settings before switching deployments.
Before you run a command
- Confirm the active tenant, subscription, resource group, workspace, account, or region before running commands.
- Use least-privileged access and avoid storing secrets, prompts, certificates, tokens, or personal data in command output.
- Know whether the command is read-only, mutating, cost-impacting, security-impacting, or destructive before production use.
What the output tells you
- Output confirms whether the live Azure configuration exists at the expected scope and matches the approved design.
- Returned IDs, settings, metrics, timestamps, or logs help separate configuration drift from application behavior.
- Differences between expected and actual state create evidence for rollback, escalation, audit, or owner follow-up.
Mapped commands
Azure OpenAI operations
adjacentaz cognitiveservices account show --name <account-name> --resource-group <resource-group>az cognitiveservices account create --name <account-name> --resource-group <resource-group> --kind OpenAI --sku S0 --location <region>az cognitiveservices account deployment list --name <account-name> --resource-group <resource-group>az cognitiveservices account delete --name <account-name> --resource-group <resource-group>Architecture context
Chat completion sits in the application architecture as the runtime call from a product experience to a deployed conversational model. In Azure OpenAI designs, architects review the deployment name, model version, endpoint, authentication path, private networking, prompt construction, system instructions, content safety, token budget, quota, retry behavior, and telemetry before exposing it to users. It also needs data-boundary decisions: what conversation history is sent, what is logged, which retrieval sources are allowed, and how sensitive content is filtered or redacted. Azure DevOps pipelines should promote configuration separately from code where possible and capture deployment, model, and prompt-version evidence. Without that discipline, cost spikes, latency, unsafe responses, and debugging blind spots appear quickly.
- Security
- Security for Chat completion starts with understanding which identities, secrets, certificates, endpoints, data stores, or management-plane permissions it touches. Review who can view, change, or use it, and confirm that production access follows least privilege. Check whether private networking, firewall rules, RBAC, key vault storage, managed identity, audit logs, and data classification apply. Operators should avoid exposing tokens, connection strings, prompts, certificate material, or cost-sensitive business metadata in troubleshooting output. A secure design also documents emergency access, rotation responsibilities, and evidence retention so an incident response team can prove the current configuration without inventing access during an outage. Security reviewers should confirm least privilege, private access paths, and audit retention before approving production use.
- Cost
- Cost for Chat completion comes from the resources, transactions, data movement, retention, compute, capacity, tokens, or operational labor it influences. Some costs are direct meters, while others appear as extra storage, higher throughput, duplicate processing, export jobs, monitoring ingestion, or engineering time. Review budgets, cost allocation, tags, usage metrics, and SKU limits before scaling or enabling new behavior. The safest approach is to define the owner, expected usage pattern, and alert thresholds up front. That way finance conversations use evidence instead of opinions after the bill arrives. Finance and engineering teams should agree which metric proves usage and which scope owns remediation.
- Reliability
- Reliability for Chat completion depends on whether the design behaves predictably during scale events, regional incidents, expired credentials, throttling, schema changes, or downstream failures. Identify the dependency chain, expected failure mode, and recovery target before production use. Monitor the signals that show backlog, lag, retries, health state, capacity saturation, authentication failures, or stale data. Test restore, rotation, failover, replay, or rollback paths where they apply. Operators need a runbook that separates platform configuration problems from application defects and says which evidence is required before escalating to networking, identity, database, or product teams. Runbooks should state the first observable symptom, safe rollback path, and owner escalation route.
- Performance
- Performance for Chat completion is about how quickly and consistently the related workload can complete useful work. Measure the right signals: latency, throughput, backlog, request units, token volume, CPU, memory, bytes scanned, file counts, retries, or throttled operations depending on the service. Avoid tuning one setting in isolation when partitions, replicas, keys, network paths, identity calls, downstream services, or client behavior may be the real bottleneck. Performance reviews should compare expected workload shape with live metrics and include a safe test plan before increasing capacity or changing production configuration. Load tests should compare expected throughput, latency, queue depth, and saturation signals against live limits.
- Operations
- Operationally, Chat completion needs ownership, naming, tagging, change records, and repeatable verification. Teams should know where it appears in the portal, which commands or queries prove state, which dashboards show health, and which settings are safe to change during business hours. Keep examples, approvals, and rollback notes with the service runbook rather than in personal notes. For production changes, capture current configuration before and after the work, including resource IDs, region, owner, timestamp, and related deployment. Good operations turn the term into a checklist that first responders can follow under pressure. Operational evidence should include timestamps, resource IDs, owner names, and links to the approved change record.
Common mistakes
- Sending uncontrolled conversation history until token cost and latency become unpredictable.
- Logging full prompts with sensitive data instead of governed, minimized telemetry.
- Confusing the older chat completions API with newer Responses API capabilities.