| 1 | --- |
| 2 | title: "How to Configure Azure AI Foundry with Continue" |
| 3 | slug: ../azure |
| 4 | sidebarTitle: "Azure AI Foundry" |
| 5 | --- |
| 6 | |
| 7 | <Info> |
| 8 | Create an Azure AI Foundry resource in the [Azure Portal](https://portal.azure.com) |
| 9 | </Info> |
| 10 | |
| 11 | <Tabs> |
| 12 | <Tab title="YAML"> |
| 13 | ```yaml title="config.yaml" |
| 14 | models: |
| 15 | - name: <Model_NAME> |
| 16 | provider: azure |
| 17 | model: <MODEL_ID> |
| 18 | apiBase: <YOUR_DEPLOYMENT_BASE> |
| 19 | apiKey: <YOUR_AZURE_API_KEY> # If you use subscription key, try using Azure gateway to rename it apiKey |
| 20 | env: |
| 21 | deployment: <YOUR_DEPLOYMENT_NAME> |
| 22 | apiType: azure-foundry # Or "azure-openai" if using OpenAI models |
| 23 | apiVersion: 2023-07-01-preview # Azure API version |
| 24 | ``` |
| 25 | </Tab> |
| 26 | <Tab title="JSON (Deprecated)"> |
| 27 | ```json title="config.json" |
| 28 | { |
| 29 | "models": [{ |
| 30 | "title": "<MODEL_NAME>", |
| 31 | "provider": "azure", |
| 32 | "model": "<MODEL_ID>", |
| 33 | "apiBase": "<YOUR_DEPLOYMENT_BASE>", |
| 34 | "deployment": "<YOUR_DEPLOYMENT_NAME>", |
| 35 | "apiKey": "<YOUR_AZURE_API_KEY>", // If you use subscription key, try using Azure gateway to rename it apiKey |
| 36 | "apiType": "azure-foundry" // Or "azure-openai" if using OpenAI models |
| 37 | }] |
| 38 | } |
| 39 | ``` |
| 40 | </Tab> |
| 41 | </Tabs> |
| 42 | |
| 43 | ## Azure OpenAI Service (Alternative) |
| 44 | |
| 45 | <Info> |
| 46 | Get access to the Azure OpenAI service [here](https://azure.microsoft.com/en-us/products/ai-services/openai-service) |
| 47 | </Info> |
| 48 | |
| 49 | Azure OpenAI Service requires a handful of additional parameters to be configured, such as a deployment name and API base URL. |
| 50 | |
| 51 | To find this information in _Azure AI Foundry_, first select the model that you would like to connect. Then visit _Endpoint_ > _Target URI_. |
| 52 | |
| 53 | For example, a Target URI of `https://just-an-example.openai.azure.com/openai/deployments/gpt-4o-july/chat/completions?api-version=2023-03-15-preview` would map to the following: |
| 54 | |
| 55 | <Tabs> |
| 56 | <Tab title="YAML"> |
| 57 | ```yaml title="config.yaml" |
| 58 | models: |
| 59 | - name: <MODEL_NAME> |
| 60 | model: <MODEL_ID> |
| 61 | provider: azure |
| 62 | apiBase: https://just-an-example.openai.azure.com |
| 63 | apiKey: <YOUR_AZURE_API_KEY> |
| 64 | env: |
| 65 | apiVersion: <API_VERSION> |
| 66 | deployment: <MODEL_DEPLOYMENT> |
| 67 | apiType: azure-openai |
| 68 | ``` |
| 69 | </Tab> |
| 70 | <Tab title="JSON (Deprecated)"> |
| 71 | ```json title="config.json" |
| 72 | { |
| 73 | "title": "<MODEL_NAME>", |
| 74 | "model": "<MODEL_ID>", |
| 75 | "provider": "azure", |
| 76 | "apiBase": "https://just-an-example.openai.azure.com", |
| 77 | "deployment": "<MODEL_DEPLOYMENT>", |
| 78 | "apiVersion": "<API_VERSION>", |
| 79 | "apiKey": "<YOUR_AZURE_API_KEY>", |
| 80 | "apiType": "azure-openai" |
| 81 | } |
| 82 | ``` |
| 83 | </Tab> |
| 84 | </Tabs> |