官术网_书友最值得收藏!

  • Learn Azure Administration
  • Kamil Mrzyg?ód
  • 464字
  • 2021-06-11 18:14:30

Moving resources

Now, let's assume you have a resource in one resource group and want to move it to another one. There are a few possible scenarios when you would do so:

  • If you simply made a mistake and provisioned a resource in an invalid resource group
  • If you found resources that have a different life cycle and want to differentiate between deployments
  • If you are redesigning an application and want to separate resources related to different domains
  • If you do not want to perform a redeployment to place resources in a different resource group

In Azure, this operation is really simple – all you need to do is gather the following parameters:

  • Destination group: A place where resources should be moved to
  • IDs of resources: The identifiers of the resources you want to move

For example, I want to move an Azure Logic App named azureadministrator-euw-logicapp to a resource group named azureadministratornew-euw-rg.

The following is the full command I used to perform this operation:

$ az resource move --destination-group "azureadministratornew-euw-rg" --ids "/subscriptions/.../resourceGroups/azureadministrator-euw-rg/providers/Microsoft.Logic/workflows/azureadministrator-euw-logicapp"

The preceding command moves a specific resource (identified by its identifier) to a destination group inside the same subscription. Note that while moving the resource, a notification will appear in Azure portal stating that an operation is ongoing and that a certain resource may be moved in a moment, as shown in the following screenshot:

Figure 2.6: View of the resource group with resources under the Move operation
Remember that you  cannot  rename a resource group – if you misspell a name, the only way to change it is to create a new one and move the necessary resources to it. Also, not all resources can be moved. The full list can be found at  https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-move-resources.

When the operation is completed, all the resources that were moved will have new IDs attached to them. The move operation does not break anything from a service point of view. However, you will have to remember to update your CI/CD pipelines if they deploy anything to Azure – in most cases, you are providing a resource group name, which will have to be updated in that case.

The move operation can be also used to move resources between subscriptions. This is a very helpful feature when you want to, for example, promote an environment from dev to production or use different subscriptions for different projects.

Before we sum up managing resource groups, there is one more concept worth mentioning. Each individual Azure service is managed by its API, called a resource provider. Each individual instance of a service is represented by a unique identifier called a resource ID. To understand how to build such an identifier, we must see what a resource provider identifier looks like.

主站蜘蛛池模板: 永靖县| 治多县| 恩平市| 朝阳县| 肇源县| 额尔古纳市| 莱州市| 周至县| 通城县| 普陀区| 棋牌| 岳普湖县| 名山县| 高唐县| 朝阳市| 鹤庆县| 平阴县| 隆林| 从化市| 灯塔市| 凤山县| 陈巴尔虎旗| 高唐县| 阿克陶县| 闵行区| 金门县| 蓬安县| 家居| 龙口市| 泌阳县| 玉溪市| 神木县| 侯马市| 满洲里市| 锦州市| 抚顺县| 无为县| 西乌| 惠东县| 丹凤县| 喀什市|