Azure Resource Naming Convention

All Azure users, especially after the Classic-to-ARM switchover, have noticed this... There are a lot of different resource types, even for a simple deployment. Naming them becomes critical to find the appropriate resource, especially in an emergency. To make matters worse, there are a lot of similar resource types which, if you're not careful, you may end up naming the same. Need a couple of new Virtual Machines? You have to name the availability group, storage accounts, load balancer, resouce group and more.

Here is a summary of my recommendations for naming the most common types of resources (based on Microsoft guidelines).

Overall

Feel free to use suffixes or prefixes to describe the resource type within the name. Back in the old days of programming, we used to name variables with a prefix denoting the type. This was to make it absolutely clear how a variable was defined (usually in a different file) so that the code is more maintainable. With recent IDEs, this isn't needed any longer and the convention was dropped to favour shorter more readable code. In Azure, prefixes help because sorting a list of resources by name automatically groups resources by type, but sometimes (ex. storage accounts for VM disks) the first letter is used for something else. Therefore, suffixes are fine. For example, use rg for resource groups or sqldb for SQL Databases. Also, you may want to come up with two service names: one being the full name and one is a short equivalent. At times, you will have space to write the whole awesome-product-name-that-is-very-awesome and sometimes you just want to refer to it via the short name. Otherwise, just choose a short one.

Subscriptions

I suggest creating a subscription to keep logical boundaries between different resources. It's ultimately up to you to decide if to create a new subscription or use an existing one, but the main decision factor usually boils down to billing. Need absolute isolation between resources? Then you need a new subscription. Even if they are for the same company or product, if you keep separate budgets for production and development, you probably need a new subscription. Subscriptions are free so make use of them. There is a limit on the maximum number of subscriptions, but it's usually high enough not to be a problem. Besides, usually it is quite straightforward to move a resource from one subscription to another after the fact, either from the portal/powershell or through azure support. You do have an Azure support subscription, right?

Clear naming for your subscription is important. I suggest including the following things: Company Name, Product or service and environment (prod/stg/test/dev)

ex: MarbleHouse MarbleOrdersSite Prod

Resource Group

The aim or resources groups is to group multiple resource types together. Usually, we call this a deployment. Any resource being used for the same end objective, we should group it under the same resource group. Keep the name short and sweet (but recognisable) and put all related resources together.

ex: ordersite-prod-rg

Availability Set

Make sure you include the short name of the service and the role, especially in a layered infrastructure.

ex: ordersite-frontend-as, order-site-sql-as

Virtual Machine

I suggest putting the short name of the service as well as the role. Use VMx when you have multiple VMs with the same role.

ex: ordersite-frontend-vm1, ordersite-frontend-vm2

App Service (Web App/Function/Bot)

This is tricky because it needs to be unique across of Azure. I suggest have a company prefix (to make it rather unique) and add the app name. You may also want to add the type of app service it is (function, app or bot etc.). Remember that app services can also have slots.

ex: marbles-ordersite-app

Storage Account for Blobs/Tables/Files/Queues

Again, this one needs to be unique across of Azure. Adding a company prefix helps make it unique. Some people prefer to use GUIDs for storage account names, especially those created programmatically though that is definitely not readable.

Storage Account for VM Disks

Similarly for storage accounts for blobs/tables/files/queues, this needs to be unique. However, if you're using storage accounts to support your VM availability group, I suggest creating a storage account per VM to avoid 1) having a performance bottleneck your VM set and 2) if the storage account goes down, the effect should be limited to one VM only. Microsoft also suggests to have a different first character for each storage account to ensure that each account is created in a different Azure storage 'stamp'. A 'stamp' is a collection of storage accounts with the same hardware dependencies. Therefore, I suggest a naming convention whereby the first letter is the VM's index number.

ex: 1marbles-vm-sa, 2marbles-vm-sa

Storage Table

Annoyingly, table names have a lot of restrictions, including not supporting the hiphen character, and are lower case only. Luckily they don't need to be globally unique (just unique for your storage account). Therefore keep them short and readable.

ex. marblesservicelogs

VNet

This is one of those resources that if you get wrong, is difficult to correct. Changing VNet details once your VMs are deployed is annoying and sometimes requires you to recreate the VMs themselves. Make sure you include the service name, but keep in mind that eventually, you may want to connect different VMs/services to the same VNet. Remember to name your subnets too (but these should be simple).

ex. marbles-vnet

If you need to save additional information, each resource can have a maximum of 15 tags. Each tag name is limited to 512 characters and each value can have up to 256 characters. Perfect for scripting. Use them wisely.

You can use any convention that makes sense to you but it also makes sense to see what's out there, especially if you're starting anew. Whatever the case, before you start any project, create your own policy (WRITE IT DOWN) and stick to it. Changing policy usually means that you need to go through the services and rename them (when possible), so starting with a good policy makes absolute sense. Be consistent!

Here's Microsoft's Best Practices: Naming Conventions: https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions

