How to Automate Code Execution in Microsoft 365 with Copilot Managed Runtime
Your team spends hours copying data between Excel, Power BI, and custom scripts. You know automation could save time, but building and securing a code execution environment feels like a project for your IT department—or an external developer. Meanwhile, competitors are automating workflows with AI and leaving you behind.
The direct answer: Microsoft’s Copilot Managed Runtime lets you run Python and JavaScript code directly within Microsoft 365, without managing servers or complex infrastructure. It’s a secure, scalable way to automate data processing, integrate systems, and extend Copilot’s capabilities—all within the tools your team already uses.
What is Copilot Managed Runtime?
Copilot Managed Runtime is a service in Microsoft 365 that provides a sandboxed environment for executing custom code. Think of it as a secure container where your scripts run on demand, triggered by Copilot, Power Automate, or other Microsoft 365 apps. You write the code; Microsoft handles the servers, patching, and scaling.
Key capabilities
- Language support: Python and JavaScript (Node.js) are supported out of the box.
- Integration: Call it from Power Automate flows, Copilot Studio bots, or Microsoft Teams messages.
- Security: Code runs in an isolated environment with no direct access to your network or data unless you explicitly grant it.
- Scalability: Automatically scales with your usage, so you don’t worry about capacity.
Why your business should care
If you’re like most small and mid-sized businesses, you have data trapped in various systems: accounting software, CRM, spreadsheets. Copilot Managed Runtime lets you build lightweight automations without hiring a full-time developer. For example:
- Automatically clean and merge customer data from multiple sources before importing into Dynamics 365.
- Run complex calculations in Excel that go beyond standard formulas.
- Generate custom reports by pulling data from SharePoint and formatting it for Power BI.
These tasks previously required custom scripts on a server or manual effort. Now they can be triggered by a simple Copilot command or a scheduled flow.
How to set it up
Getting started with Copilot Managed Runtime involves a few steps. You’ll need a Microsoft 365 subscription that includes Copilot (such as Microsoft 365 Business Premium or E3/E5 with Copilot add-on) and appropriate permissions.
Step 1: Enable the runtime in your tenant
An admin goes to the Microsoft 365 admin center, navigates to Settings > Org settings > Copilot, and enables “Managed Runtime.” You can restrict access to specific security groups.
Step 2: Create a runtime environment
In the Copilot Studio or Power Automate portal, create a new runtime environment. Choose your language (Python or JavaScript) and set resource limits (memory, timeout).
Step 3: Write and deploy your code
Use the built-in code editor to write your script. You can test it with sample data before deploying. Once deployed, you can call it from a Power Automate flow using the “Run Copilot Runtime” action.
Step 4: Monitor and manage
Use the Microsoft 365 compliance center to audit code executions and set data loss prevention policies. You can also view logs in Azure Monitor if you need deeper insights.
Cost considerations
Copilot Managed Runtime is available as an add-on to certain Microsoft 365 plans. Pricing is based on the number of code executions and compute time. For a typical small business, costs start around $200 per month for moderate usage. However, you’ll also need to factor in the cost of Copilot licenses if you don’t already have them.
Next steps for your business
Start by identifying one repetitive task that involves data manipulation. Then, work with your IT provider to set up a pilot. If you don’t have in-house expertise, consider partnering with a Microsoft Certified Solution Provider like KloudFokus. We can help you assess readiness, implement the runtime securely, and train your team. Our AI and IT services are designed for businesses like yours.
For a broader look at how we support Microsoft 365, visit our services page.
Ready to automate? Contact KloudFokus to schedule a consultation and see how Copilot Managed Runtime can save your team hours each week.
