Blog Post

Educator Developer Blog
5 MIN READ

Getting Started with GitHub Copilot for Azure

Sharda_Kaur's avatar
Sharda_Kaur
Brass Contributor
Nov 11, 2024

As students dive into the world of cloud development, leveraging tools like GitHub Copilot for Azure can significantly enhance their learning and productivity. This blog will guide you through how to get started with GitHub Copilot for Azure, focusing on its key features that can help streamline your development process.

What is GitHub Copilot for Azure?

  1. Personal Assistant: GitHub Copilot for Azure acts as a personal assistant, helping you navigate the Azure cloud environment directly from your IDE.
  2. Integrated Experience: It integrates seamlessly with GitHub Copilot Chat in Visual Studio Code, allowing you to interact with Azure services without constantly switching between your IDE and the Azure portal.

Key Features to Explore

  1. Discovering Azure Services and AI Templates: Students can easily discover which Azure services are suitable for their projects. For example, if you want to deploy containers, GitHub Copilot can guide you through selecting the right service and provide sample commands. https://aka.ms/GetGitHubCopilotForAzure
  2. Deploying to Azure with Context: When working on a project (like a Django app), you can provide context and receive tailored commands and documentation to deploy your application efficiently.
  3. Understanding and Managing AI Models in Azure: For students interested in AI, GitHub Copilot can help explore available Azure AI services and manage models, making it easier to integrate advanced features into your applications.
  4. Exploring Azure Resources: Use natural language queries to explore your Azure resources. This feature is particularly useful for students managing multiple subscriptions and resources.
  5. Planning a Migration to Azure: If you're looking to migrate an application or database to Azure, GitHub Copilot can suggest services and tools, and help you create a detailed migration plan.
  6. Deploying to Azure Kubernetes Service: Students can learn to deploy containerized applications on Azure Kubernetes Service without leaving their editor, simplifying the learning curve associated with Kubernetes.

How to Get Started

  1. Install Visual Studio Code: Ensure you have Visual Studio Code installed on your machine.

 

  1. Download GitHub Copilot for Azure: Visit the VS Code Marketplace to download and install the extension.

 

  1. Utilize the Chat Feature: Start using the azure command in GitHub Copilot Chat to ask questions and get assistance on Azure-related tasks.

 

 

  1. Experiment with Features: Explore the six must-try features mentioned above to familiarize yourself with how GitHub Copilot can assist you in your projects.

Step-by-Step Guide to Experimenting with GitHub Copilot Features

Step 1: Set Up GitHub Copilot

Install GitHub Copilot:

1)    Ensure you have GitHub Copilot installed in your code editor (e.g., Visual Studio Code).

2)    If you haven’t installed it yet, go to the Extensions Marketplace and search for "GitHub Copilot" to install it.

3)    Sign In Log in with your GitHub account to activate Copilot.

 

 

Step 2: Explore the Must-Try Features

Here are six features you might want to explore. You can take notes or screenshots as you go along.

1)    Code Suggestions

  • Start typing a function or a comment about what you want to achieve.
  • Observe how Copilot suggests code completions.
  • Example: Type function calculateSum(and see how it suggests the rest of the function.

 

2)    In-line Code Completions:

  • As you write code, pay attention to the suggestions that appear in a line.
  • Accept or modify the suggestions based on your requirements.
  • Example: If you type a variable name, Copilot may suggest its type or usage.

 

3)    Multi-line Code Generation:

  • Write a comment describing a complex function you want to create.
  • See if Copilot can generate the entire function based on your comment.
  • Example: Type // Function to sort an array of numbers and check the generated code.

 

4)    Natural Language Queries:

  • Ask questions in natural language directly in your code comments.
  • Copilot can interpret these and provide code snippets.
  • Example: Type // How to reverse a string in JavaScript? and see what it generates.

 

5)    Refactoring Suggestions:

  • After writing some code, ask Copilot to help refactor it.
  • You can add comments like // Refactor this code to see how it suggests improvements.
  • Example: Write a function and then request a more efficient version.

 

6)    Learning New APIs:

  • Explore new libraries or frameworks by typing their names and asking for examples.
  • Example: Type // Example of using Axios for HTTP requests and see what Copilot provides.

Conclusion

By systematically experimenting with the six must-try features of GitHub Copilot, you have significantly enhanced your understanding of how this powerful tool can assist you in your coding projects. Here’s a summary of your experience:

  1. Enhanced Coding Efficiency: You discovered how to leverage code suggestions and in-line completions to write code faster and with fewer errors.
  2. Complex Function Generation: By using comments to describe what you wanted to achieve, you experienced how Copilot can generate multi-line code snippets, making it easier to implement complex functionalities.
  3. Natural Language Processing: You learned that you could ask questions in natural language, allowing you to interact with Copilot more intuitively and receive relevant code examples.
  4. Refactoring Capabilities: You explored how Copilot can assist in refactoring your code, providing suggestions for improvements, and helping you maintain cleaner and more efficient codebases.
  5. API Familiarization: You utilized Copilot to learn new libraries and APIs, enabling you to quickly integrate them into your projects without extensive research.
  6. Overall Productivity Boost: Your experience with these features has likely led to a notable increase in your productivity, allowing you to focus more on problem-solving and less on repetitive coding tasks.

Final Thoughts

Using GitHub Copilot not only streamlines your coding process but also empowers you to explore new technologies and approaches with confidence. As you continue to use it, you will likely uncover even more features and capabilities that can further enhance your development workflow. Embrace this tool as a valuable partner in your programming journey!

References

GitHub Copilot Modules
  1. GitHub Copilot for Azure: 6 Must-Try Features https://techcommunity.microsoft.com/blog/azuredevcommunityblog/github-copilot-for-azure-6-must-try-features/4283126
  2. Introduction to GitHub Copilot: https://learn.microsoft.com/en-in/training/modules/introduction-to-github-copilot/?wt.mc_id=studentamb_263805
  3. Get started with GitHub Copilot https://learn.microsoft.com/en-in/training/modules/get-started-github-copilot/?wt.mc_id=studentamb_263805
  4. Introduction to prompt engineering with GitHub Copilot: https://learn.microsoft.com/en-in/training/modules/introduction-prompt-engineering-with-github-copilot/?wt.mc_id=studentamb_263805
  5. GitHub Copilot Fundamentals - Understand the AI pair programmer https://learn.microsoft.com/en-in/training/paths/copilot/?wt.mc_id=studentamb_263805 
  6. Get the Copilot for Azure Extension https://aka.ms/GetGitHubCopilotForAzure 
GitHub Education Resources
  1. GitHub Education Program https://github.com/education?wt.mc_id=studentamb_263805
  2. GitHub Student Developer Pack https://education.github.com/pack?wt.mc_id=studentamb_263805
  3. GitHub Campus Experts https://github.com/education/students?wt.mc_id=studentamb_263805

 

 

 

 

 

 

Updated Nov 11, 2024
Version 6.0
No CommentsBe the first to comment