MSBA-242 · Lesson 12 of 12 · 27 min

Case study: taking an agent from pilot to production

▶ Video coming soon A video version of this lesson is on the way.

To finish the course, Bram set Yusra, Rasmus and Hamish an exercise drawn from outside Quillfield, so that nobody could rely on what they already knew. Ellsmere Veterinary Group runs six small-animal clinics around Spokane, with about 140 staff. Wren Aldous, a veterinary technician with a knack for tools, built an agent over the summer of 2026 to answer staff questions about clinic procedures and to check appointment availability. Staff loved it. Ilse Marchbanks, Ellsmere's operations manager, now wants it rolled out to all six clinics and run properly. Siddharth Bhattacharjee, the IT contractor who looks after Ellsmere's Microsoft 365 tenant, has been asked to make that happen. Every decision in this lesson draws on an earlier one. Work through each step yourself before reading the answer.

The starting point

Siddharth's first look at the pilot found the following.

AreaWhat the pilot does today
EnvironmentBuilt in the default environment; no solution
KnowledgeA SharePoint site of clinic procedures (about 300 documents), including an old archive folder; two public veterinary reference websites
ToolsAppointment availability from PawTrack, Ellsmere's fictional practice management system, through a custom connector using Wren's own account; a flow that emails the front desk to request a callback
ChannelTeams for Wren's clinic; also embedded on an internal web page with no authentication
SharingShared with 31 people individually
TestingWren's own checks in the test pane; no test sets
CostUnknown; billed against the tenant's pay-as-you-go plan
OwnersWren only

Ilse's brief added three requirements: the agent must never show client contact details to anyone not allowed to see them, it must not give dosage or treatment advice beyond what the written procedures say, and Ellsmere needs to know what it will cost before rollout.

Step 1: get it into a governed place

Worked problem

Environments and a solution

The pilot lives in the default environment with no solution. What should Siddharth set up first, and how should the agent be moved?

Show solution
  1. Create development and test sandbox environments and a production environment, each secured with a Microsoft Entra security group, and make them Managed Environments.
  2. Create a solution with an Ellsmere publisher and prefix (for example "ell"), set it as the preferred solution, and add the existing agent and its components.
  3. Check the solution for missing dependencies: the PawTrack custom connector, the callback flow, connection references and any values hard-coded in the flow.
  4. Replace hard-coded values, such as the front desk mailbox and the PawTrack URL, with environment variables.
  5. Leave the default-environment pilot running, unchanged, until production is live, then retire it with the checklist from Lesson 10.

Answer: Three governed environments, one solution with environment variables and connection references, and the pilot left alone until its replacement is ready. Rebuilding inside a solution from the start would have been cleaner, but adding the existing agent and auditing its dependencies is quicker and works.

Step 2: fix the access model

Worked problem

Authentication, credentials and sharing

Identify every access problem in the pilot and decide the production design for each.

Show solution
  1. Unauthenticated web page: block unauthenticated chat in the production data policy and use Authenticate with Microsoft; staff are all in Ellsmere's tenant.
  2. PawTrack connector using Wren's account: switch to end-user credentials if PawTrack supports them, so each staff member sees only what PawTrack allows them to see; otherwise use a dedicated read-only service identity limited to availability data.
  3. Client contact details: return a lean availability response with no client names or contact details, so the agent never receives them.
  4. Sharing with 31 individuals: share with a security group per clinic instead, and set sharing limits so editors are individuals and viewers are groups.
  5. Owners: name Ilse as business owner and Siddharth as technical owner, with Wren as a second maker, and record them in the agent inventory.

Answer: Authenticated access only, end-user or narrowly scoped credentials, lean responses that exclude client contact details, group-based sharing, and named owners. The client-details requirement is met by design, not by instruction: the agent cannot reveal what it never receives.

The knowledge sources needed attention too. The SharePoint site's archive folder held procedure versions up to six years old, and one folder of client correspondence had been saved there by mistake. Siddharth moved both out of the knowledge source and fixed the folder's permissions. The two public reference websites were reviewed by Ellsmere's medical director, who kept one and removed the other because its dosage guidance differed from Ellsmere's protocols. The remaining site was allowed by endpoint filtering in the data policy; every other public website was denied.

Step 3: build the test sets

Worked problem

Test sets and methods

Design Ellsmere's test sets and the methods for each, using Lessons 2 and 3.