Recent Posts

  • Azure Resource Naming Convention

    All Azure users, especially after the Classic-to-ARM switchover, have noticed this... There are a lot of different resource types, even for a simple deployment. Naming them becomes critical to find the appropriate resource, especially in an emergency. To make matters worse, there are a lot of similar resource types which, if you're not careful, you may end up naming the same. Need a couple of new Virtual Machines? You have to name the availability group, storage accounts, load balancer, resouce …

    Read More...
  • The Global Azure Bootcamp 2015 - Malta!

    Malta is on the map once again for the Global Azure Bootcamp, a one-day deep-dive training into the Microsoft Azure cloud.

    From my last count, there will be 184 locations in total participating in this event around the world, from Hawaii to Japan! (Malta is bang in the middle!) And as usual, I'm again at it!

    The bootcamp will be on April 25th 2015 (hey that's tomorrow! I suck with keeping my blog updated!) and will be held at the Microsoft Innovation Centre at Skyparks, Luqa (just …

    Read More...
  • SEO Tip: How to block the *.azurewebsites.net domain

    Are you using Azure Websites to host your sites? Great! Then you know that whenever you deploy a website on Azure websites, you get the mysite.azurewebsites.net URL.

    The sub domain is great for you to test your application, but most probably you have your own domain that is mapped to the site. However, the azurewebsites.net domain is still there and still works! Do you know that this can be a problem?

    One of the rules in the SEO bible says that each page should only have one URL. Your …

    Read More...
  • Free eBook: Microsoft Azure Essentials - Fundamentals of Azure

    A great book on the fundamentals of Azure. If you're new to Azure, this is a great start. Get it now!

    The topics explored in this book include:

    Getting started with Azure: Understand what cloud computing is, visit the management portals, and learn about billing.

    Websites and Cloud Services: Learn about Azure Websites, from deployment to monitoring, and gain an understanding of the web and worker roles used in Azure Cloud Services.

    Virtual Machines: Explore the basic …

    Read More...
  • When Azure broke down...

    ... the world shook in terror on the 19th November 2014. 

    That means two things: firstly, the importance of a public cloud platform such as Azure.

    When such a huge thing gets a hiccup, a lot of people stress out. And they should. A lot of businesses nowadays depend on public cloud services (be it AWS or Azure), and each business trusts the availability of their service to these skilled engineers. It's true, Microsoft (or Amazon) do not own your availability promises. (You can check …

    Read More...
  • How to protect against POODLE attacks!

    Maybe you've heard about HEARTBLEED or SHELLSHOCK. POODLE is the next one.

    Anyone using Windows Server and IIS was lucky enough to avoid both HEARTBLEED (openssl library vulnerability - CVE-2014-0160) and SHELLSHOCK (unix bash shell vulnerability - CVE-2014-6271). However, POODLE hits everyone.

    What is POODLE?

    POODLE, spelled in caps to distinguish from our furry canine friends, stands for "Padding Oracle On Downgraded Legacy Encryption". It is a type of man-in-the-middle exploit …

    Read More...
  • Quick Tip: How to output custom error messages on Azure Web Sites

    You've published your latest masterpiece to Azure Web Sites. Great! How was it? Not bad!

    Now, does your application output its own error messages (HTTP 500, 404 etc?) IIS will by default hide your errors with the message:

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    If you want to output your own custom output for non-200 statuses, you need to put this in your web.config:

      <system.webServer>

        < …

    Read More...
  • Azure icons in Visio

    Building any cloud apps lately? Great!

    Documenting them? Not so...

    Firstly, make sure you're using the best tools of the trade: Microsoft Visio. It's by far the easiest and most powerful tool for diagrams.

    Wanna add Azure-specific icons? Yeah, I know it's difficult to find them... But here's a secret: Visio supports SVG.

    What does that mean, you ask? Well, it seems that the current azure site uses SVG for the majority of icons. If you want to use a particular Azure icon, just find the …

    Read More...
  • How to migrate legacy apps to Microsoft Azure (part 1)

    How to migrate legacy apps to Windows Azure

    I see a lot of interest by startups to start using Windows Azure to power their products. It's the perfect platform to start small and have room to scale quickly and easily. But the most important advantage that startups have, is not having to worry about legacy issues. 

    A lot of companies would like to start using the cloud. By now, we know what the advantages are: scalability, resiliency, low management overhead, low service costs, etc. …

    Read More...
  • How to put a robots.txt file in your Windows Azure Blob Storage domain

    Google or Bing is indexing your public blobs on Windows Azure Blob Storage? Here is how to stop it...

    The idea is to put a robots.txt file at the root of the Azure Blob Storage domain. ie: http(s)://myaccount.blob.core.windows.net/robots.txt

    Follow these steps:

    1. Create a new container in your storage account in question. Name it $root and allow public access to blobs. This is a special container that serves as a default container for the storage account. Any blobs in this container may …

    Read More...