GitHub Copilot for Azure: A Comprehensive Guide

Author

Reads 730

Close-up of a hand holding a 'Fork me on GitHub' sticker, blurred background.
Credit: pexels.com, Close-up of a hand holding a 'Fork me on GitHub' sticker, blurred background.

GitHub Copilot for Azure is a game-changer for developers, offering a seamless coding experience with AI-powered suggestions.

With GitHub Copilot for Azure, you can write code up to 40% faster, thanks to its intelligent code completion feature.

GitHub Copilot for Azure integrates with Visual Studio Code, allowing you to access its features directly from the IDE.

This integration enables you to receive code suggestions, auto-completion, and even entire code blocks, all within the comfort of your familiar coding environment.

Getting Started with GitHub Copilot for Azure

GitHub Copilot for Azure is incredibly useful for developers new to Azure, helping them quickly grasp complex concepts.

To get started, you can ask questions about Azure services like Azure OpenAI models, Azure AI Search, or even pricing details for services like Azure SQL. This feature brings in relevant, up-to-date documentation without leaving your editor.

Suggested prompts for learning Azure include "@azure Give me a detailed description of Azure AI Search" or "@azure Which azure services can run my container?"

Credit: youtube.com, GitHub Copilot for Azure: Deploying to Azure Kubernetes Service

You can use GitHub Copilot via an VS Code extension, and it's an AI programmer that can save you some brain energy.

One of the most effective features is the git commit message generation based on file changes, which can be triggered by clicking on the “AI” icon.

Here are some tips and prompts to get you started:

  • @azure Give me a detailed description of Azure AI Search
  • @azure Which azure services can run my container?
  • Highlight some lines of code, hit CTRL+I to get copilot command bar and type /explain

Deployment and Management

GitHub Copilot for Azure streamlines the process of deploying your applications by guiding you through tasks such as resource setup and automated deployments.

You can use it to develop a RAG (Retrieval-Augmented Generation) app with Python, set up a CI/CD pipeline, or deploy your project using the Azure Developer CLI (azd). It can recommend app templates, appropriate commands, and configurations.

To deploy an app, you can use suggested prompts like "@azure Can you help me build an RAG chat app with GPT-4o?" or "@azure List the regions where GPT-4o is available".

Credit: youtube.com, GitHub Copilot for Azure: Deploying to Azure With Context

GitHub Copilot for Azure also helps you manage resource operations effectively, ensuring your resources are utilized properly. You can inquire about the number of Azure OpenAI deployments you have or request a list of your storage accounts in a specific data center region and have them sorted by size.

You can ask for the cost of a specific set of resources, which helps you optimize your setup by identifying over-provisioned resources, rebalancing workloads, or fine-tuning configurations.

Here are some examples of how you can use GitHub Copilot for Azure to manage resources:

  • @azure how many web app plans using the free tier do I have deployed grouped by region sorted by highest to lowest?
  • @azure How do I list all the pods in my AKS cluster?
  • @azure Breakdown the cost of my [VeryImportantResourceGroup] resource group for October?

Troubleshooting

Troubleshooting is a breeze with GitHub Copilot for Azure. It makes diagnosing and troubleshooting easier by providing quick insights into your application's performance and resource problems.

GitHub Copilot for Azure performs diagnostics, searches logs, and highlights potential issues, making it easier to identify the cause of problems. It can help you understand why your Kubernetes cluster is slow or identify the cause of those frustrating 500 errors on your website.

Credit: youtube.com, Troubleshoot your apps faster with App Service using Microsoft Copilot for Azure | Azure Friday

The tool doesn't just stop at identifying problems - it actively assists in resolving them too. Once you've identified the cause of your resource or app issues, it can suggest solutions such as optimizing configurations, scaling resources, or fixing code that's causing those 500 errors.

Here are some suggested prompts for troubleshooting:

  • @azure Why is my [ReallyImportantWebsite] webapp running slow?
  • @azure Are there any errors in the logs of my [SuperCoolDemo] Container App?

GitHub Copilot for Azure can recommend adjustments to your deployment settings or resource limits if your Kubernetes cluster is running slowly. It can also provide tips on efficient scaling if you're facing quota exhaustion or performance bottlenecks.

Streamlining Development

GitHub Copilot for Azure can automatically complete code for you, freeing up time to focus on the creative aspects of development.

By integrating GitHub Copilot with Azure, you can reduce the time spent on coding by up to 60% and increase productivity.

With GitHub Copilot, you can write code faster and with fewer errors, which can lead to a significant reduction in the time spent on debugging and testing.

