Azure CLI has always been the go-to tool for cloud practitioners working with Microsoft Azure. With the addition of the az aks copilot
command, Azure has integrated advanced chat-based assistance directly into the CLI. This command enables users to chat with an expert on Azure Kubernetes Service (AKS), allowing for real-time guidance and troubleshooting using az
commands.
What is az aks copilot?
Simply put, az aks copilot
acts as your personal AKS expert right in the terminal. Leveraging advanced models from OpenAI, such as GPT-3.5 Turbo, or Azure’s own instance of OpenAI, it provides real-time answers to user queries, guiding them through various AKS operations, troubleshooting, and more.
Key Features and Benefits
- 1. Chat-Based Assistance: Engage in an intuitive chat interface to ask questions directly related to AKS operations and receive instant answers.
- 2. Flexible Integration with OpenAI and Azure: Users have the flexibility to either use OpenAI directly or Azure’s instance of OpenAI. This flexibility ensures that businesses can choose a model that aligns with their operational needs and costs.
- 3. Real-Time Troubleshooting: Instead of hopping between different documentation or forums, users can now get guidance directly in their CLI, saving time and ensuring more efficient resolutions.
- 4. Direct Querying: The command allows for direct input of questions, making it incredibly user-friendly.
Prerequisites
Before diving into the “az aks copilot” feature, it’s essential to have the right environment. Here’s what you need:
- Azure CLI: Ensure you’re running the latest version of Azure CLI.
- AKS-Preview Extension: The “az aks copilot” command requires the AKS-Preview extension with a minimum version of 0.5.156. This extension brings essential capabilities required by “copilot” to function correctly. Install or update the AKS-Preview extension using the following commands:
1 2 |
az extension add --name aks-preview az extension update --name aks-preview |
After the installation or update, you can check the extension’s version with:
1 |
az extension list --output table |
Ensure that the version next to “aks-preview” is at least 0.5.156.
- API Keys: To activate
az aks copilot
, you need API keys for either OpenAI or Azure. Here’s the setup process for both:
- OpenAI Option:
- Sign in to OpenAI.
- Navigate to the API key section in your account dashboard here.
- Create a new API key and choose models from OpenAI’s model documentation.
- Export your keys to the environment:
1 2 |
export OPENAI_API_KEY=xxx export OPENAI_API_MODEL=gpt-3.5-turbo |
- Azure OpenAI Option:
- Create a new Cognitive Services resource.
- – Find the keys and endpoints in the “Keys and Endpoint” section on the Azure portal.
- – Set your environment variables accordingly:
1 2 3 4 |
export OPENAI_API_KEY=xxx export OPENAI_API_BASE=https://xxxinstance.openai.azure.com/ export OPENAI_API_DEPLOYMENT=gpt-4-32k-0314 export OPENAI_API_TYPE=azure |
Now, with the prerequisites in place, you’re ready to experience the capabilities of the az aks copilot
command.
Getting Started
Using az aks copilot
is straightforward. If you have a question about AKS operations, simply invoke the command with your query. For instance, to understand how to create a private AKS cluster, you can use:
1 |
az aks copilot -p "How to create a private cluster" |
This will engage the chat assistant, and you’ll receive a guided response to your query.
Conclusion
The az aks copilot
feature is a testament to the integration of AI into operational tools, making Azure CLI not just a command executor but also a guide. As Azure continues to innovate, features like this will redefine the user experience, making cloud operations more intuitive and efficient.
3 Comments
Luis · September 13, 2023 at 9:04 am
Thank, go go go!!!
Jayakumar · September 19, 2023 at 12:49 pm
Hi Richard, I have an aks-preview extension as 0.5.159
Experimental ExtensionType Name Path Preview Version
————– ————— ———– ————————————————– ——— ———
False whl aks-preview C:\Users\velusjay\.azure\cliextensions\aks-preview True 0.5.159
but I am getting an error
‘copilot’ is misspelled or not recognized by the system.
Examples from AI knowledge base:
https://aka.ms/cli_ref
Read more about the command in reference docs
Anything I missed ?
Pixel Robots. · September 22, 2023 at 12:41 pm
It looks like they pulled the feature with 0.5.159