Skip to content

feat(azure): implement Blob, Queue and File Storage operations#80

Open
hariram4862 wants to merge 11 commits intoc2siorg:mainfrom
hariram4862:feature/azure-storage-services
Open

feat(azure): implement Blob, Queue and File Storage operations#80
hariram4862 wants to merge 11 commits intoc2siorg:mainfrom
hariram4862:feature/azure-storage-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), the Azure Functions implementation (#60), and the Azure networking services implementation (#78 ).

Once those PRs are merged, this PR will only contain the Azure storage services changes.

Closes #79

Summary

This PR adds support for Azure Storage services in RustCloud.

The implementation extends RustCloud's Azure capabilities by adding support for Azure Blob Storage, Queue Storage, and File Storage.

Azure storage container operations were implemented previously (#34). This PR extends Blob Storage support by adding blob-level operations and also introduces Queue Storage and File Storage support.

Implemented Services

  • Azure Blob Storage
  • Azure Queue Storage
  • Azure File Storage

Implemented Operations

Blob Storage Operations

Container operations already implemented (#34):

  • List Containers
  • Create Container
  • Delete Container

Blob operations added in this PR:

  • Upload Blob
  • List Blobs
  • Delete Blob

Queue Storage Operations

  • Create Queue
  • List Queues
  • Delete Queue
  • Send Message
  • Receive Messages

File Storage Operations

  • Create Share
  • List Shares
  • Delete Share
  • Create Directory
  • Delete Directory
  • List Files
  • Create File
  • Upload File Range
  • Download File
  • Get File Properties
  • Delete File

Methodology

Azure Storage resources are managed using the Azure Storage REST API.

Authentication is implemented using Azure Storage Shared Key authentication, where the Storage Account Name and Storage Account Key are used to generate the authorization header for each request.

The authentication logic is implemented in:

src/azure/azure_apis/auth/azure_storage_auth.rs

This module generates the required Shared Key Authorization headers used by Azure Blob, Queue, and File Storage REST APIs.

Environment Variables

Before running tests, set the following environment variables.

Linux/macOS:

export AZURE_STORAGE_ACCOUNT=<storage-account-name>
export AZURE_STORAGE_KEY=<storage-account-key>

Windows PowerShell:

$env:AZURE_STORAGE_ACCOUNT="<storage-account-name>"
$env:AZURE_STORAGE_KEY="<storage-account-key>"

Running Tests

Blob Storage

cargo test test_list_containers -- --nocapture
cargo test test_create_container -- --nocapture
cargo test test_delete_container -- --nocapture
cargo test test_upload_blob -- --nocapture
cargo test test_list_blobs -- --nocapture
cargo test test_delete_blob -- --nocapture

Queue Storage

cargo test test_list_queues_storage -- --nocapture
cargo test test_create_queue_storage -- --nocapture
cargo test test_delete_queue_storage -- --nocapture
cargo test test_send_message -- --nocapture
cargo test test_receive_messages -- --nocapture

File Storage

cargo test test_list_shares_storage -- --nocapture
cargo test test_create_share_storage -- --nocapture
cargo test test_create_directory -- --nocapture
cargo test test_list_files -- --nocapture
cargo test test_create_file -- --nocapture
cargo test test_upload_file_range -- --nocapture
cargo test test_download_file -- --nocapture
cargo test test_get_file_properties -- --nocapture
cargo test test_delete_file -- --nocapture
cargo test test_delete_directory -- --nocapture
cargo test test_delete_share_storage -- --nocapture

Notes

Tests assume the Azure storage account has sufficient permissions to create and manage storage 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 Blob, Queue and File Storage operations

1 participant