Small script to upload a set of files to Azure Blob Storage (using the Azure CLI). Storage tier can be configured. Tested with Debian and Ubuntu
By default, this will look for Proxmox LXC/VM backups (vzdump*.zst) and PVE host config backups (pve-host*.zst) and upload to your Azure storage container every 3 months. It will not overwrite already uploaded backups. Setting up a retention policy in your container is recommended (eg. 1 year)
- An active Azure account
- Create a storage account
- Create a container (where the files will be uploaded)
- Create a storage account
- Download and extract the repo
- Run
install_deps.sh - Run
install.sh - Configure
/etc/Backup2Azure/backup2azure.confaccount_name--> Azure storage account namecontainer_name--> Azure storage container namesearch_dir--> local directory containing the files to upload (can be a mounted directory)tier--> Azure storage tier to use (ARCHIVE, COLD or HOT)
- Run
CreateServicePrincipal.sh <YourAzureSubscriptionId> <YourAzureStorageResourceGroup>to create a service principal that the script will use to authenticate. The script logs you in interactively, creates the SP, and writessp_app_id,sp_password, andsp_tenant_idinto/etc/Backup2Azure/backup2azure.confautomatically.
Service principal client secrets expire (typically after 1–2 years). When AzUpload.sh fails with AADSTS7000222: The provided client secret keys for app ... are expired, run RenewServicePrincipal.sh on the host. It will:
- Prompt you to log in interactively with
az login. - Reset the SP credential for another 2 years.
- Back up the existing config to
/etc/Backup2Azure/backup2azure.conf.bakand updatesp_passwordin place.