Use a Foundry model in Copilot Studio prompts, and keep it governed
Connect a model you deployed in Microsoft Foundry to a prompt in Copilot Studio, avoid the endpoint and model-version traps, and govern it with data policies and Foundry's content filters.
Azure + Power PlatformFix a problem4 min read
You can run a prompt in Copilot Studio on a model you deployed yourself in Microsoft Foundry instead of the managed models Copilot Studio offers. That lets you use a model from Foundry's catalog, such as a Llama or Phi model, or your own deployment of an OpenAI model, with your own content filters and quota. The same feature works in Power Apps and Power Automate prompts. Two details decide whether the connection works at all: the endpoint you paste and the model family you choose.
Where a Foundry model fits
An agent in Copilot Studio uses models in two different places:
- The agent's primary model decides how the agent plans, chooses tools and answers. You pick it on the agent's Overview page, under Model, from Copilot Studio's own list, which also offers some models from Anthropic, xAI and Mistral through a separate feature.
- Prompt tools are reusable instructions the agent calls for one job, such as summarising a case or extracting fields from a document. This is where a Foundry model plugs in: each prompt runs on the model you choose for it.
So the pattern is a capable primary model for the conversation, and a prompt on your Foundry model for the task that needs it.
These steps apply to agents built on Copilot Studio's standard harness.
Connect the model to a prompt
- In Foundry, deploy the model you want. It must be a chat completion model. Note the deployment's endpoint, its deployment name and its base model name.
- In Copilot Studio, open your agent's Tools tab, select Add a tool > New tool > Prompt, and give the prompt a name.
- Write the instructions under Instructions, or describe the task and let Copilot draft them.
- In the Model list next to the instructions, select the + to connect a model from Azure AI Foundry.
- Enter the endpoint, and the Model deployment name and Base model name exactly as Foundry shows them. Select Connect.
- Choose your model in the Model list and save the prompt. Every run of this prompt now uses it.
If the prompt takes an image or a document, the list shows only models that can read images, such as GPT-4o, GPT-4o mini, o1 and the Phi vision models.
The two traps
| Problem | Why | Fix |
|---|---|---|
| Resource not found when you select Connect | You pasted the model's Responses API endpoint, which ends in /openai/v1/responses | Use the chat completions endpoint, which ends in /chat/completions, for example https://<resource>.services.ai.azure.com/openai/deployments/<deployment>/chat/completions |
| The model you want can't be connected | GPT-5, GPT-5 mini, GPT-5 nano and later GPT-5.x models aren't supported for prompts yet | Deploy an earlier supported model for the prompt, or use one of Copilot Studio's managed models |
Copilot Studio also can't generate images through this feature. To return an image from a Foundry image model, expose it as a REST API and call it from a custom action.
Govern it
- Data policies. Each Foundry model a maker connects is a connection through a connector named Azure AI Foundry. In the Power Platform admin center, give that connector a place in your data policies: allow it with your business connectors where makers may bring models, or block it where they may not.
- Connections. Every model a maker connected appears on the Connections page like any other connection. Review them there, and remove the ones nobody should use.
- Responsible AI. Microsoft recommends managing content filters and other responsible AI settings for these models in Foundry, on the deployment itself.
- Quota. Prompts call your deployment directly, so they use its rate limits. A busy agent can be throttled by your own deployment's limits, which you raise or spread in Foundry.
- Experimental models. If you also change the agent's primary model, Copilot Studio's experimental and preview models aren't meant for production, and some process data outside your region.
Sources
- Bring your own model for your prompts, Microsoft Learn
- Select a primary AI model for your agent, Microsoft Learn
- Responsible AI for Azure AI Foundry, Microsoft Learn
- Data policies, Microsoft Learn
Did this fix it?
Comments
No comments yet. Share what worked for you.
Sign in to comment. Comments show under a display name you choose, never your email.