Azure用GitHub Copilotの使い始め方

AzureのGitHub Copilotを使用して、開発ワークフローを合理化し、Azure プラットフォームの生産性を向上させます。 このガイドでは、最初のプロンプトを記述できるように、Visual StudioでのAzureのGitHub Copilotの前提条件とインストールについて説明します。

前提条件

この記事の手順を完了するには、次の項目があることを確認します。

  • Azure アカウントと、Azure サブスクリプションへのアクセス。 設定方法の詳細については、Azure アカウントのpricing ページを参照してください。

  • GitHub アカウントとGitHub Copilot サブスクリプション。 設定方法の詳細については、「>アカウントをGitHubで作成する」および「GitHub Copilot のQuickstart」を参照してください。

  • Visual Studio Code。 ダウンロードしてインストールする方法の詳細については、 Visual Studio Code

  • GitHub Copilot拡張機能とGitHub Copilot チャット拡張機能。 これらの拡張機能をインストールする方法については、「 VS Code でのGitHub Copilotの設定 VS Code でのGitHub Copilotチャットの概要をそれぞれ参照してください。

重要

GitHub Copilotは、GitHubによって管理される個別のサブスクリプションです。 GitHub Copilot サブスクリプションとサポートに関する質問については、「 GitHub Copilot プランの概要を参照してください。

既定では、Azure内のCopilotは、テナント内のすべてのユーザーが使用できます。 ただし、グローバル管理者は、組織のAzureでCopilotへのアクセスを管理できます。 必要に応じて、特定のMicrosoft Entraユーザーまたはグループにアクセス権を付与することもできます。 詳細については、「 Azure のMicrosoft Copilotへのアクセスの管理」を参照してください。

AzureのGitHub Copilotをインストールする

  1. Visual Studio Codeで、Extensions アイコンを選択します。
  2. Extensions Marketplace で、GitHub Copilot で Azure を検索します。 Azure拡張機能のGitHub Copilotが表示されたら、Install を選択します。
  3. メッセージが表示されたら、Azure アカウントにサインインします。

最初のプロンプトを記述する

  1. 拡張機能がインストールされていること、正しく認証されていること、拡張機能が正しく動作していることを確認します。

  2. チャット ウィンドウがまだ開いていない場合は、メニュー バーの [チャットの切り替え ] ボタンを選択するか、[ チャットの切り替え ] ボタンの横にあるドロップダウンを選択して [チャットを開く] (Ctrl + Alt + I) を選択して開いていることを確認します。

    [チャットの切り替え] メニューが開き、[チャットを開く] メニュー オプションを選択していることを示すスクリーンショット。

  3. チャット ウィンドウの下部にあるチャット テキスト領域に、次のプロンプトを入力します。

    Do I have any Azure resources currently running?
    

    質問に対する回答は、サブスクリプションのAzureで現在実行されている内容によって異なります。

  4. 次に、次のプロンプトを使用します。

    What are your tools?
    

    完了応答には、Azure向けGitHub Copilotに特化したツール一覧が表示されます。 応答では、現在使用できる機能の種類の概要を示します。

    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?
    
    

    新しい機能とツールが追加されると、応答の内容が変わる可能性があり、時間の経過と伴って変化する可能性があります。

  5. Azure固有のツールに関するプロンプトをテストするには、次のプロンプトを試してください。

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

    そのプロンプトの入力が完了すると、次のことが生成される場合があります。

    
    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?
    
    

エージェント モードでツールを有効または無効にする

AzureのGitHub Copilotで使用できる特定のツールを無効にするか、再度有効にしたい場合があります。

  1. チャット ウィンドウでツール アイコンを選択します。

    [ツールの構成] アイコンが強調表示されているチャット ウィンドウのスクリーンショット。

  2. ツールの一覧の横にあるチェック ボックスを使用して、ツール (またはツールのグループ) を有効または無効にします。

    Visual Studio Code のツール一覧のスクリーンショット。

既定のテナントを設定する

複数の Microsoft Entra ID テナントがある場合は、次のプロンプトを使用して既定のテナントを設定できます。

@azure /changeTenant

上部のセンター のドロップダウンで、使用可能なテナントの一覧から選択します。

拡張機能の設定で既定のテナントを設定することもできます。

  1. Visual Studio Codeのアクティビティ バーで、Extensions を選択します。 その後、GitHub Copilot for Azureまでスクロールします。

    Visual Studio Code の拡張機能一覧で Azure 用 GitHub Copilot を示すスクリーンショット。

  2. 拡張機能のエントリの隅にある歯車アイコンを選択し、ポップアップ メニューから Settings を選択します。

    GitHub Copilot for Azure のポップアップ メニューを示すスクリーンショット

  3. Settings タブで、Azure Resource Graph テナントを Microsoft Entra テナント ID に設定します。 Microsoft Entra テナント ID は、Azure ポータルで確認できます。

    Azure Resource Graph テナントを設定するオプションを含む [設定] タブを示すスクリーンショット

Azure用GitHub Copilotの手順ファイルを表示する

