As opposed to a subscription, the name of a resource group cannot be changed once it has been created. The solution for this situation is to move the resources to a new resource group and delete the old one. To minimize the number of such situations, you should provide a proper recommendation when it comes to selecting names for groups. One extra parameter that will be useful here is called location.
Let’s check out some examples of templates for resource groups names:
<product>-<location>-<environment>-rg <product>-<location>-<environment>-resourcegroup <company>-<product>-<location>-<environment>-rg <company>-<department>-<location>-<environment>-resourcegroup
Whether you need to use a company name in the resource group name depends on your setup. If you govern a single subscription, it will need to know who the owner of the resource group is immediately. Let’s assume that you have the following names:
ServiceA CompanySuperproduct WestEuropeCompanyC
In the preceding example, you are missing some key information. Let’s try to answer the following questions:
- Which resource group is provisioned in West Europe?
- Which resource group belongs to CompanyB?
- Where ServiceC is deployed?
- What environments are deployed to the listed groups?
You cannot answer any of those questions with 100% confidence knowing that your answer is correct (what’s more, providing an answer to the last question is impossible without checking the deployment pipelines). This is why using a proper naming convention is so important.