Last Updated on April 1, 2025 by Arnav Sharma
Azure provides limited options for renaming resources after they are created. This can be challenging when you need to standardise naming conventions or make changes in an established environment. Below is an overview of which Azure resources can be renamed, which cannot, and potential workarounds.
Renamable Resources in Azure
Azure Subscriptions
Azure subscriptions can be renamed without affecting their functionality or connected resources.
How to Rename Subscriptions:
- Using Azure Portal
- Go to Cost Management + Billing.
- Select the subscription you want to rename.
- Click the rename option, provide a new name, and save the changes.
- Using PowerShell
- Use the
Rename-AzSubscription
command to rename a subscription programmatically.
- Use the
Renaming a subscription only changes its display name while retaining the same subscription ID. This operation does not affect the resources within the subscription.
Non-Renamable Resources
Resource Groups
Resource groups cannot be renamed directly in Azure.
Workaround: Create a new resource group with the desired name, move resources from the old group to the new one, and then delete the original resource group.
Most Azure Resources
The majority of Azure resources cannot be renamed after creation. This includes:
- Virtual Machines
- Storage Accounts
- Virtual Networks
- Application Gateways
- And many others
The limitation exists because resource names are often used as unique identifiers and may also be part of DNS names or resource IDs.
Workarounds for Non-Renamable Resources
1. Recreate the Resource
Create a new resource with the desired name and identical settings, migrate data/configurations as needed, and delete the old resource.
2. Move Resources Between Resource Groups
If only the resource group name needs to change, move resources to a new group with the desired name.
3. Use Friendly Display Names with Tags
Add a “friendly name” using tags such as hidden-title
. This does not change the actual resource name but helps with visual identification in the Azure Portal.
4. Specialized Renaming for Virtual Machines
For Virtual Machines, scripts can help:
- Disconnect dependent resources.
- Create a new VM with the desired name.
- Reattach all dependent resources.
- Delete the original VM.
This approach requires careful planning and testing.
Best Practices for Naming in Azure
- Plan Naming Conventions Before Deployment
- Establish clear naming conventions before creating resources.
- Document and follow these conventions consistently.
- Use Infrastructure as Code
- Define resources using tools like ARM templates, Bicep, or Terraform.
- This makes recreating resources with new names more manageable.
- Design for Replaceability
- Treat cloud resources as replaceable.
- Ensure configurations can be easily replicated if renaming is required.