Deploy the MaceyBot Teams bot powered by Claude API to replace Copilot Studio.
- Azure subscription with access to create resources
- Azure Functions Core Tools v4 (or VS Code Azure Functions extension)
- An Anthropic API key
- SharePoint site with a "Site Creation" list
- Azure AD app registration with
Sites.Selected(application permission) and per-site access granted
- Go to Azure Portal → Create a resource → "Azure Bot"
- Configure:
- Bot handle:
MaceyBot - Pricing tier: Standard (S1) — free for Teams-only
- Type of app: Multi Tenant
- Creation type: Create new Microsoft App ID
- Bot handle:
- Click Create
- Once created, go to the resource → Configuration:
- Note the Microsoft App ID (this is
BOT_APP_ID) - Click Manage Password → New client secret → copy the value (this is
BOT_APP_PASSWORD)
- Note the Microsoft App ID (this is
- Set the Messaging endpoint to:
(For
https://<your-function-app>.azurewebsites.net/api/MaceyBotfunc-mace-validator-dev, this would be:https://func-mace-validator-dev.azurewebsites.net/api/MaceyBot)
- In the Azure Bot resource → Channels → Microsoft Teams
- Click Apply (accept the terms)
- The Teams channel is now active
If you already have an app registration for MaceStyle with Sites.Selected, you can reuse it. Otherwise:
- Azure Portal → Azure Active Directory → App registrations → New registration
- Name:
MaceyBot-SP(or reuse existing) - API permissions → Add → Microsoft Graph → Application →
Sites.Selected - Grant admin consent
- Certificates & secrets → New client secret → copy value
- Note the Application (client) ID and Directory (tenant) ID
Add these to your Azure Function App Settings (Configuration → Application settings):
| Variable | Value | Notes |
|---|---|---|
BOT_APP_ID |
Microsoft App ID from Step 1 | Azure Bot registration |
BOT_APP_PASSWORD |
Client secret from Step 1 | Azure Bot password |
ANTHROPIC_API_KEY |
Your Anthropic API key | Claude API access |
SP_TENANT_ID |
Azure AD tenant ID | SharePoint auth |
SP_CLIENT_ID |
App registration client ID | SharePoint auth |
SP_CLIENT_SECRET |
App registration client secret | SharePoint auth |
SP_SITE_URL |
https://0rxf2.sharepoint.com/sites/pdms |
Target SharePoint site |
SP_LIST_NAME |
Site Creation |
SharePoint list name |
MACEY_MODEL |
claude-sonnet-4-20250514 |
Optional: override Claude model |
Using VS Code:
- Open
MaceStyleValidator/in VS Code - Cmd+Shift+P → "Azure Functions: Deploy to Function App"
- Select
func-mace-validator-dev
Using CLI:
cd MaceStyleValidator
func azure functionapp publish func-mace-validator-dev- Edit
teams-manifest/manifest.json:- Replace
{{BOT_APP_ID}}with your actual Bot App ID (from Step 1)
- Replace
- Replace the placeholder icons (
color.png,outline.png) with branded versions if desired:color.png: 192×192 px, full colouroutline.png: 32×32 px, transparent background with white outline
- Zip the manifest:
cd teams-manifest zip MaceyBot.zip manifest.json color.png outline.png - In Teams Admin Center (or Teams → Apps → Manage your apps → Upload):
- Upload
MaceyBot.zip - Or use "Upload a custom app" in Teams
- Upload
- In Teams, find "Macey" in your apps
- Start a chat — you should see the welcome message
- Walk through the conversation flow:
- Provide a project name
- Provide a description
- Choose visibility
- Provide an owner email
- Add optional notes
- Confirm submission
- Check the SharePoint "Site Creation" list for the new item
Test the conversation flow without deploying:
cd MaceStyleValidator
export ANTHROPIC_API_KEY=your_key_here
python3 test-maceybot.pyThis simulates the chat locally, calls Claude API, and mocks the SharePoint submission.
- Check the messaging endpoint URL in Azure Bot Configuration
- Verify
BOT_APP_IDandBOT_APP_PASSWORDare correct - Check Azure Function logs: Portal → Function App → Monitor
- Verify
ANTHROPIC_API_KEYis set correctly - Check the Function App logs for error details
- Try running
test-maceybot.pylocally to isolate the issue
- Verify the app registration has
Sites.Selectedwith admin consent and per-site access granted - Check
SP_SITE_URLpoints to the correct site - Verify the list name matches
SP_LIST_NAME - Check that list columns match: Title, SiteDescription, Visibility, SiteOwnerClaims, Notes
- For Bot Framework: check
BOT_APP_ID/BOT_APP_PASSWORD - For SharePoint: check
SP_TENANT_ID/SP_CLIENT_ID/SP_CLIENT_SECRET - Ensure the app registration is in the correct tenant
User in Teams
↓ (chat message)
Azure Bot Service (Teams channel)
↓
Python Azure Function (/api/MaceyBot)
↓ (sends conversation to Claude API)
Anthropic Claude API (claude-sonnet-4-20250514)
↓ (returns response + tool calls)
Python Azure Function
├── Replies to user in Teams
└── When confirmed → writes to SharePoint "Site Creation" list
↓ (triggers existing flow)
Power Automate "PDMS - Create Site and Group"
- Azure Bot Service: Free for Teams-only channel
- Azure Functions: Consumption plan (existing — negligible additional cost)
- Claude API: ~$0.003–0.01 per conversation (Sonnet, ~5–8 turns, ~2K tokens/turn)
- Estimated monthly: <$5 for moderate usage (100 site requests/month)