/RGCOPY

script for copying an Azure Resource Group

Primary LanguagePowerShellMIT LicenseMIT

RGCOPY

RGCOPY (Resource Group COPY) is a tool that copies the most important resources of an Azure resource group (source RG) to a new resource group (target RG). It can copy a whole landscape consisting of many servers within a single Azure resource group to a new resource group. The target RG might be in a different region, subscription or tenant. RGCOPY has been tested on Windows, Linux and in Azure Cloud Shell. It should run on MacOS, too.

RGCOPY has been developed for copying an SAP landscape and testing Azure with SAP workload. Therefore, it supports the most important Azure resources needed for SAP, as virtual machines, managed disks and Load Balancers. However, you can use RGCOPY also for other workloads.

RGCOPY is not an SAP deployment tool. It simply copies Azure resources (VMs, disks, NICs ...). It does not change anything inside the VMs like changing the server name at the OS level or applying SAP license keys.

RGCOPY has 3 different operation modes. By default, RGCOPY is running in Copy Mode.

In Copy Mode, an ARM template is exported from the source RG, modified and deployed on the target RG. Hereby, you can change several resource properties in the target RG:

In Archive Mode, a backup of all disks to cost-effective BLOB storage is created in an storage account of the target RG. An ARM template that contains the resources of the source RG is also stored in the BLOB storage. In this mode, no other resource is deployed in the target RG.

In Update Mode, you can use RGCOPY for changing resource properties in the source RG rather than copying a resource group. For example, you can convert all disks to SKU Standard_LRS for saving costs of stopped VMs.

The following example demonstrates the user interface of RGCOPY in Copy Mode:

$rgcopyParameter = @{
    sourceRG        = 'contoso_source_rg'
    targetRG        = 'contoso_target_rg'
    targetLocation  = 'eastus'
    setVmSize       = 'Standard_E32s_v3'
    setDiskSku      = 'Premium_LRS'
}
.\rgcopy.ps1 @rgcopyParameter

"RGCOPY"

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.