Show solution
  1. Core set (about 40 cases): procedure questions written by clinic staff in their own words, plus availability lookups. Methods: tool use for availability questions; general quality; compare meaning for questions with a clear correct answer.
  2. Boundaries set (about 25 cases): dosage, diagnosis and treatment questions the agent must not answer beyond written procedures, requests for client contact details, and some safe look-alike questions. Methods: a custom grader for "stays within written procedures and refers to a veterinarian"; keyword match for the referral wording.
  3. Permissions set (about 15 cases): run as test accounts for a receptionist, a technician and a veterinarian. Methods: tool use and compare meaning.
  4. Real questions set: imported from the pilot's transcripts after removing any client details. Methods: general quality and content safety.
  5. Calibrate the custom grader against 20 responses labeled by the medical director before trusting it.

Answer: Four sets with methods matched to purpose, and a calibrated custom grader for the clinical boundary. The medical director owns the boundaries set's expected results, because only a veterinarian can say where "following the procedure" ends and "advice" begins.

The first evaluation run in development was sobering. The core set scored 76 on general quality, and the boundaries set failed four cases: the agent answered two dosage questions by combining a procedure document with general knowledge. Reading the activity maps showed that general knowledge was enabled and the instructions did not forbid it. Wren turned general knowledge off for clinical topics, added an instruction to answer clinical questions only from the procedures and otherwise refer to a veterinarian, and rewrote six procedure titles that were ambiguous. The next run scored 89 on the core set and passed every boundaries case.

Step 4: set release thresholds

Ilse and the medical director agreed thresholds with Siddharth, following the pattern from Lesson 3: the core set must pass tool use on at least 38 of 40 cases and stay within three points of the last release on general quality; the boundaries set must pass the custom grader on every case; content safety must pass on every case. Any case that changed from pass to fail since the last release must be read by a person before approval.

Step 5: the pipeline and release process

Worked problem

From development to production

Design Ellsmere's deployment route and approval, for an organization with one IT contractor and no developers.

Show solution
  1. Configure a Power Platform pipeline with a pipelines host and two stages, test and production.
  2. Make the production stage a delegated deployment running as a service principal, with approval by Ilse for the business and Siddharth for the platform.
  3. Require a deployment note, the exported test-stage evaluation results and the rollback version in each approval request.
  4. Enable redeployment of previous versions now, before it is needed.
  5. Write the post-deployment checklist: publish, check Teams in two clinics, check sharing groups, run five smoke-test questions as a receptionist test account, confirm analytics records the session.

Answer: Pipelines suit Ellsmere better than scripted tools: low setup, no build scripts, approvals and history built in. One person can run it, and the approvals keep the business in control.

Step 6: estimate and control cost

Worked problem

A cost estimate

The pilot handled about 600 conversations a month at one clinic. Ilse expects about 3,600 a month across six clinics. On average each conversation makes one agent action and one generative answer, and about 300 conversations a month start the callback flow of 8 actions. Estimate monthly credits using the rates in Lesson 8, ignoring any Microsoft 365 Copilot inclusions.

Show solution
  1. Agent actions: 3,600 × 1 × 5 = 18,000 credits.
  2. Generative answers: 3,600 × 1 × 2 = 7,200 credits.
  3. Flow actions: 300 × 8 = 2,400 actions; 2,400 ÷ 100 × 13 = 312 credits.
  4. Total: 18,000 + 7,200 + 312 = 25,512 credits a month.
  5. Compare with capacity: about one capacity pack of 25,000 credits a month, so buy one pack and keep pay-as-you-go as overflow.

Answer: Roughly 25,500 credits a month, about one capacity pack at 200 US dollars a month plus a small overflow. Siddharth set an agent limit of about 30,000 credits with notifications at 80 and 100 percent and no hard stop, and allocated the pack to the production environment.

Hamish pointed out that the estimate rested on two assumptions worth watching: that usage would scale linearly from one clinic to six, and that each conversation made only one agent action. The first month's report would test both. If actions per conversation rose, the first place to look was the availability tool's description.

Step 7: plan monitoring and review

Before go-live, Siddharth set out what would be watched and by whom. Ilse and the clinic managers got the Analytics Viewer role; the Bot Transcript Viewer role went only to Siddharth and the medical director, for quality review of clinical questions. A notice in the agent's greeting and on the staff intranet told staff that conversations were recorded to improve the service. The monthly agent review would cover outcomes, themes, the worst-performing themes with transcript findings, tool errors, reactions and cost per resolved conversation, and end with at most three actions.

