BLOG · MICROSOFT FOUNDRY · FINE-TUNING
Fine-tuning on Microsoft Foundry for classification: what it costs and what it takes
How fine-tuning works on Microsoft Foundry (Azure OpenAI), what training and hosting cost, when it beats prompting, and how to do it from a spreadsheet.
Fine-tuning and the StayCharted workflow
If your company runs on Microsoft Azure, Microsoft Foundry (formerly Azure AI Foundry, home of Azure OpenAI) can fine-tune a model such as GPT-4.1-mini on your team's past decisions, so it categorizes new tickets, emails or documents the same way.
This post covers how Foundry fine-tuning works, the cost most people miss (hosting), when it's worth it, and how StayCharted runs the whole thing in your Foundry from a spreadsheet.
What fine-tuning is
Fine-tuning trains a base model further on your examples, each a record and the category your team gave it, so it gives your answers without being told every time. On Foundry, the result is a custom model that you deploy under a name you choose and call like any other deployment.
Prompting or fine-tuning?
| Prompting a deployment | Fine-tuning a model | |
|---|---|---|
| What you give it | Instructions and a few examples, on every call | Hundreds or thousands of examples, once |
| Good for | A few categories that are easy to describe | Many categories, fine distinctions, your team's judgment calls |
| Ongoing cost | Tokens only | Tokens plus an hourly hosting fee while it's deployed |
| Effort | Write and maintain a prompt | Prepare data, train, deploy, test, keep it current |
How Foundry fine-tuning works
- Prepare JSONL in the Chat Completions format: a system message, the record as the user message, the category as the assistant message, one example per line, UTF-8 with a byte-order mark, under 512 MB a file.
- Choose a base model that supports supervised fine-tuning: GPT-4.1, GPT-4.1-mini, GPT-4.1-nano, GPT-4o and GPT-4o-mini, plus some open models on Foundry resources.
- Choose a training type: Standard (stays in your region), Global (may process data outside your region), or Developer (preemptible capacity).
- Submit the job in the Foundry portal under Build → Fine-tune, with hyperparameters such as epochs, batch size and learning rate multiplier, or the defaults.
- Deploy the custom model with a deployment name, and call that name, with the same system message you trained with.
- Test it on examples it never saw.
Microsoft's minimum is 10 examples, but it recommends starting with 50 good ones, and hundreds to thousands for the best results.
What it costs
On your Azure bill:
- Training: per training token (tokens × epochs × the rate). Global training is cheaper than Standard, and Developer cheaper again.
- Hosting: a deployed fine-tuned model has an hourly hosting fee, whether or not it's used: check current pricing for your model, region and deployment type. Developer-tier deployments have no hosting fee but are removed after 24 hours, so they're for testing.
- Answers: per token, at the applicable tuned-model rate.
So the question isn't only "is the tuned model better?", but "is it better by enough to pay for hosting all month?" For many classification jobs a prompted model with good examples, or a model trained elsewhere, does the job without the hosting fee.
The parts that take the time
Formatting the JSONL (with the byte-order mark), holding back honest test rows, roles and permissions (deploying needs a role that can write deployments), waiting on the job, deploying, testing every held-out row, working out accuracy per category, deciding which answers to check, and doing it again when your categories change.
Fine-tune in your own Foundry, from a spreadsheet, with StayCharted
StayCharted does the whole loop in your Foundry resource, and only makes the paid deployment when you publish:
- Connect once: Settings → AI platforms → Microsoft Foundry, your endpoint and resource ID, Sign in with Microsoft, and Also train models here. An admin consents once, and Deploy to Azure gives StayCharted's app two roles on that one resource, neither able to read its keys. No secret to paste.
- Upload your examples: a spreadsheet of past records and their categories, or send them from Google Sheets with the StayCharted add-on.
- Choose Train a model on your examples → Your servers — Microsoft Foundry, and GPT-4.1 mini (or nano, GPT-4.1, GPT-4o mini).
- StayCharted does the work: holds back test rows, writes the JSONL with the same system message it will ask with, uploads it, runs Global training, deletes the file, and tests the result on a Developer deployment with no hourly hosting fee.
- Read the report and publish. Publishing makes the Global Standard deployment, the one Azure bills by the hour. Publishing another version, or deleting the model, removes it.
- Use it from spreadsheet fills, the API, Power Automate, Zapier, Google Sheets, or Claude and ChatGPT. Unsure answers go to the Review Queue.
Not sure fine-tuning pays for its hosting? StayCharted can also use a Foundry deployment you already have without fine-tuning it ("Use your own AI, without training"), giving it your categories, your labeling guide and the most similar past examples with every question. Test both on the same rows and publish the better one.
Provider documentation and pricing
Developer deployment costs
A Developer deployment has no hourly hosting fee during its temporary evaluation lifetime. Inference is still billable. Publishing creates the paid deployment; check current model, region and deployment rates. Global training may process data outside your resource’s region.
Common questions about Microsoft Foundry fine-tuning
How do I fine-tune a model in Azure OpenAI / Microsoft Foundry?
Prepare a JSONL file in the Chat Completions format, start a fine-tuning job in the Foundry portal under Build → Fine-tune on a supported model, deploy the custom model under a name, and call that deployment with the same system message.
Which models can I fine-tune on Foundry?
GPT-4.1, GPT-4.1-mini, GPT-4.1-nano, GPT-4o and GPT-4o-mini, among others.
How much does Azure fine-tuning cost?
Training is per token; a deployed fine-tuned model also has an hourly hosting fee (check current model, region and deployment rates) plus per-token answers.
Is Azure AI Foundry the same as Microsoft Foundry?
Yes. Microsoft renamed Azure AI Foundry to Microsoft Foundry; Azure OpenAI models live there.
Can StayCharted fine-tune in my Foundry?
Yes, on Business: GPT-4.1 mini, nano, GPT-4.1 and GPT-4o mini, in your own resource, from a spreadsheet or Google Sheet. It tests on a Developer deployment with no hourly hosting fee; the paid one is made only when you publish.