Speed up your development process with GitHub Copilot

GitHub Copilot is a revolutionary tool that’s changing the way developers write code. Personally, I sometimes find it difficult to search the documentation or struggle with the syntax. So Copilot is here to save the day. In this blogpost, I’ll walk you through everything you need to know about GitHub Copilot, from installation to creating a practical example like an Azure function connected to Dataverse.

What is GitHub Copilot and why you should start using it?

GitHub Copilot is an AI-powered coding assistant developed by GitHub in collaboration with OpenAI. It is designed to assist developers in writing code more efficiently and accurately. By analyzing millions of lines of code and leveraging machine learning models, GitHub Copilot can generate code suggestions, autocompletions, and even entire functions or classes based on the context of the code being written.

GitHub says that developers need to start using GitHub Copilot because it significantly enhances productivity and improves code quality, saving time by automatically generating code, and of course reducing the need for manual typing. This allows developers to focus more on solving complex problems and implementing unique logic. Here I have to say that it’s true, I’ve been using Github Copilot for the last two months and love it.

I have been able to create plugins, custom APIs, much faster giving me time to think more on the architecture and pattern I want to apply to my code.

Installing GitHub Copilot

If you use Visual Studio, like me, then you can view and incorporate suggestions from GitHub Copilot directly within the editor, but first there are some prerequisites that you have to comply with first.

Prerequisite 1

To use GitHub Copilot you must have an active GitHub Copilot subscription. Here there are two options. First option is if the company you work for has a GitHub subscription or plan, if that is the case then go to GitHub and under your profile click in Settings:

Then click in Copilot:

In my case I’m enjoying the benefit of having a GitHub Copilot subscription because of the company I work for, Dynamic People:

The second option it’s a trial using your personal GitHub account. You can enjoy a 60 days trial for free and after you will have to pay 10 euros per month:

Prerequisite 2

To use GitHub Copilot in Visual Studio, you must have Visual Studio 2022 17.6 or later installed.

Unfortunately you can not use Visual Studio 2017 or 2019 version, you must have 2022 17.6 minimum to work with Copilot.

In my case I’m working with the 2022 17.6.6 version:

Installation process

In Visual Studio 2022 click in extensions and then click in Manage Extensions:

In the “Manage Extensions” window, click Visual Studio Marketplace, search for the GitHub Copilot extension, then click Download:

Close the “Manage Extensions” window, then exit and relaunch Visual Studio.

Optionally, to check that GitHub Copilot is installed and enabled, go back to Manage Extensions, click Installed to view your currently installed extensions, then click GitHub Copilot to see status information: