Archiving Azure Resource Groups to cost-efficient BLOB Storage

Published Feb 28 2022 11:26 PM 1,879 Views

In addition to productive workloads, Azure is often used as a test environment. In Azure Development, we have created lots of different SAP landscapes for testing SAP workload. Each landscape has its own Azure Resource Group. Some of these resource groups are very huge and are used very seldom. Therefore, their VMs are stopped most of the time for saving costs. However, several TiB of Premium Storage disks are still occupied. It would be a good idea to move the disks to cost-efficient storage as long as the VMs are not used.



The Open Source tool RGCOPY introduced two new operation modes for this purpose:


RGCOPY Update Mode

In Update Mode, you can easily change the SKU of all disks in a resource group to Standard SKU (and back to Premium SKU). The command looks like this:

$rgcopyParameter = @{
    sourceRG        = 'contoso_source_rg'
    updateMode      = $True
    setDiskSku      = 'Standard_LRS'
.\rgcopy.ps1 @rgcopyParameter

You can change lots of other resource properties in RGCOPY Update Mode, too. For example, VM size, disk size, disk Performance Tier, disk caching, and Accelerated Networking. In addition, you can change the service level of Azure NetApp volumes.


RGCOPY Archive Mode

In Achive Mode, you can copy all disks to the BLOB storage of a storage account. You can use the same storage account for archiving different resource groups. Therefore, RGCOPY creates a separate storage account container for each archived resource group. The command looks like this:

$rgcopyParameter = @{
    sourceRG         = 'contoso_source_rg'
    targetRG         = 'contoso_backup_rg'
    targetLocation   = 'eastus'
    archiveMode      = $True
    archiveContainer = 'contoso-source-rg'
.\rgcopy.ps1 @rgcopyParameter

In addition, RGCOPY creates an ARM template that can be used for restoring the archived resource group directly from the BLOB storage. The ARM template is also stored in the BLOB storage. This ARM template can be deployed to a different resource group, too. Hereby, you can create a copy of the original resource group in RGCOPY Copy Mode (which was the original purpose of the tool RGCOPY).

Version history
Last update:
‎Feb 28 2022 11:24 PM
Updated by:
We support Ukraine and condemn war. Push Russian government to act against war. Be brave, vocal and show your support to Ukraine. Follow the latest news HERE