Skip to main content

No project description provided

Project description

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:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure_rm_proxy_server-0.1.20.tar.gz (71.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

azure_rm_proxy_server-0.1.20-py3-none-any.whl (117.4 kB view details)

Uploaded Python 3

File details

Details for the file azure_rm_proxy_server-0.1.20.tar.gz.

File metadata

  • Download URL: azure_rm_proxy_server-0.1.20.tar.gz
  • Upload date:
  • Size: 71.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.10 Linux/6.11.0-1012-azure

File hashes

Hashes for azure_rm_proxy_server-0.1.20.tar.gz
Algorithm Hash digest
SHA256 b1dbb22c9221a1e5c3205ebaa2903ce1e97643d669c520ff140abccea73c85f8
MD5 613d0d9440ad62cd0b20f0f07877bfaf
BLAKE2b-256 687a4643bf1c35ed520332230b39ca8b683454d09f119f19e674aaf181c3a6e7

See more details on using hashes here.

File details

Details for the file azure_rm_proxy_server-0.1.20-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_rm_proxy_server-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae06dc77e1efedd7962c0b3d82b48d4f95a85e1dea50a20e7093a5919883f06
MD5 7919e34614e1064c2d4bda8f0654aa24
BLAKE2b-256 b148fc7901ce91a2682298281b72e5766380f540bb3f23be5a3cd6cae6edb53e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page