Skip to content

feat(azure): implement Load Balancer, DNS, NAT Gateway and Application Gateway operations#78

Open
hariram4862 wants to merge 7 commits intoc2siorg:mainfrom
hariram4862:feature/azure-network-services
Open

feat(azure): implement Load Balancer, DNS, NAT Gateway and Application Gateway operations#78
hariram4862 wants to merge 7 commits intoc2siorg:mainfrom
hariram4862:feature/azure-network-services

Conversation

@hariram4862
Copy link
Contributor

Note: This PR builds on top of the existing Azure VM and networking implementation (#48), the VM Scale Set implementation (#50), the Azure Container Instances implementation (#52), the Azure Kubernetes Service implementation (#57), and the Azure Functions implementation (#60).
Once those PRs are merged, this PR will only contain the additional Azure networking services changes.

Closes #77

Summary

This PR adds support for additional Azure networking services in RustCloud.

The implementation extends RustCloud's Azure networking capabilities by adding support for Azure Load Balancer, DNS, NAT Gateway, and Application Gateway alongside the existing Virtual Network, Subnet, Network Interface, and Public IP implementations.

Implemented Services

  • Azure Load Balancer
  • Azure DNS
  • Azure NAT Gateway
  • Azure Application Gateway

Implemented Operations

Load Balancer Operations

  • Create Load Balancer
  • List Load Balancers (Resource Group)
  • List Load Balancers (Subscription)
  • Get Load Balancer
  • Delete Load Balancer

DNS Operations

  • Create DNS Zone
  • List DNS Zones (Resource Group)
  • List DNS Zones (Subscription)
  • Get DNS Zone
  • Create A Record
  • List Record Sets
  • Delete Record
  • Delete DNS Zone

NAT Gateway Operations

  • Create NAT Gateway
  • List NAT Gateways (Resource Group)
  • List NAT Gateways (Subscription)
  • Get NAT Gateway
  • Associate Public IP
  • Remove Public IPs
  • Delete NAT Gateway

Application Gateway Operations

  • Create Application Gateway
  • List Application Gateways (Resource Group)
  • List Application Gateways (Subscription)
  • Get Application Gateway
  • Stop Application Gateway
  • Start Application Gateway
  • Delete Application Gateway

Methodology

Azure networking resources are managed using the Azure REST API.

Authentication is handled using Azure CLI, where access tokens are retrieved from the Azure CLI session and used to authorize requests to Azure resource management APIs.

Before running tests, login using Azure CLI:

az login

Set the subscription ID as an environment variable.

Linux/macOS:

export AZURE_SUBSCRIPTION_ID=<subscription-id>

Windows PowerShell:

$env:AZURE_SUBSCRIPTION_ID="<subscription-id>"

Running Tests

Load Balancer Operations

cargo test test_create_load_balancer -- --nocapture
cargo test test_list_load_balancers_rg -- --nocapture
cargo test test_list_load_balancers_subscription -- --nocapture
cargo test test_get_load_balancer -- --nocapture
cargo test test_delete_load_balancer -- --nocapture

DNS Operations

cargo test test_create_dns_zone -- --nocapture
cargo test test_list_dns_zones_rg -- --nocapture
cargo test test_list_dns_zones_subscription -- --nocapture
cargo test test_get_dns_zone -- --nocapture
cargo test test_create_a_record -- --nocapture
cargo test test_list_record_sets -- --nocapture
cargo test test_delete_record -- --nocapture
cargo test test_delete_dns_zone -- --nocapture

NAT Gateway Operations

cargo test test_create_nat_gateway -- --nocapture
cargo test test_list_nat_gateways_rg -- --nocapture
cargo test test_list_nat_gateways_subscription -- --nocapture
cargo test test_get_nat_gateway -- --nocapture
cargo test test_associate_public_ip_with_nat -- --nocapture
cargo test test_remove_public_ips_from_nat -- --nocapture
cargo test test_delete_nat_gateway -- --nocapture

Application Gateway Operations

cargo test test_create_application_gateway -- --nocapture
cargo test test_list_application_gateways_rg -- --nocapture
cargo test test_list_application_gateways_subscription -- --nocapture
cargo test test_get_application_gateway -- --nocapture
cargo test test_stop_application_gateway -- --nocapture
cargo test test_start_application_gateway -- --nocapture
cargo test test_delete_application_gateway -- --nocapture

Notes

Tests assume the Azure account has sufficient permissions to create and manage Azure networking resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Azure Load Balancer, DNS, NAT Gateway and Application Gateway operations

1 participant