Edit

Share via


Get started with GitHub Copilot for Azure

Get started with GitHub Copilot for Azure to streamline your development workflow and enhance your productivity on the Azure platform. This guide walks you through the prerequisites and installation of the GitHub Copilot for Azure in Visual Studio, so you can write your first prompt.

Prerequisites

To complete the steps in this article, make sure that you have:

Important

GitHub Copilot is a separate subscription managed by GitHub. For questions regarding GitHub Copilot subscriptions and Support, see Getting started with a GitHub Copilot plan.

By default, Copilot in Azure is available to all users in a tenant. However, Global Administrators can manage access to Copilot in Azure for their organization. Access can also be optionally granted to specific Microsoft Entra users or groups. For more information, see Manage access to Microsoft Copilot in Azure.

Install GitHub Copilot for Azure

  1. In Visual Studio Code, select the Extensions icon.
  2. In the Extensions Marketplace, search for GitHub Copilot for Azure. When the GitHub Copilot for Azure extension appears, select Install.
  3. If you're prompted, sign in to your Azure account.

Write your first prompt

  1. Ensure that the extension is installed, that you're properly authenticated, and that the extension is working correctly.

  2. If the Chat window isn't already open, make sure it's open by either selecting the Toggle Chat button in the menu bar, or select the dropdown next to the Toggle Chat button and select Open Chat (Ctrl+Alt+I).

    Screenshot that shows the Toggle Chat menu open and selecting the Open Chat menu option.

  3. In the chat text area at the bottom of the chat pane, enter the following prompt:

    Do I have any Azure resources currently running?
    

    The answer to your question depends on what's currently running in Azure in your subscription.

  4. Next, use the following prompt:

    What are your tools?
    

    The completion response displays a list of GitHub Copilot for Azure specific tools available to GitHub Copilot. The response provides a good overview of the kinds of functionality now available to you:

    I'll ask the Azure development helper to recommend custom modes relevant to listing and explaining the GitHub Copilot for Azure tools in VS Code; expected outcome: a short set of recommended modes or tips to tailor the tools explanation.
    
    Progress update: I queried the Azure development helper to get recommended custom modes for this topic. Next, I'll list and briefly explain the tools I have available (grouped and with example prompts and common uses) so you can copy/paste or use them directly in VS Code.
    
    Tools I can use (concise overview)
    
    1. Search & navigation
    
       - Capabilities: semantic code/documentation search, file search with globs, text search (grep), list directory contents, read file contents, find usages/references.
       - Example prompts:
          - "Find all usages of MyService in this workspace."
          - "Search for connectionString in **/*.config files."
       - When to use: locating code, docs, or examples quickly inside your repo.
    
    2. Code editing & analysis
       - Capabilities: insert edits into files, create or modify files, suggest refactors, report code errors, find test files.
       - Example prompts:
          - "Add a function to validate input in src/utils.js."
          - "Refactor this function to use async/await and update its tests."
       - When to use: implementing features, fixing bugs, generating or updating code.
    
    3. Terminal & Git operations
    
       - Capabilities: run shell commands, read terminal output, show git diffs and changed files.
       - Example prompts:
          - "Run npm test and show me failing tests."
          - "Stage and commit the changes with message 'fix: update README'."
       - When to use: run builds/tests, inspect outputs, perform git workflows (if enabled).
    
    4. Project creation & workspace setup
    
       - Capabilities: create new workspaces, scaffold projects (templates), install VS Code extensions, create notebooks.
       - Example prompts:
          - "Generate a Node.js express app scaffold in a new folder."
          - "Add recommended extensions for Python development."
       - When to use: bootstrapping projects or adding project-level config.
    
    5. Web & API tools
    
       - Capabilities: fetch web pages, retrieve API docs (for example VS Code API references), gather remote content for research.
       - Example prompts:
          - "Fetch the Azure CLI docs for az storage account list."
          - "Get the VS Code extension API docs for commands."
       - When to use: look up official docs or examples during work.
    
    6. Azure-specific tools
    
       - Capabilities: Azure development best practices guidance, Microsoft Learn documentation lookup, query Azure Resource Graph (when authenticated), manage Azure auth context (change tenant, sign out), generate Azure CLI / Bicep / ARM snippets, Bicep schemas, and guidance for deploying models and services.
       - Example prompts:
          - "What are Azure best practices for deploying this function app?"
          - "@azure /changeTenant β€” set my default tenant to <tenant-id>"
          - "Generate a Bicep template for an App Service and a Storage Account."
       - When to use: any task that touches Azure resources, deployment, or configuration.
    
    7. Documentation & learning
    
       - Capabilities: search and extract Microsoft Learn articles, provide code samples from official docs, show relevant how-to steps.
       - Example prompts:
          - "Show official docs for configuring Key Vault access policies."
          - "Give me a short tutorial on using Azure App Configuration."
       - When to use: learn or reference official Microsoft guidance.
    
    How I present results
    
    - Short answers or step-by-step instructions.
    - Full edits (I can create or modify files if you allow the extension to act).
    - Commands and code snippets you can paste into your terminal.
    - Checks (like running tests or linters) when terminal access is allowed.
    
    Example: Quick copy-paste prompts you can use in the VS Code chat
    
    - "What are your tools?" β€” lists the tools (this reply).
    - "Find all TODO comments in this repo and open a summary."
    - "Generate an az CLI command to list storage accounts sorted by region."
    - "@azure /changeTenant" β€” opens tenant selection (if you need to set a default).
    
    Notes and privacy/permissions
    
    - Some capabilities (like querying your Azure resources or running commands) require you to be signed in and to enable those tools in the extension (you can enable/disable specific tools in the chat pane tool list).
    - I won't perform actions that need elevated permissions without verifying your explicit consent.
    
    If you'd like, I can:
    
    - Expand any tool section with more example prompts and exact commands.
    - Show a short step-by-step for enabling/disabling tools in the chat pane.
    - Generate a one-page cheatsheet you can paste into an internal docs file. Which would you like next?
    
    

    The contents of the reply may vary and can change over time as new capabilities and tools are added.

  5. To test out prompts about Azure-specific tooling, try the following prompt:

    What is the az command to list all my storage accounts ordered by location?
    

    The completion to that prompt might generate:

    
    I'll show the exact az CLI commands (sorted ascending/descending) plus a few useful output variants and a quick note about prerequisites.
    
    Commands
    
    - Sorted by location (ascending), full JSON:
    
       az storage account list --query "sort_by(@, &location)" -o json
    
    - Sorted by location, show only name and location in a readable table:
    
       az storage account list --query "sort_by(@, &location)[].[name,location]" -o table
    
    - Sorted by location (descending):
    
       az storage account list --query "reverse(sort_by(@, &location))" -o json
    
    - Sorted by location and include resource group and SKU in table:
    
       az storage account list --query "sort_by(@, &location)[].[name,resourceGroup,sku.name,location]" -o table
    
    Notes
    
    - Run az login first and ensure the correct subscription is selected (e.g., az account set -s "<subscription-id-or-name>").
    - You need permission to list storage accounts in the chosen subscription.
    - The query uses JMESPath (sort_by/reverse) to order results client-side.
    
    Would you like a version that groups counts by region or that queries across all subscriptions?
    
    