instructions ファイル ("Azure Copilot ガイドライン" とも呼ばれます) には、Azure ツールと Azure MCP サーバー ツールのGitHub Copilotにプロンプトを送信するときにコンテキスト ウィンドウに追加されるGitHub Copilotの概要ガイダンスが含まれています。 このファイルのガイダンスは、すべてのプロジェクトにおけるAzure用GitHub Copilotのすべての相互作用に意図的にグローバルな視点を持たせています。 このファイルは隠しフォルダーの場所にあり、変更を意図していません。 このファイルは、AzureのGitHub Copilotが低下または無効化される可能性があり、AzureのGitHub Copilotに対する新しい更新で変更が上書きされる可能性があるため、このファイルを変更しないでください。

「Azure Copilot ガイドライン」を参照することで、Azure 向けGitHub CopilotとAzure MCP Server ツールがどのようにGitHub Copilotとして導入されているかを把握するのに役立ち、そのすべてがどのように機能するかを深く理解する手助けになります。

重要

このファイルは変更しないでください。

  1. ctrl + shift + p選択してコマンド パレットを開きます。

  2. Chat: Configure Instructions入力し、エントリを選択します。

    Visual Studio Code コマンド パレットでの入力のスクリーンショット.

  3. 次の手順で、[ AzureCopilotGuidelines ] を選択します。

    Azure コパイロット ガイドラインを選択するオプションのスクリーンショット

  4. 命令ファイルを含む新しいタブが開きます。

    Azure用GitHub Copilotの手順ファイルのスクリーンショット

    重要

    このファイルは変更しないでください。

前提条件

  • Azure アカウントと、Azure サブスクリプションへのアクセス。 設定方法の詳細については、Azure アカウントのpricing ページを参照してください。

  • GitHub アカウントとGitHub Copilot サブスクリプション。 設定方法の詳細については、「>アカウントをGitHubで作成する」および「GitHub Copilot のQuickstart」を参照してください。

  • Visual Studio 2022 (任意のエディション)。 ダウンロードしてインストールする方法の詳細については、「Install Visual Studioを参照してください。

重要

GitHub Copilotは、GitHubによって管理される個別のサブスクリプションです。 GitHub Copilot サブスクリプションとサポートに関する質問については、「 GitHub Copilot プランの概要を参照してください。

AzureのGitHub Copilotをインストールする

Azure MCP は、Visual Studio 2022 に組み込まれています。 Azure MCP ツールにアクセスするには、Azure開発ワークロードがインストールされている必要があります。

  1. 2022 Visual Studioインストール済みで、初期インストール後にAzureのGitHub Copilotを追加する場合は、Visual Studio インストーラーを開き、使用可能なワークロードを表示する Modify ボタンを選択します。

    変更ボタンが強調表示されたVisual Studioインストーラーを示すスクリーンショット。

    Visual Studio 2022 を初めてインストールする場合は、Visual Studio インストーラーに使用可能なワークロードが自動的に表示されます。

  2. [ワークロード] タブで、Azure 開発 ワークロードが選択されていることを確認します。

    Azure開発ボタンが強調表示されたVisual Studioインストーラーを示すスクリーンショット。

  3. [ インストール ] ボタンを選択してインストールを完了します。

  4. 2022 Visual Studio起動し、プロジェクトを作成または読み込みます。

  5. GitHub Copilot Chatを開きます。

  6. メッセージが表示されたら、GitHub アカウントにサインインします。

  7. メッセージが表示されたら、Azure アカウントにサインインします。

  8. チャット領域で、[ツールの選択] ボタン (2 つのレンチ アイコン) を選択して、使用可能なツールの一覧を表示します。 Azure MCP Server v.x.x.x の最上位ノードをチェックして、すべてのAzure ツールを有効にします。

    Azure MCP サーバーノードが選択された選択ツールのダイアログを示すスクリーンショット

Azure MCP ツールは、Visual Studio 2022 では既定で無効になっており、使用する前に手動で有効にする必要があります。 Visual Studio 2026 で使用できる VS 固有のツールは、Visual Studio 2022 には含まれていません。

最初のプロンプトを記述する

  1. チャット ウィンドウがまだ開いていない場合は、View>GitHub Copilot Chat メニュー オプションを選択して開いていることを確認します。 既定では、右側にドッキングされたチャット ウィンドウが表示されます。

    Visual Studio 2022 の GitHub Copilot チャットウィンドウを示すスクリーンショット

  2. チャット ウィンドウの下部にあるチャット テキスト領域に、次のプロンプトを入力します。

    Do I have any resources currently running?
    

    Visual Studio 2022 のチャット領域に入力されたプロンプトの例を示すスクリーンショット

既定では、GitHub Copilotは ask モードを使用します。 Ask モードでは、チャット ウィンドウのプロンプトに対する回答が表示されます。 Agent モードを使用すると、ワークスペースでGitHub Copilotがアクションを実行できます。

質問に対する回答は、サブスクリプションのAzureで現在実行されている内容によって異なります。

エージェント モード

エージェント モードでは、GitHub Copilotは、Visual Studio ワークスペース全体でタスクを実行したり、編集を行したり、ターミナル コマンドを実行したりできます。

