The Foundry for VS Code extension integrates Azure AI Foundry capabilities directly into the Visual Studio Code editor. It provides access to the model catalog, model playground, agent builders, and Foundry project management without leaving the IDE.
| Capability | Description |
|---|---|
| Model catalog | Browse, filter, and deploy models from the Foundry model catalog |
| Model playground | Interact with deployed models via a chat interface inside VS Code |
| Agent builders | Build and test declarative and hosted agents |
| Project connection | Connect to an existing Foundry project and view its resources |
| Code generation | Generate SDK sample code for deployed models in multiple languages |
| Resource management | Create projects, deploy models, manage connections and vector stores |
The extension does not provide full parity with the Foundry portal. Features such as advanced evaluation configuration, fleet management (Control Plane), and policy administration require the full portal at ai.azure.com.
- An Azure subscription (free account eligible)
- Visual Studio Code installed
- Appropriate RBAC permissions (see Built-in Foundry roles for definitions):
- Foundry User - minimum for development (call models, work with agents)
- Foundry Project Manager - for creating and managing Foundry projects
- Quota headroom to deploy new models (or an existing deployed chat model)
Extension details:
- Name:
Foundry for Visual Studio Code - Publisher ID:
TeamsDevApp.vscode-ai-foundry - Marketplace: Foundry for Visual Studio Code
- Open the Foundry for Visual Studio Code extension page
- Select Install
- Follow prompts to complete installation in VS Code
- The Foundry icon appears in the primary navigation bar (left side)
- Open VS Code
- Select Extensions from the left activity bar
- Select the Settings icon at the top-right of the extensions pane
- Search for Foundry and select the extension
- Select Install
- The Foundry icon appears in the activity bar after installation
The extension uses the Azure account sign-in managed by the Azure Resources VS Code extension (installed as a dependency).
Sign in steps:
- Select the Azure icon on the VS Code activity bar
- Select Sign in to Azure... in the Azure Resources view
- Complete browser-based authentication
- Under Resources, select your Azure subscription and resource group
- Navigate to Foundry and right-click your project
- Select Open in Foundry Extension
Use the Command Palette (F1) and search "Foundry" for a full list of available commands.
The extension organises resources into three sections in the sidebar:
| Section | Contents | Primary use |
|---|---|---|
| Resources | Deployed models, declarative agents, hosted agents, connections, vector stores | View and manage existing project resources |
| Tools | Model Catalog, Model Playground, Agent Playgrounds (remote and local), Local Visualizer, Deploy Hosted Agents | Deploy new models, test prompts, interact with agents |
| Help and Feedback | Documentation links, GitHub repository, privacy statement, community links | Access support resources |
Access paths:
- Command Palette (
F1):Foundry: Open Model Catalog - Plus icon next to Models in the Resources section
- Model Catalog link in the Tools section
Filter the catalog by: Hosted by, Publisher, Feature, Model type. Toggle Fine-Tuning Support to filter models that support fine-tuning. Providers include Microsoft, OpenAI, Meta, DeepSeek, and others.
- Select Deploy next to the model name in the catalog
- Enter a deployment name
- Select the deployment type from the dropdown
- Select the model version
- (Optional) Adjust tokens per minute using the slider
- Select Deploy in Foundry (bottom-left)
- Confirm in the dialog
- The model appears under Models in the Resources section after deployment
Expand the Models section and select a model to view its card:
- Deployment Info: name, provisioning state, deployment type, rate limit, version
- Endpoint info: target URI, authentication type, API key
- Useful links: code sample repository and tutorial links
- Right-click a deployed model → Open code file
- Select the preferred SDK (Foundry SDK, OpenAI SDK, etc.)
- Select the preferred language (Python, JavaScript, C#, Java)
- Select the preferred authentication method
- A sample code file opens in a new editor tab
Open the playground by double-clicking Model Playground in the Tools section, or by right-clicking a deployed model → Open in playground.
Features:
- Enter prompts and view responses
- View code button (top-right): displays the equivalent SDK code for the current exchange
- History link (top-left): displays previous chat sessions
- Select the plus icon next to Resources in the sidebar
- Choose or create a resource group:
- To create: select Create new resource group, enter a name, select a location
- To use existing: select the resource group from the list
- Enter a project name in the Enter project name field
- After deployment, a confirmation popup appears
- Optionally select Deploy a model in the popup to open the Model Catalog immediately
- Right-click on a Foundry project → Switch Default Project in Azure Extension
- Select the project from the list
- The selected project displays Default after its name
Tip: Right-click a project name to copy the project endpoint or API key.
| Capability | Extension | Portal (ai.azure.com) |
|---|---|---|
| Model catalog and deployment | Yes | Yes |
| Model playground | Yes | Yes |
| Agent builder (basic) | Yes | Yes |
| Control Plane (fleet management) | No | Yes |
| Guardrail policy management | No | Yes |
| Evaluation configuration | No | Yes |
| AI Red Teaming Agent | No | Yes |
| Security integrations (Defender, Purview) | No | Yes |
| Quota management | No | Yes |
| Issue | Resolution |
|---|---|
| Extension does not appear after installation | Restart VS Code; verify the extension is enabled under Extensions |
| Sign-in fails or subscriptions do not load | Verify Azure account permissions; sign out and sign in again from Azure Resources |
| Model deployment fails with a quota error | Check subscription quota in the Azure portal; request an increase or delete unused deployments |
| Extension commands not visible in Command Palette | Confirm the extension is installed and VS Code has reloaded |
- Refresh the Foundry extension in the VS Code activity bar
- Expand the Models section under Resources
- Right-click the model → Delete
Warning: Deleting a resource group permanently removes all resources within it, including the Foundry project and all deployed models. This action cannot be undone.
- Open the Azure portal
- Navigate to the resource group
- Select Delete resource group and confirm
- Work with the Microsoft Foundry for VS Code extension (Microsoft Learn)
- Foundry for VS Code extension on the Marketplace
- Foundry SDK overview
- Role-based access control for Foundry