I recently delivered a community professional session at Global Azure Bootcamp 2026 titled Azure CLI + GitHub Copilot in VS Code — Deep Dive. This post is a full written version of everything covered in that session — slide by slide — so you can revisit the content, follow the demos, and share it with your team.
Why This Session Exists
A lot of content about GitHub Copilot and Azure CLI focuses on tools that are still evolving. Copilot CLI — the terminal extension — changed its interface significantly in recent versions and a lot of demos you find online simply do not work anymore. This session was deliberately built around what is stable, available today, and reproducible on any machine with a GitHub Copilot subscription.
The VS Code path is that stable option. The Azure CLI Tools extension, GitHub Copilot, and Copilot Chat together cover everything that Copilot CLI was supposed to do — and they do it more reliably, with richer context awareness because Copilot can see your full file as you work.
The Real Problem — Why Developers Lose Time
Before getting into the tools, it is worth naming the problem clearly. There are four main ways that Azure CLI work slows developers and cloud engineers down:
Context Switching
You are mid-deploy and need to look up a flag. You open a browser, land on the Azure docs, get distracted by a related article, and by the time you are back in VS Code you have lost your thread. This happens dozens of times a day for anyone doing serious Azure work.
JMESPath is Painful
The --query flag in Azure CLI uses JMESPath syntax. It is powerful — you can filter, project, and transform output in a single line. But the syntax is not obvious, especially for nested objects. Getting a query right the first time usually involves trial and error or a trip to the JMESPath documentation.
Script Boilerplate
Starting a Bash script that wraps Azure CLI commands from scratch means writing loops, error handling, output formatting, and subscription checks before you even get to the logic you care about. That boilerplate takes time and it is mostly the same across every script.
Syntax Overload
Azure CLI has over 2,500 commands. The ones you use daily might be 15 to 20. But the flags on those 15 to 20 commands number in the hundreds. Nobody memorises all of them, and looking them up repeatedly is friction that compounds across a workday.
GitHub Copilot in VS Code addresses all four of these without requiring you to leave your editor.
What Actually Works Today — The Stack
The session focused on three things working together:
Azure CLI Tools Extension for VS Code
This extension (ms-vscode.azurecli) gives you IntelliSense for every az command, inline parameter hints as you type, syntax highlighting for .azcli files, and the ability to run selected commands directly in the integrated terminal. It also handles Azure account sign-in from inside VS Code so you never have to leave the editor to authenticate.
GitHub Copilot + Copilot Chat
You may already use Copilot for code. What many developers do not realise is how well it understands Azure CLI syntax. It has been trained on a large volume of Azure scripts and documentation. Copilot Chat adds a conversational interface — you can ask questions, request explanations, and iterate on commands in a back-and-forth flow.
Together
When Copilot can see your .azcli file, your Bicep template, or your GitHub Actions YAML, it understands the full context of what you are building. Suggestions are not generic — they are calibrated to your file, your resource names, and your patterns.
Setup — 3 Things, 5 Minutes
Getting the full stack running takes about 5 minutes on a fresh machine.
Step 1 — Install VS Code Extensions
Open the Extensions panel in VS Code (Ctrl+Shift+X) and install:
- Azure CLI Tools —
ms-vscode.azurecli - GitHub Copilot —
GitHub.copilot - GitHub Copilot Chat —
GitHub.copilot-chat
You need an active GitHub Copilot subscription for the AI features. If your organisation has Copilot Business or Enterprise, you are already covered.
Step 2 — Sign in to Azure
Open the Command Palette (Ctrl+Shift+P) and type Azure: Sign In. This opens a browser popup where you authenticate with the same account you use for the Azure Portal. Once signed in, your subscriptions appear in the Azure sidebar and you can switch between them without touching a terminal.
Step 3 — Verify Copilot is Working
Open Copilot Chat (Ctrl+Alt+I) and type: what az command lists all resource groups? — if it responds with a working command, your entire stack is ready.
The Hidden Superpower — .azcli Files
This was the first demo in the session and consistently the one that surprises people most.
Create any file in VS Code with the .azcli extension. This tells both the Azure CLI Tools extension and GitHub Copilot that you are writing Azure CLI commands. The quality of Copilot suggestions immediately improves compared to a plain .sh file because it knows your intent.
The workflow is simple: write a comment describing what you want, press Enter, and Copilot suggests the complete command.
# list all resource groups in my subscription
az group list --output table
# list all running VMs and show their power state
az vm list --show-details \
--query "[].{Name:name, State:powerState, RG:resourceGroup}" \
-o table
# stop all VMs in a resource group
az vm deallocate --ids $(az vm list -g rg-prod --query '[].id' -o tsv)
# deploy a bicep template to a resource group
az deployment group create -g rg-prod --template-file main.bicepEvery one of those came from a single comment line. Copilot wrote the command, including the JMESPath filter on the second example.
One more thing worth knowing: highlight any command in a .azcli file and press F1, then select Azure CLI: Run Command in Terminal. It runs the selected line directly. This is particularly useful for testing one command at a time during script development.
Demo 1 — Copilot Chat for Azure Commands
The first full demo showed how to use Copilot Chat as a replacement for Azure documentation browsing.
Scenario: Find all VMs across your subscription, show only the running ones, grouped by resource group, output as a table.
In Copilot Chat, type: write an az command to list all running VMs grouped by resource group
The response is something like:
az vm list --show-details \
--query "[?powerState=='VM running'].{Name:name,RG:resourceGroup,Location:location}" \
-o tableCopilot explains what --show-details does (it fetches live power state data), explains the JMESPath filter, and gives you a command you can run immediately. No docs tab required.
The follow-up conversation is where the real value shows up. In the same chat thread, type: now add a column for VM size and sort by resource group — Copilot updates the command in context. It remembers the previous question. You do not have to repeat yourself.
This conversational iteration — describe, refine, describe again — is the core workflow that replaces the documentation loop for most day-to-day Azure CLI questions.
Demo 2 — Generating Bicep Templates with Copilot
The second demo moved from scripts into infrastructure as code.
Scenario: Deploy a Linux VM with a public IP, network security group, and storage account to West Europe — generated from comments in a .bicep file.
Create a new file called main.bicep in VS Code. At the top, write:
// Deploy a Linux VM with:
// - public IP address
// - network security group
// - standard storage account
// Location: West EuropePress Enter and start typing param — Copilot begins generating the full template. It produces parameter declarations, resource blocks for publicIPAddresses, networkSecurityGroups, networkInterfaces, and virtualMachines, all with current API versions.
With the Bicep file open, Copilot Chat becomes even more useful. Three prompts worth trying:
- explain what dependsOn does in this template — gives a plain English explanation of resource dependency ordering
- add a tag env=prod to all resources — Copilot updates every resource block in context, adding the tags property correctly
- what az command do I use to deploy this template? — returns the exact
az deployment group createcommand with correct flags, because it can see the file you are working on
That third prompt is worth pausing on. Copilot bridges Bicep authoring and CLI deployment in a single question because it has context of both. It does not give you a generic answer — it gives you the command for this file.
Demo 3 — GitHub Actions Workflows for Azure
The third demo covered generating CI/CD pipelines — the part of Azure work that involves the most boilerplate and the most looking things up.
Scenario: Deploy a Node.js 18 app to Azure App Service on every push to main, using a stored credential secret.
Create .github/workflows/deploy.yml in VS Code. Write these comments:
# Deploy Node.js 18 app to Azure App Service
# Trigger: push to main branch
# Auth: AZURE_CREDENTIALS secretPress Enter and begin typing name: — Copilot generates the full workflow structure including actions/checkout@v4, actions/setup-node@v4 with the right Node version, the npm build step, azure/login@v2 wired to your secret, and azure/webapps-deploy@v3.
Three Copilot Chat follow-ups that add real value after generation:
Is this workflow missing anything for production?
Copilot typically identifies: npm cache configuration to speed up builds, setting NODE_ENV=production, adding a post-deployment health check, and using GitHub Environments for approval gates before production deployments. These are things experienced engineers add from habit — Copilot surfaces them for everyone.
How do I generate AZURE_CREDENTIALS?
This is one of the most Googled questions for Azure + GitHub Actions. Copilot gives you the exact command:
az ad sp create-for-rbac \
--name "my-app" \
--role contributor \
--scopes /subscriptions/{id}/resourceGroups/rg-prod \
--sdk-authIt understands that you need to configure the Azure side, not just write YAML.
Add a Slack notification on failure
Copilot appends a slackapi/slack-github-action step with the correct if: failure() condition. It knows the action name, the required inputs, and how to wire it into the existing job.
Demo 4 — Paste an Error, Get a Fix
The fourth demo is the most underused Copilot Chat workflow and the one that consistently gets the biggest reaction in the room.
When you hit an Azure error, paste the full error message directly into Copilot Chat and ask: what does this error mean and how do I fix it?
Two examples from the session:
AuthorizationFailed
(AuthorizationFailed) The client does not have authorization to perform action
'Microsoft.Compute/virtualMachines/read' over scope '/subscriptions/...'Copilot identifies this as a missing role assignment on the service principal, explains why it happens, and gives you the fix:
az role assignment create \
--assignee <service-principal-id> \
--role Contributor \
--scope /subscriptions/<subscription-id>ResourceGroupNotFound
(ResourceGroupNotFound) Resource group 'rg-production' could not be found.Copilot correctly identifies two possible causes — the resource group does not exist yet, or you are on the wrong subscription — and gives you both the creation command and the subscription check:
az group create --name rg-production --location westeurope
az account show # verify you are on the right subscriptionThe same pattern works for Bicep deployment errors, which tend to have long and confusing output. Paste the full error block, ask what it means, and Copilot traces it back to the specific resource property that failed.
Limitations — The Honest Notes
No tool deserves a session without an honest section on where it falls short.
No live Azure connection
Copilot does not connect to your Azure account. It writes syntactically correct commands based on training data. Resource names, subscription IDs, and resource group names are placeholders — you fill in the real values.
Review before running
Copilot can and will suggest destructive commands — vm delete, group delete, role assignment remove — when they are contextually appropriate. Always read the full command before pressing Enter, especially anything involving delete, remove, stop, or deallocate.
API versions may lag
Bicep and ARM templates generated by Copilot use API versions from its training data, which may not be the most current. For production deployments, cross-check with az provider show to confirm the latest available version for your resource type.
Do not paste secrets into chat
Copilot Chat processes input through GitHub’s servers. Never paste service principal credentials, storage account keys, connection strings, or subscription IDs into the chat. Describe what you want to do — Copilot will give you the command to retrieve secrets from Key Vault or environment variables instead.
Complex multi-service deployments
For infrastructure that orchestrates 10+ resources with complex dependencies, Copilot is a useful starting point but not a finished product. Expect to review and refine generated Bicep templates for anything going to a production environment.
Corporate policy
Some organisations restrict Copilot on managed devices. Verify with your IT team before building workflows that depend on it in an enterprise context.
Key Takeaways
- The
.azclifile format is the fastest onramp. Create one today. Write a comment, press Enter, watch Copilot respond. The first time it fills in a correct JMESPath filter from a comment is when it becomes a habit. - Copilot Chat replaces most Azure docs browsing. Ask in plain English, get working commands with explanations. The conversational follow-up loop is where the real time saving is.
- Bicep generation from comments cuts IaC authoring time significantly. Use Copilot output as a first draft, review it, adjust resource names and API versions, then deploy.
- Paste error messages into Copilot Chat. Raw, unedited. Ask what it means. This alone is worth having the extension open while you work.
- Always review before running. Copilot is a fast, knowledgeable assistant — not a production safety net. The review habit is what separates engineers who love this tool from engineers who have a bad story about it.
Resources and Links
- Azure CLI Tools — VS Code Marketplace
- GitHub Copilot — VS Code Marketplace
- Azure CLI Documentation
- Bicep Documentation
- GitHub Actions for Azure — Official Docs
Find Me
- Blog: chandanbhagat.com.np
- GitHub: github.com/thechandanbhagat
Thanks for being part of Global Azure Bootcamp 2026. See you at the next one.