Credit: youtube.com, GitHub Copilot for Azure: Discovering Azure Services and AI Templates

GitHub Copilot for Azure supports popular Azure services such as Azure Functions, Azure Storage, and Azure Cosmos DB.

This means you can use GitHub Copilot to generate code for a wide range of Azure applications and services, from serverless functions to distributed databases.

By streamlining development with GitHub Copilot for Azure, you can focus on what matters most – delivering high-quality applications and services to your users.

Hands-On Experience

Logging into the Azure console, I clicked on the Copilot icon and was able to access a range of features and tools.

Copilot provided accurate information about the resources running on my account, listing 184 resources in total. I was also able to ask it to list all VMs that were not currently running, which it understood and provided promptly.

I was impressed by Copilot's ability to understand the context of my browsing and provide relevant information. For example, when I asked it to list all VMs that were not running, it took into account the resources within my subscription and tenant ID.

As I continued to use Copilot, I was able to work with it to create a low-cost VM, with it executing the required steps and giving me options to enable or skip features. This was a seamless and efficient process, with Copilot providing a truly augmented experience.

Azure/Aistudio-Sample

Credit: youtube.com, How to use Microsoft Azure AI Studio and Azure OpenAI models

To get started with the Azure/Aistudio-Sample, you'll need to deploy a chat completions model, such as GPT-4, and a text embedding model, like text-embedding-ada-002, to run the sample.

This involves doing some setup work in the Azure AI Model Catalog to make it all happen smoothly.

You'll be working with a chat completions model, which is a type of AI designed to generate human-like responses to user input, and a text embedding model, which helps to understand the meaning behind the text.

Deploying these models in the Azure AI Model Catalog will be your first step in getting the Azure/Aistudio-Sample up and running.

Hands-On

I logged into the Azure console and was delighted to see the Copilot icon at the top bar, which I happily clicked on. It's provided as a sidebar on the portal itself, so it stays with you as you navigate the portal services.

The Copilot replied accurately when I asked how many resources are running - it was 184 resources. I was impressed by its speed and accuracy.

From above crop faceless male developer in black hoodie writing software code on netbook while working in light studio
Credit: pexels.com, From above crop faceless male developer in black hoodie writing software code on netbook while working in light studio

I asked Copilot to list all VMs that are not running, and it understood the context within my resources in the subscription (tenant id). This shows how well it can understand the context of the user's browsing.

Copilot showed me all the resources that were created in the last 24 hours, which was exactly what I needed. This feature is super useful for keeping track of recent changes.

I asked Copilot to help me create a low-cost VM, and it executed the required steps one by one, giving me options to enable or skip features. This was a real augmented experience, with Copilot working together with me like a digital worker.

Copilot opened the ARO cluster service section in my second attempt, which was a bit of a challenge but ultimately successful. This shows how patient and helpful it can be.

I asked Copilot to create a cluster, and it gave me the required commands and steps with a Run option. When I clicked on Run, it opened the command shell expecting me to run the commands.

Scripting and Automation

Credit: youtube.com, GitHub Copilot for Azure: Exploring Your Azure Resources

GitHub Copilot is a game-changer for scripting and automation in Azure. I've found it to be the most effective AI tool I've used so far.

With GitHub Copilot, you can generate git commit messages based on file changes, saving you brain energy thinking of mundane comments. Click on the "AI" icon to get started.

The code comment generation feature is a neat one. When you enter a code comment block, GitHub Copilot will predict your next logical step and suggest words to complete the comment. Just start typing and hit tab to see the suggestions.

The /explain feature is also incredibly helpful. Highlight some lines of code, hit CTRL+I to get the Copilot command bar, and type /explain. The left pane will respond with a thorough and easy-to-understand explanation of the code.

Using GitHub Copilot for creating and managing Azure resources is definitely helpful, with productivity gains to boot. However, for more complex scenarios, you may need to iteratively improve the code manually or re-prompt to get the desired outcome.

Frequently Asked Questions

Is there a Copilot for Azure DevOps?

Yes, Azure DevOps has a Co-Pilot, an open-source sample that can be adapted for specific needs in security, deployment, management, and features. It's available for organizations to customize and use.

Is Copilot in Azure free?

Yes, Copilot in Azure is free during the preview period. No additional cost is charged for using Copilot in Azure during this time.

Glen Hackett

Writer

Glen Hackett is a skilled writer with a passion for crafting informative and engaging content. With a keen eye for detail and a knack for breaking down complex topics, Glen has established himself as a trusted voice in the tech industry. His writing expertise spans a range of subjects, including Azure Certifications, where he has developed a comprehensive understanding of the platform and its various applications.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.