๐ Rust Azure CLI Wrapper - Read-Only Cosmos DB
๐ฏ About
This library provides a safe, read-only interface to Azure Cosmos DB via the Azure CLI. It's designed for exploration, monitoring, and data discovery without the risk of accidental modifications.
โจ Key Features
- ๐ Read-Only Design - Zero risk of accidental resource changes
- ๐ Type-Safe Models - All Azure responses as Rust structs
- ๐งญ Cosmos DB Focused - SQL API, MongoDB, keys, throughput
- โก Async/Await - Modern async Rust with Tokio
- ๐ Multi-Subscription - Work across Azure subscriptions
- ๐ JSON Serializable - Easy integration with other tools
๐ Quick Start
Prerequisites
- Azure CLI installed and authenticated (
az login) - Rust 1.70+
Basic Usage
use AzureClient;
async
๐ Available Operations
Subscriptions & Resource Groups
list_subscriptions()- List all Azure subscriptionsshow_current_subscription()- Show current subscription detailslist_resource_groups()- List resource groupsshow_resource_group()- Show resource group details
Cosmos DB Accounts
list_cosmos_accounts()- List all Cosmos DB accountsshow_cosmos_account()- Show account detailslist_cosmos_keys()- Get master keyslist_cosmos_read_only_keys()- Get read-only keyslist_cosmos_connection_strings()- Get connection strings
SQL API
list_sql_databases()- List SQL databasesshow_sql_database()- Show database detailslist_sql_containers()- List containersshow_sql_container()- Show container detailsget_database_throughput()- Get database throughputget_container_throughput()- Get container throughput
MongoDB API
list_mongodb_databases()- List MongoDB databaseslist_mongodb_collections()- List collections
๐๏ธ Architecture
src/
โโโ lib.rs # Main API and exports
โโโ client.rs # Unified Azure client
โโโ commands/
โ โโโ account.rs # Subscription/resource group operations
โ โโโ cosmos.rs # Cosmos DB operations
โโโ models.rs # Azure resource models
โโโ utils.rs # CLI utilities
โโโ error.rs # Error handling
๐ก๏ธ Safety by Design
This library is intentionally read-only. It provides no methods to:
- Create resources
- Modify existing resources
- Delete resources
- Change configurations
- Regenerate keys
This makes it perfect for:
- ๐ Discovery - Explore your Azure environment safely
- ๐ Monitoring - Build dashboards and reports
- ๐งพ Inventory - Catalog your Cosmos DB resources
- ๐ Integration - Feed data to other systems
๐ค Contributing
Contributions are welcome!
๐ License
MIT License - see LICENSE file for details