azure_ai_agents
Azure AI Agent Framework
This directory contains the Microsoft Azure AI Agent Framework, designed to enable natural language interaction for managing various Azure services. It allows users to perform common tasks such as creating resources, listing existing configurations, and executing specific operations through intuitive commands.
Getting Started
To use the Azure agent framework, you need to specify --platform azure and --subscription <your-subscription-id> when running the main.py script, followed by your command in plain English.
Before running any commands, ensure you have authenticated to Azure. The framework uses DefaultAzureCredential, which supports various authentication methods. The simplest way to get started is by logging in via the Azure CLI:
az login
Agents and Commands Implemented
VM Agent
Manages Azure Virtual Machines.
-
Smart Create VM:
- Creates a Virtual Machine with the specified name, image, size, and admin credentials.
- Automatically creates a VNet, Subnet, Public IP, and Network Interface if they don't exist.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "vm smart-create vm <name> resource-group <rg> in <location> [image <publisher> <offer> <sku>] [size <vm-size>] [username <user>] [password <pass>]" - Example:
python main.py --platform azure --subscription <your-subscription-id> "vm smart-create vm my-azure-vm resource-group my-rg in eastus image Canonical UbuntuServer 18.04-LTS size Standard_B1s username azureuser password MySecurePassword123"
-
List VMs:
- Lists all Virtual Machines in a specified resource group.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "vm list vms resource-group <rg>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "vm list vms resource-group my-rg"
-
Start VM:
- Starts a specified Virtual Machine.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "vm start vm <name> resource-group <rg>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "vm start vm my-azure-vm resource-group my-rg"
-
Stop VM:
- Stops a specified Virtual Machine.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "vm stop vm <name> resource-group <rg>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "vm stop vm my-azure-vm resource-group my-rg"
-
Delete VM (with safety prompt):
- Deletes a specified Virtual Machine.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "vm delete vm <name> resource-group <rg>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "vm delete vm my-azure-vm resource-group my-rg"
Storage Agent
Manages Azure Storage Accounts.
-
Smart Create Storage Account:
- Creates a Storage Account with the specified name, using sensible defaults (Standard_LRS, StorageV2, HTTPS only, TLS 1.2, no public blob access).
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "storage smart-create storage-account <name> resource-group <rg> in <location>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "storage smart-create storage-account mystorageaccount resource-group my-rg in eastus"
-
List Storage Accounts:
- Lists all Storage Accounts in a specified resource group.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "storage list storage-accounts resource-group <rg>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "storage list storage-accounts resource-group my-rg"
-
Delete Storage Account (with safety prompt):
- Deletes a specified Storage Account.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "storage delete storage-account <name> resource-group <rg>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "storage delete storage-account mystorageaccount resource-group my-rg"
SQL Agent
Manages Azure SQL Databases.
- Smart Create SQL Database:
- Creates an Azure SQL Server (if it doesn't exist) and an Azure SQL Database.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "sql smart-create sql-database server <server-name> database <db-name> username <user> password <pass> resource-group <rg> in <location>" - Example:
python main.py --platform azure --subscription <your-subscription-id> "sql smart-create sql-database server mysqldbserver database mydatabase username sqladmin password MySecurePassword123 resource-group my-rg in eastus"
Functions Agent
Manages Azure Functions.
- Smart Create Function App:
- Creates an Azure Function App with sensible defaults.
- Usage:
python main.py --platform azure --subscription <your-subscription-id> "function smart-create function <app-name> storage-account <sa-name> resource-group <rg> in <location> [runtime <runtime>] [runtime-version <version>]" - Example:
python main.py --platform azure --subscription <your-subscription-id> "function smart-create function my-function-app storage-account myfunctionsa resource-group my-rg in eastus runtime node runtime-version 18"