Enable and disable tools in agent mode

You might want to disable or re-enable certain tools available by GitHub Copilot for Azure.

  1. Select the tool icon in the chat pane.

    Screenshot of chat pane with highlight around the Configure Tools icon.

  2. Use the checkbox next to the list of tools to enable / disable tools (or groups of tools).

    Screenshot of the list of tools in Visual Studio Code.

Set your default tenant

If you have multiple Microsoft Entra ID tenants, You can set a default tenant using the following prompt:

@azure /changeTenant

Select from a list of your available tenants in the top center drop-down.

You can also set the default tenant in the extension settings:

  1. In Visual Studio Code, on the Activity Bar, select Extensions. Then scroll down to GitHub Copilot for Azure.

    Screenshot that shows GitHub Copilot for Azure in the list of extensions in Visual Studio Code.

  2. Select the gear icon in the corner of the extension's entry, and then select Settings from the pop-up menu.

    Screenshot that shows the pop-up menu for GitHub Copilot for Azure.

  3. On the Settings tab, set the Azure Resource Graph tenant to your Microsoft Entra tenant ID. You can find your Microsoft Entra tenant ID in the Azure portal.

    Screenshot that shows the Settings tab with an option to set the Azure Resource Graph tenant.

View the GitHub Copilot for Azure instructions file

The instructions file (also referred to as "Azure Copilot Guidelines") contains high-level guidance for GitHub Copilot that is added to the context window when sending prompts to GitHub Copilot for Azure tools and Azure MCP Server tools. The guidance in this file is intended to be global in nature, meaning, it's intended for all interactions across GitHub Copilot for Azure across all projects. This file is located in a hidden folder location and is not intended to be modified. You should not modify this file because it could degrade or disable GitHub Copilot for Azure, and your changes might be overwritten with new updates to GitHub Copilot for Azure.

Viewing the "Azure Copilot Guidelines" can provide an insight into how the GitHub Copilot for Azure tools and the Azure MCP Server tools are introduced to GitHub Copilot helping you develop a deeper understanding of how it all works.

Important

You should not modify this file.

  1. Select ctrl + shift + p to open the command palette.

  2. Type Chat: Configure Instructions and select the entry.

    Screenshot of typing in the Visual Studio Code command palette.

  3. In the next step, select AzureCopilotGuidelines .

    Screenshot of the option to select Azure Copilot Guidelines.

  4. A new tab opens containing the instructions file.

    Screenshot of the GitHub Copilot for Azure instructions file.

    Important

    You should not modify this file.

Prerequisites

Important

GitHub Copilot is a separate subscription managed by GitHub. For questions regarding GitHub Copilot subscriptions and Support, see Getting started with a GitHub Copilot plan.

