Change name of Azure Resource Group -


after new model implemented, of websites belong individual resource groups called "default-web-east" , of sql databases belong individual resource groups called "default-sql-east".

this confusing least.

i rename groups have semantic meaning. group associated sql database , web site in same resource group.

however, not see anyway either. possible?

1) rename resource group? 2) combine existing sql db , website 1 resource group?

edit: can't rename azure resource group.

what can move resources new resource group instead. moving resources in resource group resource group b poor man's rename.

unfortunately not resource providers let move resources between resource groups, , might have strings attached let move resources under conditions.

for azure web apps (previously called azure websites) can move websites related resources in single invocation. "all websites related resources" means resource under provider "microsoft.web". includes websites, app hosting platforms, , certificates in source resource group.


via portal

when viewing group's resources, can use "move" tab screenshot of resource group options in portal

clicking "move" tab show this, allowing choose or create new group: the move tab in resource group on azure portal

via azure powershell

the easiest way use move-azurermresource powershell cmdlet.

the command this:

get-azurermresource -resourcegroupname <sourceresourcegroupname> | move-azurermresource -destinationresourcegroupname <destresourcegroupname> 

source: https://azure.microsoft.com/en-us/documentation/articles/resource-group-move-resources/


via rest api

the other way use moveresource rest api or armclient.

here's api call you'll want make:

post https://<endpoint>/subscriptions/{subscriptionid}/resourcegroups/{resourcegroupname}/moveresources?api-version={api-version}

where {resourcegroupname} source resource group.

i'm pretty sure endpoint should "https://management.azure.com", if use armclient tool take care of endpoint you.

request body:

{    "targetresourcegroup": "/subscriptions/{subscriptionid}/resourcegroups/{targetresourcegroupnamename}",    "resources":    [        "/subscriptions/{id}/resourcegroups/{source}/providers/{namespace}/{type}/{name}",      "/subscriptions/{id}/resourcegroups/{source}/providers/{namespace}/{type}/{name}"    ] } 


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -