Copilot Studio: Delete Full Agents
Microsoft Copilot Studio
Dec 22, 2025 10:42 PM

Copilot Studio: Delete Full Agents

by HubSite 365 about Daniel Christian [MVP]

Lead Infrastructure Engineer / Vice President | Microsoft MCT & MVP | Speaker & Blogger

Microsoft expert: Delete Copilot Studio agents with Power Automate PVA Delete Bot; app registration and governance

Key insights

  • Summary: This video walks through using the PVA Delete Bot action in a Power Automate flow to remove full Copilot Studio agents at scale.
    It shows building, testing, and cleaning up the flow step by step.
  • Prerequisites: You need tenant admin or Power Platform admin rights and the agent Bot ID plus the Environment ID for targets.
    Also prepare an Azure app or Application User credentials for API authentication used by the flow.
  • Core method: The flow issues an HTTP DELETE call to the Copilot Studio API for the target environment and bot, returning a 204 OK on success.
    This permanently removes the agent, its workspace, topics, content, and metrics from the environment.
  • Power Automate steps: Supply botId and environmentId, create/enable an Application User with admin role, call the DELETE action using that identity, then disable the Application User as cleanup.
    The video uses child flows to automate creation and teardown of the app user.
  • Benefits: Use automation for fast, repeatable removals during audits, compliance checks, or bulk cleanup.
    This approach scales better than manual deletion in the portal and supports scheduled or event-driven workflows.
  • Testing & risks: Test flows in a sandbox before running in production and verify IDs before deletion because removals are irreversible.
    When deleting manually in the portal, the UI requires case-sensitive name confirmation; the automated method bypasses that but still permanently deletes data.

Overview of the Video

In a recent YouTube tutorial, Daniel Christian [MVP] demonstrates how to remove Copilot Studio agents at scale using Power Automate. The video walks viewers through a flow that employs the PVA Delete Bot action and related API calls. Consequently, the method lets administrators delete agents across environments without using the Copilot Studio portal manually. This article summarizes the key steps and explores tradeoffs and risks that teams should consider before adopting the approach.

How the Power Automate Flow Works

First, the flow accepts identifiers such as the Bot ID and Environment ID so it can target a specific agent. Then the solution typically creates a temporary Application User with administrative rights, authenticates using a client secret, and issues an HTTP DELETE request to the platform endpoint. Specifically, the API call uses the DELETE verb against the Copilot Studio endpoint and returns a 204 response when the deletion succeeds. Finally, the flow disables or removes the temporary application user to avoid leaving high-privilege accounts active.

Requirements and Setup

The video makes clear that administrators need specific permissions and identifiers before starting. For example, a Power Platform tenant admin, Power Platform Administrator, or Dynamics 365 Service Administrator role is required, and the Bot ID and Environment ID must be known. In addition, authentication typically relies on Microsoft Entra ID (Azure AD) and application secrets, although the video also highlights alternatives using the Dataverse Web API. Therefore, teams should gather these elements and validate access in a sandbox environment before running the flow in production.

Tradeoffs and Governance Considerations

Automating deletions yields clear benefits but also introduces risks that administrators must weigh. On one hand, programmatic deletion provides scalability and faster remediation for noncompliant or orphaned agents, which helps with security and governance. On the other hand, deletion is irreversible and can remove associated data such as workspaces, topics, and metrics, so unintended removals can cause data loss. Consequently, many organizations will need a governance layer—such as approval steps, audit logging, or a staging area—to balance speed with safety.

Moreover, the approach requires elevated privileges to create application users and perform admin operations, which increases the attack surface if not managed carefully. While some flows use the Dataverse approach to reduce direct Azure privileges, older namespaces and APIs are being deprecated, so maintainers must watch for API changes. In practice, tradeoffs include choosing between simplicity and security, and between immediate automation and multi-step approvals that slow response time but reduce risk.

Challenges and Practical Tips

The tutorial highlights several practical challenges that teams commonly encounter. Authentication failures, permission gaps, and incorrect identifiers are frequent blockers, so verifying each prerequisite before running the flow saves time. In addition, error handling and retry logic are essential because the delete process may fail under concurrency or rate limit conditions; therefore, flows should capture responses and surface trustworthy logs for review.

Testing is also crucial: run the flow against test agents in a non-production environment and verify that cleanup steps remove temporary application users. Furthermore, implement clear naming conventions and retention rules for logs so that audits can trace who triggered deletions and why. Finally, document the flow and its triggers to support long-term maintenance and future staff transitions.

Best Practices and Recommendations

To reduce risk, combine automation with simple governance controls, such as an approval step or a locked Dataverse table that records pending deletions. Also, keep secrets in secure stores and rotate them regularly; otherwise, a leaked secret could permit unauthorized deletions. In addition, schedule periodic reviews of any automation that creates privileged application users to ensure no long-lived accounts remain enabled.

In summary, Daniel Christian’s tutorial provides a practical, reproducible method to delete Copilot Studio agents using Power Automate while emphasizing cleanup and security. Organizations that follow the recommended testing and governance steps can gain scalable deletion capabilities without sacrificing control. Ultimately, teams should balance automation speed with safeguards to protect data and maintain compliance when removing bots.

Microsoft Copilot Studio - Copilot Studio: Delete Full Agents

Keywords

delete Copilot Studio agents Power Automate, remove Copilot Studio full agents, Power Automate delete Copilot agents tutorial, delete Copilot Studio agent flow, automate Copilot Studio agent removal, Power Platform Copilot agent deletion, how to delete Copilot Studio agents, Copilot Studio agent management Power Automate