A collection of Python scripts for automating Microsoft Azure infrastructure management, cost optimization, and administrative tasks.
This repository serves as a portfolio of cloud engineering tools designed to solve real-world operational challenges using the Azure SDK for Python.
| Script Name | Description | Key Services |
|---|---|---|
vm-auto-stop.py |
Automates cost savings by identifying and deallocating specific Virtual Machines by tags and resource group. | Compute, Tags |
| (Coming Soon) | Future scripts for Storage Account management and Network security checks. | ... |
This script helps reduce cloud spend by automatically finding Virtual Machines that are meant for development (tagged Environment: Dev) and ensuring they are deallocated.
Key Logic:
- Authenticates securely using
DefaultAzureCredential. - Scans a target Resource Group for VMs.
- Filters for VMs with specific tags (e.g.,
Environment: Dev). - Checks the Instance View to see if the VM is currently
Running. - Action: Deallocates the VM to stop billing.
- Safety: Includes a
DRY_RUNflag to simulate actions without affecting production.
To run these scripts, you will need:
- Python 3.8+
- Azure CLI (for local authentication)
- Azure Subscription (with permissions to manage resources)
python -m pip install azure-identity azure-mgmt-compute