Skip to content

Top AI & CLI Prompts DevOps Can Use to Manage Azure Efficiently

As DevOps engineers juggle multiple responsibilities—from provisioning resources to ensuring system reliability—having quick, effective commands and AI prompts can significantly boost productivity. Whether you’re scripting in Azure CLI, using GitHub Copilot, or leveraging Azure’s AI Copilots, here are some of the best prompts and commands to streamline Azure management.

🤖 AI Copilot Prompts for Azure Management

🔹 1. Generate Infrastructure as Code (IaC)

Prompt:

“Generate a Bicep template to deploy a web app with a linked App Service Plan and a custom domain.”

This will help create clean, reusable infrastructure code without starting from scratch.

🔹 2. Diagnose VM Issues

Prompt:

“Analyze performance issues on my Azure VM named ‘webserver-vm’ in resource group ‘prod-rg’ and suggest optimizations.”

Use this with Microsoft Copilot in Azure or GitHub Copilot for actionable diagnostics.

🔹 3. Cost Optimization Suggestions

Prompt:

“Review my Azure subscription for unused or underutilized resources and recommend cost-saving actions.”

Perfect for identifying zombie resources or unused storage accounts.

🔹 4. Security Best Practices Review

Prompt:

“Check my Azure setup for common security misconfigurations like open ports, missing NSGs, or disabled MFA.”

Great to run monthly or integrate into CI/CD pipelines.

🔹 5. Deploy a Secure AKS Cluster

Prompt:

“Create a secure Bicep template to deploy an Azure Kubernetes Service cluster with Azure Policy, role-based access control, and network restrictions.”

Ideal for enforcing enterprise-grade deployments.

💻 Azure CLI Commands Every DevOps Engineer Should Know

🔧 1. Login and Subscription

bashCopyEditaz login
az account set --subscription "Your Subscription Name"

🏗️ 2. Deploy ARM/Bicep Templates

bashCopyEditaz deployment group create \
  --resource-group dev-rg \
  --template-file main.bicep

📦 3. Create a Storage Account

bashCopyEditaz storage account create \
  --name mystorageacct \
  --resource-group dev-rg \
  --location eastus \
  --sku Standard_LRS

🖥️ 4. Start and Stop Virtual Machines

bashCopyEditaz vm start --name myVM --resource-group dev-rg
az vm stop --name myVM --resource-group dev-rg

🔒 5. List Role Assignments

bashCopyEditaz role assignment list --assignee <user@domain.com>

⚙️ GitHub Copilot Prompts for DevOps Workflows

✅ YAML Pipeline Generator

Prompt:

“Generate a GitHub Actions workflow to deploy a .NET app to Azure Web App with test and build stages.”

🔄 Terraform Integration Prompt

Prompt:

“Create a Terraform configuration file to provision an Azure Resource Group, Storage Account, and Key Vault.”

📌 Tips for Using Prompts Effectively

  1. Be specific: Mention resource types, names, regions, and configurations.
  2. Iterate: Use the generated code as a draft and refine with your own tweaks.
  3. Validate: Always run az validate or linter tools before deploying.

🧰 Bonus: Useful Azure DevOps CLI Prompts

bashCopyEditaz devops login
az devops project list
az pipelines run --name "CI-CD-Project"
az boards work-item create --title "Fix Azure RBAC" --type "Bug"