How to Automate Copilot Studio Credit Limits for Agents
As part of the AI Accelerator program, more and more business users are building and publishing their own agents in Copilot Studio. As the number of agents grew across environments, managing Copilot Studio credit limits for each agent became a challenge for the admin team:
- Manual allocation per agent: Admins have to open each agent and assign credits individually, which becomes time-consuming as new agents are published every week.
- Uncontrolled consumption: Without defined limits, a single high-usage agent can consume a large share of the available credits, leaving other agents short.
- No default limits for new agents: Newly published agents start without any credit limit so they can consume credits unchecked until an admin notices and sets one manually.
- Growing number of environments: As new teams onboard to the program, new environments are added regularly and each one brings more agents that need limits applied.
To solve this, we automated the allocation of credit limits to Copilot Studio agents using a scheduled cloud flow. The flow loops through the configured environments, picks up newly created agents and applies the defined credit limit through an HTTP request. In this blog, I’ll walk through how to set it up.
Prerequisites
- Power Platform admin access on the environments where agents are deployed
- Copilot Credits capacity available in the tenant
- One or more published Copilot Studio agents in the target environments
- A Power Automate premium license (required for the HTTP connector)
- Access to create cloud flows in the environment where the solution will be created
Power Platform Admin Center
You can set the credit limits on the copilot studio agent from the power platform admin center. Navigate to Licensing -> Copilot Studio -> Manage Agents

Solution
In this demo, I’m creating a scheduled flow in the administration environment to centrally govern and monitor credit limits for Copilot Studio agents. Alternatively, you can create an automated flow that triggers when an agent is created in the environment, so the credit limit is set as soon as the agent is created.
Let’s create a scheduled cloud flow in Power Automate to automate credit limit allocation for Copilot Studio agents.
Start with a scheduled cloud flow and adjust the recurrence settings as per your requirements:

Click “Create” button to proceed.
Next, add a Compose action and enter the ID of the environment where the agents are created. The flow will set credit limits for all agents in the environments listed here. It works for a single environment ID as well. You can also use an environment variable to store the environment IDs.
Note: Use a comma (without spaces) to separate environment IDs if you’re setting up the flow for multiple environments.

After that, add an Apply to each action to iterate over each environment. Use the below expression to convert the comma-separated environment IDs into an array:
split(outputs('Compose_-_Environment_Ids'),',')

Inside the Apply to each, add the Get Environment as Admin action to get the environment instance URL for each environment ID. Pass the Current item from the Apply to each loop dynamically:
Note: You need Power Platform admin access to use the Power Platform for Admins connector actions.

Next, add the List rows from selected environment action to fetch agents from Dataverse. Pass the Linked Metadata Instance URL from the output of the Get Environment as Admin action. Enter the custom value bots in the Table name parameter. Use the below query in Filter rows to fetch agents created in the last 24 hours:
createdon ge '@{addHours(utcNow(),-24)}'
Note: The 24-hour window matches the daily recurrence. If you change the recurrence frequency, update this filter accordingly. To apply limits to existing agents, run the flow once without this filter.

Add another Apply to each action to iterate over the agents returned by the List rows action. Pass the body/value property from the List rows output:

Inside the nested Apply to each, add the Invoke an HTTP request action from the HTTP with Microsoft Entra ID (preauthorized) connector. Enter a connection name and pass the below URL in both the Microsoft Entra ID Resource URI (Application ID URI) and Base Resource URL parameters:
https://api.powerplatform.com

Click ‘Sign In’ and choose your account (if prompted) to create a connection.
Refer the below values to configure the “Invoke an HTTP request” action:
Method: PUT
Url of the Request:
https://api.powerplatform.com/licensing/environments/@{items('Apply_to_each_-_Environment')}/entitlements/MCSMessages/resources/@{items('Apply_to_each_-_bot')?['botid']}/threshold?api-version=2024-10-01
Body of the request:
{
"stopResource": false,
"limit": 8000,
"stopIfOverCapacity": true,
"notifyIfOverCapacity": true,
"notificationThreshold": 80
}
Note: I have used credit limit of 8k but you can update this and other parameters as per your requirements.

Flow is ready, let’s run the flow to test the results.
Flow Run
The flow ran successfully at the scheduled time. In this run, it processed two environments and set the credit limit on the agent created in the last 24 hours:

Output
Let’s verify the result in the Power Platform admin center. Navigate to Licensing -> Copilot Studio -> Manage Agents.
We can see that a credit limit of 8,000 has been assigned to the agents, and their status now shows Within Limit. Agents without a limit were created before the 24-hour window and were not picked up by this run.

Note: It can take a few hours for a Copilot Studio agent to appear in this list. In my testing, agents seem to show up only after users interact with them and some credits are consumed.
Conclusion
By automating credit allocation for Copilot Studio agents, we’ve removed another recurring manual task from the admin team. Instead of setting limits on each agent through the admin center, a scheduled cloud flow applies consistent limits to newly created agents across all configured environments.
- No more manual allocation: Admins no longer need to open each agent in the admin center to set its credit limit.
- Controlled consumption: Every new agent gets a defined limit, so no single agent can consume a disproportionate share of credits.
- Consistent governance: The same limit and notification settings are applied to every agent, with no manual steps to get wrong.
- Scalable: As more makers publish agents, the admin team can keep up without the workload growing at the same pace.
- Easy to extend to new environments: A single flow covers multiple environments and plugging in a new one is as simple as adding its environment ID to the Compose action or environment variable. No changes to the flow logic are needed.