Expand Your Copilot Studio's AI Arsenal with Azure AI Foundry Models
Connect any model from Azure AI Foundry—open source or custom—to Copilot Studio prompt actions.
Copilot Studio's built-in AI prompt actions give you a head start on generative responses, but they've always been restricted to OpenAI's GPT models (GPT‑4o, GPT‑4o‑mini, o3). With the integration of Azure AI Foundry, that limitation disappears. You can now deploy any model from the Azure AI Foundry catalog—Llama, Mistral, DeepSeek, or even a model you've fine‑tuned—and use it directly inside a Copilot Studio topic.
This guide shows you how to create an Azure AI Foundry resource, deploy a custom model, connect it to Power Platform, and build a conversational agent that uses that model to generate personalised travel itineraries. The same steps apply to any model you choose.
Prerequisites
Before starting, you'll need:
- An Azure subscription with permissions to create AI resources.
- Access to the Azure AI Foundry portal.
- A Copilot Studio environment with a Premium license (required for custom AI prompt actions).
- Basic familiarity with building topics and using the AI Prompt designer.
Set Up Your Azure AI Foundry Resource
Begin by creating an Azure AI Foundry resource in the Azure portal.
- Navigate to the Azure Portal and select Create a resource.
- Search for Azure AI Foundry and choose the offering that includes model deployment capabilities.
- In the creation wizard:
- Select a subscription and resource group (consider a dedicated group for AI experiments to simplify cost tracking).
- Provide a unique name for your resource.
- Choose a region that supports the models you intend to deploy (e.g., East US, West Europe).
- Review and create the resource.
After deployment completes, open the resource and click Go to Azure AI Foundry portal to access the management interface.
Deploy a Model in Azure AI Foundry
Inside the AI Foundry portal, navigate to the Models + endpoints section and click Deploy a model.
- Pick a base model from the catalog. For this example, we'll use Llama 4 Maverick from Meta. Other options include Mistral large, DeepSeek V3, or your own fine‑tuned version uploaded via the Custom models tab.
- Give your deployment a descriptive name (e.g.,
llama4-maverick-travel-agent) so you can easily identify it later. - Choose the Global Standard deployment type unless your scenario requires a specific throughput.
- Click Deploy.
Once the deployment is ready, the model's detail page shows the pieces you'll need for the connection:
| Property | Description |
|---|---|
| Target URI (Endpoint) | The HTTPS address for sending requests |
| API Key | The authentication secret for that endpoint |
| Deployment name | The name you just assigned (used as model identifier) |
| Base model name | The original model name (e.g., llama-4-maverick) |
Copy these values; you'll need them when configuring the connection in Copilot Studio.
Connect the Azure AI Foundry Model to Copilot Studio
- Open your Copilot Studio agent and create a new topic (or edit an existing one).
- Add a Prompt action. In the model dropdown, click the + icon (or Add custom model) to open the connection form.
- Fill in the connection details using the information from Azure AI Foundry:
| Copilot Studio Field | Azure AI Foundry Value |
|---|---|
| Model deployment name | The deployment name you chose |
| Base model name | The base model name (e.g., llama-4-maverick) |
| Azure model endpoint URL | The Target URI (endpoint) |
| API Key | The API Key |
Enable Test the connection and click Connect. A green check mark confirms the model is reachable.
- Close the form and select your newly connected model from the dropdown. Now any prompt action using this model will route requests to your AI Foundry endpoint.
Build a Prompt Action for Personalised Plans
We'll create a prompt that generates a custom travel itinerary based on the user's location, trip duration, and interests.
In the same topic, add a Prompt node and choose the model you just connected. Name the prompt Generate Travel Plan. Set the response output type to Text.
Use these instructions (feel free to adapt):
You are an experienced travel advisor. Given a destination, number of days, and visitor interests, produce a detailed day‑by‑day itinerary. For each day suggest:
- Morning / afternoon / evening activities
- Recommended restaurants or local dishes
- Transportation tips
- Estimated costs (in USD) Wrap the entire itinerary in
<plan>tags.
Add three input variables for the prompt:
| Variable Name | Test Value | Description |
|---|---|---|
Destination | London | City or region |
TripLength | 7 | Number of days (numeric) |
VisitorInterests | Must allow cats | Hobbies, dietary needs, etc. |
For TripLength, Copilot Studio will pass a number, but the prompt model expects text. Convert it with a formula in the prompt variable mapping:
Text(Topic.varTripLength, "0")
Replace Topic.varTripLength with the actual variable name you assigned in the topic.
Set the prompt output variable to varItineraryOutput.
Wire the Prompt into a Topic
Back in your topic structure, add Question nodes to collect the three pieces of information from the user.
- First question: "Which city or region are you travelling to?" → Identify as City entity → store in
varDestination. - Second question: "How many days will your trip last?" → Identify as Number → store in
varTripLength. - Third question: "Tell me about your interests or any special requirements." → Identify as User's entire response → store in
varVisitorInterests.
After the questions, insert the Generate Travel Plan prompt node and map the topic variables to the prompt inputs (as created above). Use the formula for the numeric conversion.
Finally, add a Message node to display the result. Use Topic.varItineraryOutput.text as the message content. Follow it with an End all topics node.
Your topic flow should look like:
- Trigger (user says "plan my trip")
- Question → destination
- Question → duration
- Question → interests
- Prompt → generate itinerary
- Message → output
- End topic
Test the Agent
Open the test chat panel and start the conversation. The agent will ask for the required details and then output a structured itinerary inside <plan> tags.
Common Mistakes & Troubleshooting
- Connection fails: Verify that the Target URI and API Key are copied exactly, including any trailing characters. Ensure the Azure AI Foundry resource is accessible from your Copilot Studio environment (no IP restrictions).
- Model not appearing in dropdown: After creating the connection, close and reopen the model list. If still missing, check that you have the correct Copilot Studio license (Premium).
- Numeric input fails: Always use
Text()to convert numbers to strings before passing them to the prompt. - Prompt outputs nothing: Confirm the prompt output variable is used in the Message node. Also inspect the prompt's response in the Debug mode to see if the model returned content.
- Rate limiting: The Global Standard tier may throttle requests. For high‑volume agents, consider provisioned throughput.
Recommendation
Start by testing with a small, fast model (like Llama 3.2 or an OpenAI gpt‑4o‑mini from the Foundry) to validate your prompt and topic flow. Once you're satisfied, swap in larger models or domain‑specific models. Always monitor response times and costs, as custom models may have different pricing than the built‑in OpenAI options.
References
- Original article: Azure AI Foundry Model In Copilot Studio Custom Prompts by Matthew Devaney
- Azure AI Foundry documentation – check for the latest guidance on model deployment and connections.
- Copilot Studio AI Prompt actions – official Microsoft documentation (placeholder URL).
Learn how to link your Copilot Studio agent to an Azure AI Search index containing your own documents for accurate, retrieval-augmented answers.
From multi‑branch condition blocks to a built‑in human review step, learn how to build resilient approval processes that combine AI logic with real‑world oversight.
Discover how the hidden EditTable YAML node lets you dynamically add, remove, or clear table variables directly inside your copilot conversations.