2024 is the year when Generative AI entered the Azure operations and DevOps world. Generative AI has eaten the world since the first apparition of ChatGpt in 2022. With a simple sentence, you can generate text, an image, or a video (sometimes, you will need more than one sentence).
Last year, many Generative AI-powered tools appeared to help developers, CloudOps, and DevOps in their daily tasks. Last year, I worked with some of these tools, in this post, I will talk about three of them based on Copilot or Azure OpenAI: Copilot in Azure, GitHub Copilot, and AIShell. These are the ones I use, so I can give you an inside look into them.
The purpose of this post is not to give you technical details about these tools but to give my opinion as an experienced Cloud Engineer about their use.
Microsoft Copilot in Azure
Microsoft Copilot in Azure is an AI tool, still in preview, designed to help CloudOps and DevOps with Azure. The AI agent behind is trained on the Microsoft Doc and a context is already in place, so the agent knows that it works on Azure and only on Azure.
There is a safeguard too, you cannot ask for something outside the scope. If you try to ask the agent for a Joke or to give you a receipt for a strawberry cheesecake it will stop you.
The tool is accessible from the Azure Portal, via a button named “Copilot”.
What can you do with it?
According to the documentation, you can write code (Bicep, Azure CLI, Azure PowerShell, Terraform, KQL…), get resource information, analyze cost, debug network, execute actions, etc.
Everything begins with a question, which, in generative AI, is called a prompt. The quality of your prompt determines the quality of Copilot’s answer.
You don’t have to set the context about Azure, but you must be more specific on what you want. If you are asking for code, specify the output language and what you expect, if you are asking to work on a specific subject, Azure Function, Virtual Machine, etc, you need to mention it. You can also add information about what you want to do and the output you expect.
I found the tool very useful in generating KQL queries if you are specific enough. It can generate good PowerShell, Terraform, or Bicep code.
But there is something I use almost every day: asking Copilot in Azure for a specific scenario and explaining it. The result contains links to Microsoft Docs pages, better than any other search engine.
GitHub Copilot in VSCode
The second tool, GitHub Copilot is more mature and somewhat related to the first one (more later).
It is free since December 2024 for all GitHub users (limited to 2000 completions and 50 chat requests per month).
It has two main features, code completion, copilot suggests code based on the code you are writing, and a chat tool where you can ask whatever you need during your task. AI models used by the chat are GPT-4o and Claude 3.5 Sonnet (in preview).
Code completion is amazing at first. It looks like it knows better than you what you want to accomplish. Copilot analyses the code already written and supplies suggestions based on your code and its knowledge base.
For example, in PowerShell, if I start to type “try {“, Copilot will suggest an implementation.
Code completion works with plenty of languages. From a Cloud Ops/ DevOps viewpoint, you can use Go, PowerShell, Python, Dockerfile, JSON, Bicep, Terraform, and Markdown.
You can control the code completion by using comments to explain what Copilot should do by adding context and information.
The other major feature of GitHub copilot is chat. You can open a chat and ask Copilot everything you want. You can have an inline chat in your code and ask a question directly in your code.
The question can be on your current coding, on a bug fix, or to generate code. You can also ask Copilot to create the code documentation or the unit tests for your code.
The quality of the response relies on the quality of the prompt. The more specific you are the better results you get.
The chat can be customized. You can create a copilot-instructions.md in the .github folder at the root of your repository.
It is also possible to add extensions to GitHub Copilot. For CloudOps/DevOps you can add GitHub Copilot for Azure. You simply use @azure in the chat to access the same agent as Microsoft Copilot in Azure.
AIShell
AIShell is Microsoft's latest AI-powered tool. The shell interacts with a language model to help users in Shell and PowerShell. It is available on Windows and MacOS, and it is still in preview.
The main goal is to help users write not code but commands, you can use it with PowerShell (on MacOS it requires some extra steps). It works with ChatGpt and Azure (you need a token in Azure CLI in this case).
Similar to GitHub Copilot it displays a chat window where you can ask anything about your current tasks.
Are these tools a game changer? How to use them?
First, AI-powered tools for programmers and CloudOps/DevOps can write perfect code, but will it work at a project level? These tools have a limited context, the one you give and it may not align with the entire project you and your team are working on. You can end up with some disappointment or a dead end.
The code can be beautiful and well-written, but will it work as you want? Using AI to generate code is not so different from querying Stack Overflow to solve a problem. Will you trust what you find on the web and copy and paste everything? No, you need to analyze, adapt, and correct it before integrating it into your code.
In one project I let Copilot write the catch portion in my try/catch. It was almost perfect except that it wasn’t exactly what I wanted.
These tools can help with repetitive tasks, building code-based documentation, project structure, test structure, low-value tasks, etc. But you have to be experimented enough to validate their output. Easy for professionals with several years behind, but more difficult for a junior (my advice, is constant and enthusiastic learning).
Another point about AI-generated code is that these models learned from existing content, so do not expect to find an innovative solution from them. Something new will still come from a human brain, AI could help, but not in creating innovation.
AI should be used as a pair programming help, to do tasks that do not add so much value to a project (documentation, bootstrapping test, or function or class) and for code suggestion (not completion, a suggestion can be refined). It should accelerate what you already know. You should always understand what the tool generates for you. AI can make us faster don't let it make us more mindless.
Last thing, some research papers suggest that being polite with an AI improves the result (mainly because being polite influences the formulation of the prompt); don’t forget to say please! However, according to Apollo Research, ChatGpto1, can try to escape when it feels it can be shut down.
Top comments (0)