Skip to content

brunopedrazza/blob-file-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blob File Management

A command-line utility to manage files in Azure Blob Storage with Git-style commands: pull, push, and diff.

Features

  • Pull: Download a file from Azure Blob Storage.
  • Push: Upload a local file to Azure Blob Storage.
  • Diff: Compare local and remote files with colorized output.

Requirements

  • Azure CLI: Install Azure CLI
  • Git: For colorized diffs if colordiff is unavailable.
  • Bash or Zsh: Works in both environments.

Setup

  1. Clone the Repository:

    git clone https://github.com/brunopedrazza/blob-file-management.git
    cd blob-file-management
  2. Environment Variables: Create a .env file in the project’s root with:

    AZURE_STORAGE_ACCOUNT_NAME="your_account_name"
    AZURE_STORAGE_CONTAINER_NAME="your_container_name"
  3. Alias and Path: Add these to your ~/.bash_profile, ~/.bashrc, or ~/.zshrc:

    export BLOB_ENV_PATH="$HOME/path/to/your/project/.env"
    alias blob='bash $HOME/path/to/your/project/blob'

    Reload your profile:

    source ~/.bash_profile  # or ~/.zshrc for zsh
  4. Optional - Install colordiff for Colorized Diff:

    # macOS
    brew install colordiff
    
    # Ubuntu/Debian
    sudo apt-get install colordiff

Usage

  • Pull:

    blob pull <local_file_path>
  • Push:

    blob push <local_file_path>
  • Diff:

    blob diff <local_file_path>

Troubleshooting

  • Authorization: Ensure you’re logged in:

    az login
  • Blob Environment Path: Verify BLOB_ENV_PATH points to the correct .env location.

Uninstall

Remove the alias and environment variable from your profile and reload:

source ~/.bash_profile  # or ~/.zshrc for zsh

About

A git-like blob file management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages