Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Getting Started with GitHub Copilot for Azure

Unlock a more efficient workflow and boost your productivity with GitHub Copilot for Azure Preview. This quick-start guide takes you through everything you need to know, from preparing the prerequisites to installing the GitHub Copilot for Azure extension in Visual Studio Code. By the end, you’ll be equipped to craft your first prompt and fully leverage the Azure platform’s potential.
Unlock a more efficient workflow and boost your productivity with GitHub Copilot for Azure and Azure MCP. This quick-start guide takes you through everything you need to know, from preparing the prerequisites to installing the GitHub Copilot for Azure and Azure MCP extensions in Visual Studio Code. By the end, you’ll be equipped to craft your first prompt and fully leverage the Azure platform’s potential.


</header>
Expand All @@ -11,7 +11,7 @@ Unlock a more efficient workflow and boost your productivity with GitHub Copilot


## Prerequisite reading:
- [What is GitHub Copilot for Azure Preview?](https://learn.microsoft.com/azure/developer/github-copilot-azure/introduction)
- [What is GitHub Copilot for Azure?](https://learn.microsoft.com/azure/developer/github-copilot-azure/introduction)


## 👉 Prerequisites
Expand All @@ -38,15 +38,15 @@ To complete the steps in this lab, make sure that you have:

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming)

1. Upon opening VS Code, in the right hans side, click **"Sign in with a GitHub.com account"**.
1. Upon opening VS Code, in the right hand side, click **"Sign in with a GitHub.com account"**.

1. Visual Studio Code will pop up a message asking **"The extension 'GitHub Copilot Chat' wants to sign in using GitHub."** Click **Allow**.

1. You will need to authorize Visual Studio Code to continue with the user signed in. Click the **Continue** button.

1. And complete the authorization by clicking the **Authorize Visual-Studio-Code** button.

1. A popup message will ask to open VS Code. Click **Open**. you will be returned to VS Code, you will be authenticated to GitHub and will have access to **GitHub Copilot**.
1. A popup message will ask to open VS Code. Click **Open**. you will be returned to VS Code, you will be authenticated to GitHub and will have access to **GitHub Copilot**.


1. In Visual Studio Code, select the **Extensions** icon.
Expand All @@ -63,30 +63,30 @@ To complete the steps in this lab, make sure that you have:

### ✍️ Step 2: Write your first prompt

1. Now that the extensions are installed, that you're properly authenticated, and that the extension is working correctly.
Now, let's verify that the extensions are installed, that you're properly authenticated, and that the extensions are working correctly.

1. On the Activity Bar, select the **Chat** icon if the **Ask Copilot** pane is closed.

1. In the chat text area at the bottom of the chat pane, enter the following prompt:
1. In the chat text area at the bottom of the chat pane, enable **Agent** mode, set the Model to *Claude Sonnet 4* or *GPT-5*, then enter the following prompt:

```prompt
@azure Do I have any resources currently running?
Do I have any Azure resources currently running?
```
> In the next section you will be asked to authorize applications and services multiple times. This is for your protection and will only be done once. We are authorizing **GitHub**, **VS Code** and **Azure** to trust the prompts with the credentials supplied.
> In the next section you will be asked to authorize applications and services multiple times. This is for your protection and will only be done once. We are authorizing **GitHub**, **VS Code** and **Azure** to trust the prompts with the credentials supplied.

1. You might get a message in the GitHub Copilot Chat pane that states "you need to sign in your Microsoftaccount to use GitHub Copilot for Azure (@Azure)".
1. You might get a message in the GitHub Copilot Chat pane that states "you need to sign in your Microsoft account to use GitHub Copilot for Azure (@Azure)".

1. If you do, click the link in the **"Already have an account? Sign in"** line.
1. Visual Studio Code will pop up a message asking **"The extension 'GitHub Copilot for Azure' wants to sign in using Microsoft."** Click **Allow**.
1. login using the credentials in the existing session, or the credentials found in the Resource Tab of the lab instructions. The same credential as the Azure subscriptions.
1. Close the tab. Not the browser.
1. Login using the credentials in the existing session, or the credentials found in the Resource Tab of the lab instructions. The same credential as the Azure subscriptions.
1. Close the tab. Not the browser.
1. Return to VS Code. Visual Studio Code will pop up a message asking **"The extension 'GitHub Copilot for Azure' wants to access the language models provided by GitHub Copilot Chat."** Click **Allow**.
1. Visual Studio Code will pop up another message asking **"The extension 'GitHub Copilot for Azure' wants to sign in using GitHub."** Click **Allow** again.
1. You will need to authorize Visual Studio Code to continue with the user signed in. Click the **Continue** button
1. You will need to authorize Visual Studio Code to continue with the user signed in. Click the **Continue** button.
1. Complete the authorization by clicking the **Authorize Visual-Studio-Code** button.
1. A popup message will ask to open VS Code. Click **Open**. you will be returned to VS Code, you will be authenticated to GitHub and will have access to **GitHub Copilot**.
1. A popup message will ask to open VS Code. Click **Open**. You will be returned to VS Code, you will be authenticated to GitHub and will have access to **GitHub Copilot**.

1. The Copilot for Azure extension will query the Azure Resource graph, provide you with the resource query and provide the answer. Which at this point should be **You currently do not have any running resources across all your subscriptions.**
1. The GitHub Copilot for Azure extension tools will query the Azure Resource graph, provide you with the resource query and provide the answer. Which at this point should be **You currently do not have any running resources across all your subscriptions.**

### Conclusion

Expand Down
Original file line number Diff line number Diff line change
@@ -1,63 +1,57 @@
# Build and deploy your application with GitHub Copilot for Azure
# Build and deploy your application with GitHub Copilot for Azure and Azure MCP

This module is a continuation of module 1 and provides a step-by-step guide on using GitHub Copilot for Azure Preview to create and deploy a new website in Azure.
This module is a continuation of module 1 and provides a step-by-step guide on using GitHub Copilot for Azure and Azure MCP to create and deploy a new website in Azure.

It highlights an approach to seamlessly integrating GitHub Copilot for Azure into your development and deployment workflow.
It highlights an approach to seamlessly integrating the extensions and their tools into your development and deployment workflow.

## Prerequisites

Completion of [Module 1 - Getting Started to use GitHub Copilot for Azure](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/09-Using-GitHub-Copilot-for-Azure-to-Deploy-to-Cloud/01-Getting-Started-with-GitHub-Copilot-for-Azure.md)

## Create and deploy a website by using GitHub Copilot for Azure Preview
## Create and deploy a website by using GitHub Copilot for Azure and Azure MCP

1. Create a new folder on your local computer where you can create a local clone of a GitHub repository.
1. In VS Code click **File**, Then **Open Folder**
1. in the **Open Folder** dialogue box, click **New Folder**, Give the folder a name, select it, then click **Select Folder**
1. In VS Code click **File**, then **Open Folder**.
1. In the **Open Folder** dialogue box, click **New Folder**, give the folder a name, select it, then click **Select Folder**.

1. VS Code will ask you **Do you trust the Authors of the files in this folder?**
1. click the **Yes, I trust the authors**
1. VS Code will ask you **Do you trust the authors of the files in this folder?**
1. click the **Yes, I trust the authors**.

1. In Visual Studio Code, select **View** > **Terminal**. On the terminal pane, go to the new folder.

1. On the status Bar, select the **Chat** (GitHub) icon to open the chat pane.
1. On the status bar, select the **Chat** (GitHub) icon to open the chat pane.

1. Start a new chat session by selecting the plus icon (**+**) on the pane's title bar.

![Screenshot that shows the GitHub Copilot chat pane](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/images/mod2-CopilotChat.png "Start a new chat session")

> If you closed the GitHub Copilot Chat after the last Module, click the GitHub icon in the status bar. Bottom-right of your VS Code screen. And select **"GitHub Copilot Chat"** in the option menu.
>
> ![Screenshot that shows the GitHub Copilot chat pane](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/images/mod2-CopilotChat-2.png "Start a new chat session")

6. In the chat text box, type the following prompt. Then select **Send** (paper airplane icon) or select Enter on your keyboard.
1. In the chat text box, type the following prompt. Then select **Send** (paper airplane icon) or select Enter on your keyboard.

```prompt
@azure Could you help me create and deploy a simple Flask website by using Python?
Help me create a simple Flask website using Python and deploy it to Azure
```

> **IMPORTANT**
The exact wording of the response is different each time GitHub Copilot for Azure answers, due to how large language models generate responses.

After a moment, GitHub Copilot for Azure likely suggests an `azd` template to use. Or in some cases will provide an answer like the following:
The exact wording of the response is different each time Copilot answers, due to how large language models generate responses.

![Screenshot that shows the GitHub Copilot chat pane](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/images/mod2-CopilotChat-3.png "Screenshot that shows a response from GitHub Copilot for Azure with instructions for using a template to create a website in Azure.")
After a moment, Copilot may suggest starting with an `azd` template or may start building the application from scratch.

Just Remember that the Large Language Model will understand what you tell it. Therefore, just have the conversation with it.
Just Remember that the Large Language Model will understand what you tell it. Therefore, just have the conversation with it.

1. If the answer provides a command that begins with `azd init` in a code fence, hover over the code fence to reveal a small pop-up action menu.
1. If the response provides a command that begins with `azd init` in a code fence and Copilot doesn't offer to run the command for you, hover over the code fence to reveal a small pop-up action menu.

![Screenshot that shows the GitHub Copilot chat pane](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/images/mod2-CopilotChat-4.png "Screenshot that shows a pop-up menu with an option to insert a code-fenced command into the Visual Studio Code terminal.")

Select **Insert into Terminal** to insert the command into the terminal.

![Screenshot that shows the GitHub Copilot chat pane](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/images/mod2-CopilotChat-5.png "Screenshot that shows the Visual Studio Code terminal after insertion of a code-fenced command.")

1. Before you run the `azd init` command, you might have questions about how it affects your local computer and your Azure subscription.
1. Before you run the `azd init` command or allow Copilot to run it for you, you might have questions about how it affects your local computer and your Azure subscription.

Use the following prompt:

```prompt
@azure Before I execute azd init, what does it do?
Before I execute azd init, what does it do?
```

You might see a response that resembles the following screenshot.
Expand All @@ -67,7 +61,7 @@ The exact wording of the response is different each time GitHub Copilot for Azur
1. Use the following prompt to learn more about the `azd` template:

```prompt
@azure What resources are created with this template?
What resources are created with this template?
```

You might see a response that resembles the following screenshot.
Expand All @@ -77,48 +71,48 @@ The exact wording of the response is different each time GitHub Copilot for Azur
1. Ask questions about the services that the template uses with a prompt like:

```prompt
@azure What is the purpose of a virtual network?
What is the purpose of a virtual network?
```

You might see a response that resembles the following screenshot.

![Screenshot that shows the GitHub Copilot chat pane](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/images/mod2-CopilotChat-8.png "Screenshot that shows a response from GitHub Copilot for Azure with an explanation of what a virtual network is.")

1. When you're satisfied, run the `azd init` command in the terminal. Answer its prompts. If you're unsure what to answer for a prompt, ask GitHub Copilot for Azure for help.
1. When you're satisfied, run the `azd init` command. Answer its prompts. If you're unsure what to answer for a prompt, ask Copilot for help.

1. Before you can continue, you must authenticate the `azd` tool by running in the terminal, the following command:

```cmd
azd auth login
```

1. This will open a browser that will require you to authenticate to Azure. select the same credentials as before.
1. This will open a browser that will require you to authenticate to Azure. Select the same credentials as before.

1. Once the new project is initialized,and that you've authenticated to Azure, use **azd up** command to deploy the application to your subscription. In the terminal, run the command according to the instructions in the original prompt's reply.
1. Once the new project is initialized and you've authenticated to Azure, use the `azd up` command to deploy the application to your subscription. In the terminal, run the command according to the instructions in the original prompt's reply or let Copilot run it for you if prompted.

```
azd up
```

1. The `azd up` command asks for information about your subscription, where to deploy the resources, and more.

If you're uncertain how to answer, you can ask GitHub Copilot for Azure for help. For example, you might ask:
If you're uncertain how to answer, you can ask Copilot for help. For example, you might ask:

```prompt
@azure azd up is asking me what location I want to deploy the website into. How should I respond?
azd up is asking me what location I want to deploy the website into. How should I respond?
```

You might see a response that resembles the following screenshot.

![Screenshot that shows the GitHub Copilot chat pane](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/images/mod2-CopilotChat-9.png "Screenshot that shows a response from GitHub Copilot for Azure with an answer that describes what the Azure locations are and how to choose one.")

5. Continue to answer prompts from `azd up`. Ask GitHub Copilot for Azure questions as needed.
5. Continue to answer prompts from `azd up`. Ask Copilot more questions as needed.

1. When asked the location select **Canada Central**.

Depending on the `azd` template that you're deploying and the location that you selected, the template might take 20 to 40 minutes (or more) to deploy. But we can Move on to [Module 3](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/09-Using-GitHub-Copilot-for-Azure-to-Deploy-to-Cloud/03-Get-Answers-to-your-Questions-about-Azure-Services-and-Resources.md) while it completes

1. If `azd up` experiences an error, ask GitHub Copilot for Azure about the error and how you can resolve it.
1. If `azd up` experiences an error, ask Copilot about the error and how you can resolve it.

> **TIP**
> For an easy way to attach the last terminal command results, use the paperclip icon at the bottom left of the chat pane. GitHub Copilot for Azure doesn't know the terminal command results unless they are copy/pasted or attached via the paperclip.
Loading