Dynamically Add ADLS in Veeam
Disclaimer:
I’m not a professional developer. This guide is intended to demonstrate the “art of the possible” rather than serve as production-ready code. Use this example with caution, and always test thoroughly in your environment before relying on it for critical tasks. Auto-DataLake
Introduction
Managing unstructured data backups in the cloud can be a complex task especially when organizations are leveraging Azure Data Lake Storage Gen2 (ADLS Gen2) across multiple subscriptions, regions, or projects. As the number of storage accounts grows, so does the overhead of manually registering each lake, creating backup jobs, and ensuring nothing gets left behind.
Enter the Auto Datalake script: an automation tool built to dynamically discover ADLS Gen2 accounts in your Azure environment and automatically register them in Veeam, configure them as storage servers, and creat the associated object storage backup jobs.
In this post, we’ll explore how the script works, why it’s useful, and how you can use it to automate and scale your ADLS backup coverage in Veeam with minimal effort.
The Process at a Glance
Looking at the script we can see that there are a few steps we need to follow and walking through the process we can see that the script:
-
Authenticates to Azure using a service principal.
-
Discover all ADLS Gen2 storage accounts across your environment.
-
Connects to Veeam Backup & Replication using the provided credentials.
-
For each storage account:
- Add it as an Azure AD Account in Veeam (if not already present).
- Register it as a Storage Server.
- Create (or update) an Object Storage Backup Job targeting that lake.
Managing Azure Data Lake integrations manually within Veeam can quickly become overwhelming—especially in environments with dozens or even hundreds of storage accounts spread across multiple regions or subscriptions. Each lake requires credential configuration, storage server registration, and backup job creation, which is not only time-consuming but also prone to human error. The Auto Datalake script eliminates these challenges by automating the entire process. It ensures that every eligible ADLS Gen2 account is discovered, properly registered, and backed up—without requiring any manual intervention. This not only saves valuable time for IT and DevOps teams but also guarantees that new or previously overlooked lakes are never left unprotected. By incorporating automation into your backup strategy, you enhance operational efficiency, reduce the risk of misconfiguration, and maintain consistent data protection as your Azure footprint grows.
How It Works
The script is written in PowerShell and uses both Azure PowerShell modules and Veeam PowerShell Module. Here’s the high-level flow:
1. Load configuration from `vars.json`
2. Authenticate to Azure via service principal
3. Discover all ADLS Gen2 accounts
4. Connect to Veeam Backup Server
5. For each ADLS Gen2 account:
- Add Azure AD credentials to Veeam (if needed)
- Register the account as an object storage server
- Create or update a backup job with container-level granularity
The backup jobs are intelligently updated to include any newly added containers in existing lakes—ensuring ongoing protection even as your data structure evolves.
Getting Started
-
Clone the Repository 👉 https://gitlab.com/veeam_scripts/auto-datalake
-
Prepare Your Environment
-
Install Azure PowerShell (
Az
module). -
Ensure Veeam PowerShell snap-ins are available.
-
Set up your vars.json file with:
appId
,tenantId
,secret
- Veeam server, credentials
- Target repository names
-
-
Run the Script
.\auto-datalake.ps1
-
(Optional) Schedule It Use Windows Task Scheduler or another orchestration tool to run it daily or weekly.
vars.json Example
{
"appId": "your-app-id",
"tenantId": "your-tenant-id",
"secret": "your-secret",
"VBRServer": "veeam-server-name",
"VBRUsername": "domain\\username",
"VBRPassword": "password",
"cache": "Your Cache Repo",
"data_repo": "Your Backup Repo"
}
When run successfully, you’ll see console messages for each step—connection success, account creation, storage server registration, and backup job updates.
Here’s an example output:

Conclusion
As organizations grow in scale and complexity, manual backup configuration simply doesn’t cut it anymore. The Auto Datalake script provides an elegant, scalable way to ensure all your ADLS Gen2 accounts are continuously backed up with zero manual effort.
Thanks for reading, I hope you found this guide helpful. As always, stay curious and keep learning!