Azure 用 GitHub Copilot が、Azure との密接な統合を通じてエージェント体験を向上させるためのツールを GitHub Copilot に提供します。

Ask モードとエージェント モードを切り替えるには、チャット領域の Ask オプションの横にある下向きのシェブロンを選択し、目的のモードを選択します。

Visual Studio 2022 のチャット領域にあるモードメニューを示すスクリーンショット

エージェント モードでツールを有効または無効にする

AzureのGitHub Copilotで使用できる特定のツールを無効にするか、再度有効にしたい場合があります。

  1. チャット ウィンドウで [ツールの選択] アイコンを選択します。

    Visual Studio 2022 のチャット ウィンドウで [ツールの選択] ボタンがクリックされた状態のスクリーンショット

  2. ツールの一覧の横にあるチェック ボックスを使用して、ツール (またはツールのグループ) を有効または無効にします。

前提条件

  • Azure アカウントと、Azure サブスクリプションへのアクセス。 設定方法の詳細については、Azure アカウントのpricing ページを参照してください。

  • GitHub アカウントとGitHub Copilot サブスクリプション。 設定方法の詳細については、「>アカウントをGitHubで作成する」および「GitHub Copilot のQuickstart」を参照してください。

  • Visual Studio 2026 (任意のエディション)。 ダウンロードしてインストールする方法の詳細については、「Install Visual Studioを参照してください。

重要

GitHub Copilotは、GitHubによって管理される個別のサブスクリプションです。 GitHub Copilot サブスクリプションとサポートに関する質問については、「 GitHub Copilot プランの概要を参照してください。

AzureのGitHub Copilotをインストールする

  1. 2026 Visual Studioインストール済みで、初期インストール後にAzureのGitHub Copilotを追加する場合は、Visual Studio インストーラーを開き、使用可能なワークロードを表示する Modify ボタンを選択します。

    変更ボタンが強調表示されたVisual Studioインストーラーを示すスクリーンショット。

    Visual Studio 2026 を初めてインストールする場合は、Visual Studio インストーラーに使用可能なワークロードが自動的に表示されます。

  2.  [ワークロード] タブで、[Azure AI 開発] が選択されていることを確認します。

    Azure AI 開発オプションが選択され強調表示されているVisual Studio インストーラーの使用可能なワークロードを示すスクリーンショット。

  3. [ インストール ] ボタンを選択してインストールを完了します。

  4. 2026 Visual Studio起動し、プロジェクトを作成または読み込みます。

  5. GitHub Copilot Chatを開きます。

  6. メッセージが表示されたら、GitHub アカウントにサインインします。

  7. メッセージが表示されたら、Azure アカウントにサインインします。

  8. チャット領域で、[ ツールの選択 ] ボタン (2 つのレンチ アイコン) を選択して、使用可能なツールの一覧を表示します。 Azureの最上位ノードをチェックして、すべてのAzureツールを有効にします。

    Azure ノードが選択されている選択ツール ダイアログを示すスクリーンショット

    また、Azure MCP サーバーの最上位ノードを選択します。

    Azure MCP サーバーノードが選択された選択ツールのダイアログを示すスクリーンショット

最初のプロンプトを記述する

  1. チャット ウィンドウがまだ開いていない場合は、View>GitHub Copilot Chat メニュー オプションを選択して開いていることを確認します。 既定では、右側にドッキングされたチャット ウィンドウが表示されます。

    Visual Studio 2026 での GitHub Copilot Chat ウィンドウを示すスクリーンショット

  2. チャット ウィンドウの下部にあるチャット テキスト領域に、次のプロンプトを入力します。

    Do I have any resources currently running?
    

    Visual Studio 2026 のチャット領域に入力されたプロンプトの例を示すスクリーンショット

既定では、GitHub Copilotは ask モードを使用します。 Ask モードでは、チャット ウィンドウのプロンプトに対する回答が表示されます。 Agent モードを使用すると、ワークスペースでGitHub Copilotがアクションを実行できます。

質問に対する回答は、サブスクリプションのAzureで現在実行されている内容によって異なります。

エージェント モード

エージェント モードでは、GitHub Copilotは、Visual Studio ワークスペース全体でタスクを実行したり、編集を行したり、ターミナル コマンドを実行したりできます。

Azure 用 GitHub Copilot が、Azure との密接な統合を通じてエージェント体験を向上させるためのツールを GitHub Copilot に提供します。

Ask モードとエージェント モードを切り替えるには、チャット領域の Ask オプションの横にある下向きのシェブロンを選択し、目的のモードを選択します。

Visual Studio 2026 のチャット領域におけるモードメニューを示すスクリーンショット

エージェント モードでツールを有効または無効にする

AzureのGitHub Copilotで使用できる特定のツールを無効にするか、再度有効にしたい場合があります。

  1. チャット ウィンドウで [ツールの選択] アイコンを選択します。

    Visual Studio 2026 のチャット ウィンドウで、[ツールの選択] ボタンがクリックされた状態のスクリーンショット>

  2. ツールの一覧の横にあるチェック ボックスを使用して、ツール (またはツールのグループ) を有効または無効にします。