add-mcscopilot

Adds Microsoft Copilot Studio connector to a Power Apps code app. Use when invoking Copilot Studio agents, sending prompts to agents, or integrating agent…

npx skills add https://github.com/microsoft/power-platform-skills --skill add-mcscopilot

πŸ“‹ Shared Instructions: shared-instructions.md - Cross-cutting concerns.

Add Microsoft Copilot Studio

Workflow

  1. Check Memory Bank β†’ 2. Add Connector β†’ 3. Configure β†’ 4. Build β†’ 5. Update Memory Bank

Step 1: Check Memory Bank

Check for memory-bank.md per shared-instructions.md.

Step 2: Add Connector

First, find the connection ID (see connector-reference.md):

Run the /list-connections skill. Find the Microsoft Copilot Studio connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL β€” construct it from the active environment ID in context (from power.config.json or a prior step): https://make.powerapps.com/environments/<environment-id>/connections β†’ + New connection β†’ search for the connector β†’ Create.

npx power-apps add-data-source -a microsoftcopilotstudio -c <connection-id>

Step 3: Configure

Ask the user which Copilot Studio agent they want to invoke and what operations they need.

Agent Setup Prerequisites (manual steps the user must complete in Copilot Studio):

  1. Publish the agent: In Copilot Studio, click Channels β†’ select Teams β†’ add to Teams β†’ click Publish.
  2. Get the agent name: Under Channels, click "Web app". The connection string URL contains the agent name. Example: https://...api.powerplatform.com/copilotstudio/dataverse-backed/authenticated/bots/cr3e1_myAgent/conversations?... β€” the agent name is cr3e1_myAgent.

ExecuteCopilotAsyncV2 -- execute an agent and wait for the response:

Use the ExecuteCopilotAsyncV2 operation (path: /proactivecopilot/executeAsyncV2). This is the only endpoint that reliably returns agent responses synchronously. It is the same endpoint used by Power Automate's "Execute Agent and wait" action.

const result = await MicrosoftCopilotStudioService.ExecuteCopilotAsyncV2({
  message: "Your prompt or data here", // Can be a JSON string
  notificationUrl: "https://notificationurlplaceholder" // Required by API but unused; any URL works
});

// Response structure:
// result.responses β€” Array of response strings from the agent
// result.conversationId β€” The conversation ID
// result.lastResponse β€” The last response from the agent
// result.completed β€” Boolean indicating if the agent finished

Important: Agents often return responses as JSON strings. Parse the responses array to extract meaningful data:

const agentResponse = result.responses?.[0];
if (agentResponse) {
  const parsed = JSON.parse(agentResponse);
  // Extract specific fields, e.g., parsed.trend_summary
}

Use Grep to find specific methods in the generated service file (generated files can be very large β€” see connector-reference.md).

Known Issues

  • ExecuteCopilot (/execute) -- fire-and-forget, only returns ConversationId, not the actual response. Do NOT use this.
  • ExecuteCopilotAsync (/executeAsync) -- returns 502 "Cannot read server response" errors. Do NOT use this.
  • Conversation turn model (/conversations/{ConversationId}) -- only works after /execute, which doesn't provide responses. Do NOT use this.
  • Response casing varies -- check all variations: conversationId, ConversationId, conversationID.

Step 4: Build

npm run build

Fix TypeScript errors before proceeding. Do NOT deploy yet.

Step 5: Update Memory Bank

Update memory-bank.md with: connector added, agent name configured, configured operations, build status.

More skills from microsoft

oss-growth
microsoft
OSS growth hacker persona
official
microsoft-foundry
microsoft
Deploy, evaluate, and manage Foundry agents end-to-end: Docker build, ACR push, hosted/prompt agent create, container start, batch eval, continuous eval, prompt optimizer workflows, agent.yaml, dataset curation from traces. USE FOR: deploy agent to Foundry, hosted agent, create agent, invoke agent, evaluate agent, run batch eval, continuous eval, continuous monitoring, continuous eval status, optimize prompt, improve prompt, prompt optimizer, optimize agent instructions, improve agent...
officialdevelopmentdevops
azure-ai
microsoft
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
officialdevelopmentapi
azure-deploy
microsoft
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application β€” use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment",...
officialdevopsaws
azure-storage
microsoft
Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake. Answers questions about storage access tiers (hot, cool, cold, archive), when to use each tier, and tier comparison. Provides object storage, SMB file shares, async messaging, NoSQL key-value, and big data analytics. Includes lifecycle management. USE FOR: blob storage, file shares, queue storage, table storage, data lake, upload files, download blobs, storage accounts, access tiers,...
officialdevelopmentdatabase
azure-diagnostics
microsoft
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, troubleshoot functions, troubleshoot AKS, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures,...
officialdevopsdevelopment
azure-prepare
microsoft
Prepare Azure apps for deployment (infra Bicep/Terraform, azure.yaml, Dockerfiles). Use for create/modernize or create+deploy; not cross-cloud migration (use azure-cloud-migrate). DO NOT USE FOR: copilot-sdk apps (use azure-hosted-copilot-sdk). WHEN: "create app", "build web app", "create API", "create serverless HTTP API", "create frontend", "create back end", "build a service", "modernize application", "update application", "add authentication", "add caching", "host on Azure", "create and...
officialdevelopmentdevops
azure-validate
microsoft
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless...
officialdevopstesting