Is there a way to force the naming of resources that automatically gets setup within Azure?

Desmond Richard 11 Reputation points
2021-05-17T08:18:30.237+00:00

Good Day

At times there are resources that gets automatically created from within ARM. That are dependencies to other resources you create. Or at times you cannot set the name of a particular service. For example the Gateway subnet will always be called GatewaySubnet. Or the automation accounts that gets created during a replication/DR setup. Or when you create a VM the osdisk is always called OsDisk_11111111

Just to help keep consistency to all names. Is there a way to force the naming of resources that automatically gets setup within Azure? Even if its just to force all names to be lowercase.

Thanks

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
911 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Prashant Kumar 780 Reputation points Microsoft Employee
    2024-08-07T09:38:08.7066667+00:00

    Hi EPNAdam,

    We can apply Azure policy to restrict or audit resource groups if they don't follow any naming convention.

    resource groups with naming conventions like these .. AzureBackupRG_westeurope_1 are created by Recovery Service Vaults to create and store restoredpoints of VMs that are being backed up and they are automatically created by them.

    We can control the naming convention of these RGs created by RSV from the option below though.

    User's image

    User's image

    You can either update the RG name as per your requirement here or apply Deny policy so that whenever RG is being created by RSV, the policy will deny the RG creation request and user will be asked to update the RG name here with the required naming convention.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.