If you’re looking to leverage your own custom AI models within Visual Studio Code, using Azure AI Foundry models as your Bring Your Own Key (BYOK) provider is an excellent approach. Previously limited to the Insiders build, custom BYOK models are now officially supported in the stable release of VS Code. This allows you to integrate powerful, customized models directly into your development workflow via GitHub Copilot.
Finding Your Azure Foundry Details
Before configuring Visual Studio Code, you need to retrieve your endpoint and access key from the Azure Foundry portal. Navigate to the Models section and select your deployed model, such as gpt-chat-latest. From the Details tab, you can securely copy both your Endpoint URL and your access Key.
Configuring BYOK in Visual Studio Code
Watch the short demonstration below to see how these settings are applied within the editor, or follow the step-by-step instructions:
To configure the BYOK model directly through the Copilot chat window in VS Code:
- Open the GitHub Copilot chat window.
- Click on the model selection dropdown at the bottom.
- Click the gear icon next to Other Models to open the Language Models settings.
- Click the + Add Models button and select Azure.
- You will be prompted to enter a Group Name and your Azure API Key. This will generate a configuration in your
chatLanguageModels.jsonfile where you can add your endpoint URL,id, andname. - When editing the JSON file, note that the
idfield must precisely match your Azure Foundry deployment name (e.g.,gpt-chat-latest). Thenamefield, however, can be freely chosen and is what will be displayed in the VS Code model selector.
After saving your configuration, your custom Azure Foundry model will be ready to assist you seamlessly within the Copilot chat interface!
