Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clone a resource group

So, I've setup a lab environment in a azure resource group with a domain controller, sql-server and a web server. I would like to clone that whole resource group to a new one when needed and by stat I mean with everything intact. Is that possible?

like image 863
pezmannen Avatar asked Apr 20 '16 16:04

pezmannen


People also ask

Can we clone resource group from Azure?

Azure Resource Manager templates are a great place to start for teams that want to clone existing resource groups, which are sets of related Azure resources. Admins can repeatedly deploy templates and consistently build workflows via an API call or button-click in the Azure Portal.

Can I move a resource group to another subscription?

You can move Azure resources to either another Azure subscription or another resource group under the same subscription. You can use the Azure portal, Azure PowerShell, Azure CLI, or the REST API to move resources. To learn more, see Move resources to a new resource group or subscription.


1 Answers

I don't know of anyway to do a direct copy, but you can export a JSON template from the portal or PowerShell that will come close to giving you something you can automate. I say "close" because the feature is still in preview and some resources can't be exported.

In portal.azure.com go to: Resource Groups > [your rg] > Settings > Export...

In PowerShell see:

Export-AzureRMResourceGroup
like image 144
bmoore-msft Avatar answered Sep 19 '22 12:09

bmoore-msft