AZ-104 Question 44
Single answerYou manage an Azure environment with multiple resource groups, including one named 'TestServicesRG' that hosts development resources for a soon-to-end project. You want to rename this resource group to 'DevServicesRG' while preserving the existing resources. What is the recommended way to accomplish this with minimal disruption?
- A
Use Azure CLI to rename the resource group by running the 'az group update --name' command
- B
Create a new resource group named 'DevServicesRG' and move the resources from 'TestServicesRG' to the new group
- C
Migrate all resources to a new subscription and assign the subscription a new name
- D
Modify the name of the resource group directly within your existing ARM template
Show answer and explanation
Correct answer: B
Explanation
Azure does not offer a direct rename feature for resource groups. The safest and most efficient method is to create a new resource group with the desired name and then move your resources there.
- A. Incorrect.
The 'az group update' command cannot rename an existing resource group; it only updates tags or locks.
- B. Correct.
Creating a new resource group and moving the resources is the recommended approach to effectively 'rename' a resource group while maintaining continuity of resources.
- C. Incorrect.
Moving resources to a new subscription is unnecessary unless you need to change the subscription itself, not just the resource group name.
- D. Incorrect.
Simply editing the ARM template does not rename existing resource groups. Azure does not allow renaming resource groups directly.