Summary
Microsoft Copilot Studio lets you build sophisticated custom agents that surface inside Microsoft Teams, SharePoint, and Microsoft 365 Copilot — without writing a single line of server-side code. This step-by-step guide walks through creating a functional “IT Helpdesk Agent” from scratch: defining topics, configuring knowledge sources, adding connectors, and deploying to Teams for testing.
What We Are Building
Contoso IT Helpdesk Agent — an agent that:
- Answers common IT FAQ questions using the company knowledge base.
- Guides users through a structured troubleshooting flow for password resets.
- Raises a ServiceNow ticket via a Power Automate connector when the issue is unresolved.
- Hands off to a live agent (Teams escalation) for complex issues.
Step 1: Create the Agent
- Navigate to Copilot Studio.
- Select your environment from the top-right selector. Use a development/sandbox environment for initial build.
- Click + Create → New agent.
- Fill in the details:
- Name: Contoso IT Helpdesk
- Description: Helps Contoso employees resolve common IT issues and raise support tickets.
- Instructions (system prompt):
1
2
3
4
5
6
7
8
9
You are the Contoso IT Helpdesk assistant. Your role is to help employees resolve
common IT issues quickly and professionally.
- Always greet the user politely.
- For password issues, follow the Password Reset topic.
- For hardware issues, collect details and raise a ServiceNow ticket.
- If you cannot resolve the issue within 3 exchanges, offer live agent escalation.
- Keep responses concise. Use numbered steps for procedures.
- Do not speculate about security policies you are not certain about.
- Click Create.
Step 2: Configure Knowledge Sources
Knowledge sources ground the agent’s responses in your actual company content, reducing hallucination and keeping answers accurate.
Adding a SharePoint knowledge source
- In your agent, go to Knowledge in the left navigation.
- Click + Add knowledge → SharePoint.
- Enter the URL of your IT knowledge base site, e.g.
https://contoso.sharepoint.com/sites/ITKnowledge. - Select specific document libraries if you want to scope the crawl.
- Click Add.
Copilot Studio will crawl the site and make the content available for retrieval-augmented generation (RAG).
Adding a public website
For vendor documentation (e.g., Microsoft support articles):
- Click + Add knowledge → Public website.
- Enter
https://support.microsoft.com. - Toggle Allow Copilot to search this site to on.
Tip: Be selective with public websites. Broad domains can introduce noise. Prefer adding specific sub-paths such as
https://support.microsoft.com/en-us/windows.
Step 3: Create a Structured Topic (Password Reset)
Topics are conversation flows triggered by specific user intents.
- Go to Topics → + Add a topic → From blank.
- Name the topic Password Reset.
- Add trigger phrases:
1
2
3
4
5
- I forgot my password
- My password has expired
- How do I reset my password
- Account locked out
- Can't sign in
- Build the conversation flow using the visual canvas:
Node 1 – Question:
Are you locked out, or are you resetting because your password expired?
- Locked out → branch to
LockedOut- Expired/forgotten → branch to
SelfServiceReset
Branch: SelfServiceReset → Message:
You can reset your own password using the self-service portal:
- Go to aka.ms/sspr
- Enter your work email address
- Choose your verification method (authenticator app or email)
- Follow the steps to set a new password
Did this resolve your issue?
- Yes → End conversation with success message
- No → Escalate to live agent
Branch: LockedOut → Action (call Power Automate flow):
- Trigger
UnlockAccountflow with the user’s UPN (available fromSystem.User.PrincipalName) - Show confirmation: “Your account has been sent for unlock. This typically takes 2–5 minutes.”
Step 4: Add a Connector Action (ServiceNow Ticket)
- Go to Actions → + Add an action → Connector.
- Search for ServiceNow and select Create Incident.
- Configure the connection with your ServiceNow instance credentials.
- Map the action inputs:
| Input | Source |
|---|---|
| Short description | {Topic.IssueDescription} variable |
| Category | hardware (hardcoded) |
| Urgency | {Topic.Urgency} variable from earlier question node |
| Caller ID | {System.User.PrincipalName} |
- Add the action to your Hardware Issue topic at the point where you want to raise the ticket.
Step 5: Configure Live Agent Escalation
- In Topics, open the Escalate system topic (built-in).
- Enable Omnichannel for Microsoft Teams as the escalation channel.
- Configure the queue name to match your Teams channel (e.g.,
IT-Support-Queue). - In any topic where escalation is needed, add a Transfer conversation node and select the queue.
When a user triggers escalation, the conversation transcript is passed to the live agent so they have full context.
Step 6: Test in Teams
- In Copilot Studio, click Publish → Publish to confirm.
- Go to Channels → Microsoft Teams.
- Click Turn on Teams and then Open agent in Teams.
- Teams opens with the agent in a 1:1 chat.
Test the key scenarios:
- Ask an FAQ question (should answer from knowledge source with citation).
- Say “I forgot my password” (should enter the Password Reset topic).
- Say “My monitor is broken” (should collect details and raise a ServiceNow ticket).
Deploying Organisation-Wide
Once testing is complete:
- In Teams Admin Center, go to Teams apps → Manage apps.
- Find your Copilot Studio agent app and set Org-wide availability to enabled.
- Optionally, use an App setup policy to pin the agent to the Teams app bar for target user groups.
Conclusion
Copilot Studio enables any developer — or even a skilled power user — to build a fully functional AI agent deployed directly in Teams within hours. The combination of RAG-based knowledge sources, structured topics, connector actions, and live agent escalation covers the vast majority of real-world helpdesk and business automation scenarios. Start with a focused use case, test thoroughly, and iterate based on user feedback.