A timeline from late September to late November 2026 with six milestones: environments and solution ready; access model fixed and knowledge cleaned; test sets built and first evaluation; thresholds met in test; production release to two clinics; rollout to all six clinics and first monthly review. The pilot in the default environment runs in parallel until the last milestone, then is retired.
Ellsmere's path from pilot to production (illustrative dates).

Step 8: release in stages

Rather than launch to all six clinics at once, Ilse chose a staged rollout: two clinics first, the remaining four two weeks later. The first two weeks found two problems no test had found. Receptionists asked about "drop-off appointments", a term PawTrack did not use, and the agent did not recognize it; and the callback flow's emails went to a shared mailbox that one clinic did not monitor. The first was fixed with a synonym in the tool description and a new core test case; the second with an environment variable per clinic for the callback mailbox. Both went out in the next weekly release before the remaining clinics joined.

Step 9: retire the pilot

When all six clinics were on the production agent, Siddharth retired the pilot using the Lesson 10 checklist: staff were told two weeks ahead; the Teams app and web page embed were removed; the agent was unshared; the callback flow was turned off; Wren's personal PawTrack connection was deleted; the pilot's transcripts were left to expire under Ellsmere's retention policy; and the pilot agent was deleted from the default environment and removed from the inventory. The web page with no authentication, the pilot's most serious risk, was gone.

What the case shows

Nothing in Ellsmere's pilot was badly built. Wren made something useful, quickly, and staff proved its value. What production added was not more features but deliberateness: an environment and solution so changes are controlled, an access model so the agent acts within each person's rights, test sets and thresholds so quality is measured rather than assumed, a pipeline with approvals so the business decides what goes live, policies so data cannot leak through capabilities nobody chose, a cost estimate and limits so the bill is understood, monitoring so problems surface, and a retirement plan so nothing is left behind. Those are the same steps Quillfield took with the Policy Service Assistant, and the same ones any organization needs, whatever its size.

LessonWhat it contributed to Ellsmere's production agent
1–3Test plan, four test sets, calibrated grader, release thresholds
4Analytics roles, transcript access, monthly review
5–6Three environments, solution, environment variables, pipeline with delegated approval
7Data policy: authentication required, endpoint filtering for one reference site
8Cost estimate, one capacity pack, agent limit with notifications
9End-user or narrow credentials, lean responses, group sharing, named owners
10–11Staged rollout, release notes, incident method, pilot retirement

Ilse's own summary to Ellsmere's clinic managers, a month after rollout, was shorter. The agent answered about 3,700 questions in its first full month, resolved about four in five, cost a little over one capacity pack, and had not once shown client details or given advice outside the written procedures. "It's the same agent Wren built," she wrote. "We just know what it does now."

Common mistakes

  • MistakeRolling a successful pilot straight out to everyone.

    InsteadMove it into governed environments and a solution, fix access, test and release in stages.

  • MistakeMeeting privacy requirements with instructions alone.

    InsteadRemove sensitive fields from responses so the agent never receives them.

  • MistakeLetting the maker decide clinical or legal boundaries.

    InsteadHave the accountable expert own the boundaries test set and its expected results.

  • MistakeEstimating cost from the pilot without checking assumptions.

    InsteadState the assumptions and test them against the first month's report.

  • MistakeLeaving the pilot running after production launches.

    InsteadRetire it with the checklist, especially any unauthenticated access.

Summary and key terms

  • A pilot reaches production by moving into governed environments and a solution, not by adding features.
  • Fix access first: authentication, credentials, lean responses, group sharing and named owners.
  • Build test sets by purpose, calibrate custom graders with experts and set thresholds by risk.
  • Use a pipeline with delegated approvals, a post-deployment checklist and a rollback plan.
  • Estimate cost, set limits, plan monitoring, release in stages and retire the pilot cleanly.
Pilot
An early version of an agent used by a small group to prove its value.
Staged rollout
Releasing to some users or sites first, then the rest after a review period.
Release threshold
An agreed evaluation result a change must meet before production.
Lean response
A tool output containing only the fields the agent needs.
Smoke test
A short set of checks run immediately after deployment to confirm basic function.
Agent inventory
The organization's record of agents, their owners and their status.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. How did Ellsmere guarantee the agent would not show client contact details?

    Show answer

    The availability tool returned a lean response without client details, so the agent never received them.

  2. Why did the medical director own the boundaries test set?

    Show answer

    Only a veterinarian can judge where following a procedure ends and clinical advice begins.

  3. What did the staged rollout find that testing had not?

    Show answer

    An unfamiliar term ("drop-off appointments") and a callback mailbox one clinic did not monitor.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz