Skip to main content
In this article, you learn to use the Azure Developer CLI (azd) AI fine-tuning extension to set up and run fine-tuning jobs in Microsoft Foundry. The extension lets you initialize projects from templates, submit and manage fine-tuning jobs, and deploy fine-tuned models directly from your terminal.

Prerequisites

  • The Azure Developer CLI (azd) installed (version 1.22.1 or later) and authenticated (azd auth login).
  • The azd AI fine-tuning extension installed (azd ext install azure.ai.finetune). See Install the fine-tuning extension for details.
  • An Azure subscription with permission to create and manage Microsoft Foundry resources.
  • (Optional) The GitHub CLI installed, if you plan to download sample templates from GitHub repositories.

Install the Azure Developer CLI

Install azd for your operating system.

Verify the installation

After installing, verify that azd is installed and meets the minimum version requirement:
Confirm the output shows version 1.22.1 or later. If you need to upgrade, run:

Install the fine-tuning extension

Add the Azure AI fine-tuning extension to azd:
Verify the extension is installed:

Authenticate

Sign in to Azure (required)

Authenticate with your Azure account to access your subscription and resources:

Initialize your project

Use the azd ai finetuning init command to scaffold a fine-tuning project. Navigate to your desired working directory before running any of the following initialization methods.
You can skip initialization entirely by using the Quick Submit option, which lets you submit a fine-tuning job by providing the subscription and Foundry project endpoint inline.

Find your project ARM resource ID

To initialize with an Azure AI Foundry project, you need the project’s ARM resource ID. The resource ID follows this format:
You can find this value in the Azure portal by navigating to your AI Foundry project’s Profile page under Project details.

Option 1: Project + Template

Use an existing Azure AI Foundry project with a template:
Example:

Option 2: Project + Existing job

Clone configuration from an existing fine-tuning job:
Example:

Option 3: Template only

Start from a template and configure the project later:
Example:

Option 4: Clone from job

Clone configuration from an existing job ID:
Example:

Option 5: Project endpoint only

Initialize with just your Azure AI Foundry project endpoint:
Example:

Option 6: Interactive mode

Run without parameters for guided setup prompts:

Option 7: Minimal init (with subscription lookup)

Use minimal initialization for a simplified interactive experience with subscription lookup:
This option provides guided prompts to select your subscription and configure your environment.

Run fine-tuning commands

Navigate to your project folder (where fine-tune-job.yaml is located) and use the following commands to manage fine-tuning jobs.
Looking for example job YAML files? Check out the Fine-tuning CLI Samples in the Foundry samples repository.

Quick submit (skip initialization)

You can submit a job directly without running azd init first by providing the subscription and project endpoint inline:
Example:

Submit a job

List jobs

Show job details

Pause a job

Resume a job

Cancel a job

Deploy your fine-tuned model

Once your fine-tuning job completes successfully, deploy the model for inference:

Quick reference

Init parameters

Job parameters

Additional resources