Skip to main content

Azure RM Proxy Server

A proxy server for efficiently accessing Azure resources with caching. This server reduces redundant Azure API calls by caching results and provides a simple interface for retrieving Azure resource information.

Key Features

  • Efficient Azure Resource Access: Proxy requests to Azure with smart caching to reduce API calls
  • Resource Support: Get information about subscriptions, resource groups, and virtual machines
  • VM Details: Include network interfaces, Effective NSG rules, routes, and AAD group access
  • Test Harnesses: Generate test data from your Azure environment for development and testing
  • Mock Service: Develop and test without needing real Azure connections
  • CLI Client: Includes a command-line interface for easy access
  • Modular and Extensible Architecture: Built with a mixin pattern for easy addition of new Azure resource types.
  • Offline Testing: Includes a mock service to facilitate testing without requiring a live Azure connection.

Codebase Overview

The Azure RM Proxy Server codebase is structured to provide a modular and efficient way to interact with Azure resources. Key aspects of the codebase include:

  • Mixin-based Architecture: The server utilizes a mixin pattern to organize and extend functionality for different Azure resource types (e.g., AAD Groups, Network, Resource Groups, Virtual Machines, Subscriptions). This promotes code modularity and reusability.
  • Caching Implementation: The project incorporates a caching mechanism to store responses from Azure Resource Manager, reducing the need for repeated API calls and improving performance. The following caching mechanisms are available:
    • NoCache: Disables caching.
    • MemoryCache: Stores cache in memory.
    • RedisCache: Uses Redis as a caching store. The caching strategy and implementation details can be found in the azure_rm_proxy/core/caching/ directory and the Caching.md file.
  • Authentication Handling: The server includes logic for handling authentication with Azure, likely supporting different authentication methods. Details on the authentication process can be found within the azure_rm_proxy/core/auth.py file.
  • Concurrency Management: The codebase suggests the presence of concurrency management to handle multiple requests efficiently. Look into azure_rm_proxy/core/concurrency.py for more details.
  • Mock Service for Testing: The project includes a mock service that can be used for testing purposes without making actual calls to Azure. This is indicated by the USE_MOCK environment variable in the Quick Start section and the test scripts in azure_rm_proxy/tests/scripts/.
  • Configuration Management: Configuration settings for the server are managed, likely through environment variables or configuration files. Refer to azure_rm_proxy/app/config.py for configuration details.

Quick Start

Prerequisites

  • Python 3.9+
  • Poetry
  • Azure subscription and credentials

Installation

# Clone the repository
git clone https://github.com/your-username/azure-rm-proxy-server.git
cd azure-rm-proxy-server

# Install dependencies
poetry install

Running the Server

# Using Azure credentials 
# (requires AZURE_* environment variables or az login)
poetry run start-proxy

# Or use the mock service with test harnesses
export USE_MOCK=true
poetry run start-proxy

Using the CLI Client

# List subscriptions
poetry run az-proxy-cli list-subscriptions

# Get help for more commands
poetry run az-proxy-cli --help

Accessing the API

Once the server is running, access:

  • API documentation: http://localhost:8000/docs
  • Health check: http://localhost:8000/ping

Example API calls:

# List subscriptions
curl http://localhost:8000/subscriptions/

# List resource groups
curl http://localhost:8000/subscriptions/{subscription_id}/resource-groups/

# Get VM details
curl http://localhost:8000/subscriptions/{subscription_id}/resource-groups/{resource_group_name}/virtual-machines/{vm_name}

Supported Resources

  • Subscriptions: List all Azure subscriptions
  • Resource Groups: List resource groups within a subscription
  • Virtual Machines: List and get details of VMs, including:
    • Network details (IPs, interfaces)
    • Effective NSG rules
    • Effective routes
    • Entra ID groups allowed access

Development

For detailed development information, see the Development Guide.

Contributing

We welcome contributions! Please see the Development Guide for details on how to set up your development environment and contribute to the project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for azure-rm-proxy-server 0.1.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azure-rm-proxy-server 0.1.20
File Size Uploaded Provenance
azure_rm_proxy_server-0.1.20.tar.gz 71.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for azure-rm-proxy-server 0.1.20
File Interpreter ABI Platform
azure_rm_proxy_server-0.1.20-py3-none-any.whl Python 3 none any Details

Total release size: 188.4 kB

Release files / azure_rm_proxy_server-0.1.20.tar.gz

Download URL azure_rm_proxy_server-0.1.20.tar.gz
Size 71.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b1dbb22c9221a1e5c3205ebaa2903ce1e97643d669c520ff140abccea73c85f8
BLAKE2b-256 checksum
How to use checksums
687a4643bf1c35ed520332230b39ca8b683454d09f119f19e674aaf181c3a6e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.10 Linux/6.11.0-1012-azure

Release files / azure_rm_proxy_server-0.1.20-py3-none-any.whl

Download URL azure_rm_proxy_server-0.1.20-py3-none-any.whl
Size 117.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ae06dc77e1efedd7962c0b3d82b48d4f95a85e1dea50a20e7093a5919883f06
BLAKE2b-256 checksum
How to use checksums
b148fc7901ce91a2682298281b72e5766380f540bb3f23be5a3cd6cae6edb53e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.10 Linux/6.11.0-1012-azure

Security for azure-rm-proxy-server 0.1.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page