Install GitHub Copilot for Azure

  1. In Visual Studio 2022, in the Extensions menu, select Manage Extensions.
  2. In the Extension Manager search for and select GitHub Copilot for Azure (VS 2022). Select the Install button.
  3. After a moment, you'll see a banner: "Your changes are scheduled. The modifications will begin when Microsoft Visual Studio is closed." Shut down Visual Studio.
  4. The VSIX Installer dialog opens confirming the installation. Select the Modify button.
  5. After a few moments, you should see "Modifications Complete". Select the Close button.
  6. Reopen Visual Studio 2022.
  7. Select the "GitHub Copilot" button in upper-right of window on the toolbar. Select Open Chat Window.
  8. When the GitHub Copilot Chat window appears, in the chat area at the bottom, select Agent mode, then select the Select tools button (two wrenches).
  9. In the Select tools dialog, you should see "Azure MCP Server". To the right, you see "0/153" if no tools are selected (which is currently the default). Select the parent node to choose all of the tools.

Important

If you do not see "Azure MCP Server" in the list of tools, you may need to uninstall and re-install the extension.

Write your first prompt

  1. If the Chat window isn't already open, make sure it's open by selecting the View > GitHub Copilot Chat menu option. You should see chat window docked to the right side by default.

    Screenshot that shows the GitHub Copilot Chat window in Visual Studio 2022.

  2. In the chat text area at the bottom of the chat pane, enter the following prompt:

    Do I have any resources currently running?
    

    Screenshot that shows an example prompt typed into the chat area in Visual Studio 2022.

By default, GitHub Copilot uses ask mode. Ask mode provides answers to your prompts in the chat pane. Agent mode enables GitHub Copilot to take action in your workspace.

The answer to your question depends on what's currently running in Azure in your subscription.

Agent mode

In Agent mode, GitHub Copilot can perform tasks across your entire Visual Studio workspace, making edits, executing terminal commands, and so on.

GitHub Copilot for Azure provides "tools" to GitHub Copilot to enhance the agentic experience through deep integration with Azure.

To switch, between ask and agent mode, select the down chevron next to the Ask option in the chat area and select the desired mode.

Screenshot that shows the mode menu in the chat area in Visual Studio 2022.

Enable and disable tools in agent mode

You might want to disable or re-enable certain tools available by GitHub Copilot for Azure.

  1. Select the "Select tools" icon in the chat pane.

    Screenshot of chat pane with the select tools button clicked in Visual Studio 2022.

  2. Use the checkbox next to the list of tools to enable / disable tools (or groups of tools).

Prerequisites

Important

GitHub Copilot is a separate subscription managed by GitHub. For questions regarding GitHub Copilot subscriptions and Support, see Getting started with a GitHub Copilot plan.

Install GitHub Copilot for Azure

  1. If you already installed Visual Studio 2026 and want to add GitHub Copilot for Azure after initial install, open Visual Studio Installer and select the Modify button, which displays the available workloads.

    Screenshot that shows the Visual Studio Installer with the Modify button highlighted.

    If you're installing Visual Studio 2026 for the first time, the Visual Studio Installer automatically displays the available workloads.

  2. β€―On the Workloads tab, make sure "Azure AI development" is selected.

    Screenshot that shows the Visual Studio Installer's available workloads with the Azure AI development option selected and highlighted.

  3. Select the Install button to complete the installation.

  4. Launch Visual Studio 2026 and create or load a project.

  5. Open GitHub Copilot Chat.

  6. If prompted, sign in to your GitHub account.

  7. If prompted, sign in to your Azure account.

  8. In the chat area, select the Select tools button (two wrenches icon) to display a list of available tools. Enable all Azure tools by checking the top nodes for Azure.

    Screenshot that shows the select tools dialog with the Azure node checked.

    Also select the top node for Azure MCP Server.

    Screenshot that shows the select tools dialog with the Azure MCP Server node checked.

Write your first prompt

  1. If the Chat window isn't already open, make sure it's open by selecting the View > GitHub Copilot Chat menu option. You should see chat window docked to the right side by default.

    Screenshot that shows the GitHub Copilot Chat window in Visual Studio 2026.

  2. In the chat text area at the bottom of the chat pane, enter the following prompt:

    Do I have any resources currently running?
    

    Screenshot that shows an example prompt typed into the chat area in Visual Studio 2026.

By default, GitHub Copilot uses ask mode. Ask mode provides answers to your prompts in the chat pane. Agent mode enables GitHub Copilot to take action in your workspace.

The answer to your question depends on what's currently running in Azure in your subscription.

Agent mode

In Agent mode, GitHub Copilot can perform tasks across your entire Visual Studio workspace, making edits, executing terminal commands, and so on.

GitHub Copilot for Azure provides "tools" to GitHub Copilot to enhance the agentic experience through deep integration with Azure.

To switch, between ask and agent mode, select the down chevron next to the Ask option in the chat area and select the desired mode.

Screenshot that shows the mode menu in the chat area in Visual Studio 2026.

Enable and disable tools in agent mode

You might want to disable or re-enable certain tools available by GitHub Copilot for Azure.

  1. Select the "Select tools" icon in the chat pane.

    Screenshot of chat pane with the select tools button clicked in Visual Studio 2026.

  2. Use the checkbox next to the list of tools to enable / disable tools (or groups of tools).