Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure AI Foundry provides a unified platform for enterprise AI operations, model builders, and application development. This foundation combines production-grade infrastructure with friendly interfaces, ensuring organizations can build and operate AI applications with confidence.
With Azure AI Foundry, you can:
Deploy the latest language models from Microsoft, OpenAI, Meta, DeepSeek, and more using the robust model catalog
Test the deployed models in a model playground
Quickly get started with developing generative AI applications using a collection of Azure curated code templates
Configure and deploy agents with Azure AI Foundry Agent Service
With the Azure AI Foundry for Visual Studio Code extension, you can accomplish much of this workflow directly from Visual Studio Code. It also comes with other features, such as code templates, playgrounds, and integration with other VS Code extensions and features.
This article shows you how to quickly get started using the features of the Azure AI Foundry for Visual Studio Code extension.
Important
Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don't recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Prerequisites
Before using the Azure AI Foundry for Visual Studio Code extension, you must:
Download, install, and configure Visual Studio Code. More information: Download Visual Studio Code
Your subscription needs to be below your quota limit to deploy a new model in this quickstart. Otherwise you already need to have a deployed chat model.
Installation
After you install Visual Studio Code, you need to install the Azure AI Foundry for Visual Studio Code extension.
To install the Azure AI Foundry for Visual Studio Code extension:
Open Visual Studio Code.
Select Extensions from the left pane.
Select the Settings icon from the top-right on the extensions pane.
Search for and select Azure AI Foundry.
Select Install.
Verify the extension is installed successfully from the status messages.
Get started
Get started with the Azure AI Foundry extension by using the following steps.
Note
For a full list of features available in the extension, use the Command Palette. Select F1 to open the command palette and search Azure AI Foundry. The following screenshot shows some of the actions for Azure AI Foundry.
Sign in to your resources
Sign in to your Azure subscription to access your resources with the following steps:
Select the Azure Icon on the VS Code Navbar.
Sign in by selecting the
Sign in to Azure...
item in the Azure Resources view.Under the "Resources" section, select your Azure Subscription and Resource Group.
Select Azure AI Foundry and right-click your project.
Select Open in Azure AI Foundry Extension.
Explore the Azure AI Foundry Extension
The Azure AI Foundry Extension opens in its own view, with the Azure AI Foundry Icon now displayed on the VS Code Navbar. The extension has three main sections: Resources, Tools, and Help and Feedback.
Resources: This section contains the resources you have access to in your Azure AI Foundry project. The Resources section is the main view for interacting with your Azure AI Foundry Services. It contains the following subsections:
- Models: This section contains the models you can use to build and deploy your AI applications. The Models view is where you can find your deployed models in your Azure AI Foundry project.
- Agents: This section contains your deployed agents in your Azure AI Foundry project.
- Threads: This section contains the threads and runs from a deployed agent in your Azure AI Foundry project.
Tools: This section contains the tools you can use to build and deploy your AI applications. The Tools view is where you can find the tools available to deploy and then work with your deployed models and agents. It contains the following subsections:
- Model Catalog: The link to the model catalog you can use to discover and deploy models.
- Model Playground: The link to the model playground for interacting with your deployed models in your Azure AI Foundry project.
- Agent Playground: The link to the agent playground for interacting with your deployed agents in your Azure AI Foundry project.
Help and Feedback: This section contains links to the Azure AI Foundry documentation, feedback, support, and the Microsoft Privacy Statement. It contains the following subsections:
- Documentation: The link to the Azure AI Foundry Extension documentation.
- GitHub: The link to the Azure AI Foundry extension GitHub repository.
- Microsoft Privacy Statement: The link to the Microsoft Privacy Statement.
Note
To learn more about working with Agents and Threads in the Azure AI Foundry Extension, see the Work with Azure AI Foundry Agent Service in Visual Studio Code article.
Create a project
You can create a new Azure AI Foundry project from the Azure AI Foundry Extension view with the following steps:
Select the plus icon next to Resources in the Resources section of the Azure AI Foundry Extension view.
In the top center, enter the Azure AI Foundry Project name to use in the Enter project name textbox and press Enter.
You can either create a new resource group or select an existing one.
To create a new resource group:
- In the top center, select Create new resource group and press Enter.
In the top center, enter the Azure Resource Group name to use in the Enter new resource group textbox and press Enter.
In the top center, select the location you want to use from the list of available locations and press Enter.
To use an existing resource group:
- In the top center, select the resource group you want to use from the list of available resource groups and press Enter.
After project deployment, a popup appears with the message Project deployed successfully.
To deploy a model to the newly created project, select the Deploy a model button in the popup. This action opens the Model Catalog page in the Azure AI Foundry Extension view to select the desired model to deploy.
The default Azure AI Foundry Project
When you open a project in the Azure AI Foundry Extension, that project is set as your default project.
Switch your default project by following these steps:
Right-click on the Azure AI Foundry Project and select the Switch Default Project in Azure Extension option.
In the top center, select the Azure AI Foundry Project you want to use from the list of available projects and press Enter.
Your selected project will now display Default after the project name.
Work with models
The Azure AI Foundry for Visual Studio Code extension enables you to create, interact with, and deploy Large Language Models from within Visual Studio Code.
Explore all models with the model catalog
The model catalog in Azure AI Foundry portal is the hub to discover and use a wide range of models for building generative AI applications.
Access the model catalog from several different ways:
- The Azure AI Foundry: Open Model Catalog command palette command.
- Select the plus icon next to Models in the Resources section of the Azure AI Foundry Extension view.
- Select the Model Catalog link in the Tools section of the Azure AI Foundry Extension view.
Open the model catalog from the command palette
Access the model catalog from the command palette to explore and deploy a curated selection of models available in Azure AI Foundry, right from inside VS Code.
Select F1 to open the command palette.
Enter Azure AI Foundry: Open Model Catalog and press Enter.
The Model Catalog page is displayed.
Filter the Model Catalog by
Publisher
and/orTask
using the dropdowns at the top-left of the page.Search for a specific model using the search bar at the top-center of the page.
Open the model catalog from the Resources section
The Model Catalog is also available in the Resources section of the Azure AI Foundry Extension view.
In the Azure AI Foundry Extension view, select the plus icon next to Models to open the Model Catalog.
Tip
You can also right-click on Models and select the Deploy new AI model option to open the Model Catalog to start the deployment process.
Open the model catalog from the Tools section
The Model Catalog is also available in the Tools section of the Azure AI Foundry Extension view. Double-click on the Model Catalog link to open the Model Catalog.
Deploy a model from the model catalog
Deploy a selected model in the model catalog using the following steps:
Select the Deploy in Azure immediately following the selected model name.
In the top center, select the AI service to use in the Choose an AI service dropdown and press Enter.
In the top center, select the model version to use in the Choose model version dropdown and press Enter.
In the top center, select the deployment type to use in the Choose deployment type dropdown and press Enter.
In the top center, enter the model deployment name to use in the Enter deployment name textbox and press Enter.
A confirmation dialog box appears. Select the Deploy button to deploy the model to your project.
After a successful deployment, your model will be listed by deployment name with your other deployed models under the Models section in your project.
View deployed models
In the Azure Resources Extension view, select the caret icon in front of the Models section to view the list of deployed models.
The expanded Models section displays the list of deployed models.
View model card information
Selecting a deployed model opens up a panel that provides some basic information:
- Deployment Info: This section contains the information about the model:
- Name
- Provisioning state
- Deployment type
- Rate limit information
- Version info
- Model name
- Model version
- Endpoint info: This section contains the Target URI link, authentication type, and key.
- Useful links: This section contains the code sample repository and tutorial links to get started with AI application development.
Update a model
To update the model card information, select the Edit button on the top-right of the model card.
Update the desired editable fields such as rate limit directly within VS Code.
To save the changes, select the Save button on the top-right of the model card.
Explore the model sample code
Create a sample code file using the following steps.
Right-click on your deployed model and select the Open code file option.
In the top center, select your preferred SDK to use in the Choose preferred SDK dropdown and press Enter.
In the top center, select your preferred language to use in the Choose language dropdown and press Enter.
In the top center, select your preferred authentication method to use in the Choose authentication method dropdown and press Enter.
Sample code file
This Python sample code file that demonstrates a basic call to the chat completion API. The call is synchronous:
Interact with models using a model playground
Chat interactively with the model, change settings, and system instructions using the Model Playground.
The Model Playground is available in the Tools section of the Azure AI Foundry Extension view. Double-click on the Model Playground link to open the Model Playground.
You can also open the model playground using the following steps:
Right-click on your deployed model and select the Open in playground option.
The Playground page is displayed.
Type your prompt and see the outputs.
Additionally, you can use View code in the top-right corner to see details about how to access the model deployment programmatically.
Select the History link at the top-left of the playground to view the chat history.
Cleanup resources
The Azure resources that you created in this article are billed to your Azure subscription. If you don't expect to need these resources in the future, delete them to avoid incurring more charges.
Delete your models
In the VS Code navbar, refresh the Azure AI Foundry Extension. In the Resources section, expand the Models subsection to display the list of deployed models.
Right-click on your deployed model to delete and select the Delete option.
Delete your tools
Delete the connected tool with the following steps:
- Open the Azure portal
- Select the Azure Resource Group containing the tool.
- Select the Delete button.
Next steps
- Learn about working with the Azure AI Foundry Agent Service using this Visual Studio Code extension.