What if you don't have naming conventions with Azure CDN

What if you don't have naming conventions with Azure CDN header image

Working on a customer we had an interesting issue today. We started building stuff for them years ago and at that point we didn’t invest to much in naming conventions. So we all know the drill; the project grows, we started implementing those naming conventions and best practices and all is good. Yet you never come around to update some of the existing stuff out there. So today we had to configure a storage account and link it to a CDN endpoint.

⛔ No naming conventions

So the goal was to use an existing CDN endpoint on our storage account. We went through the UI however when selecting the CDN profile it turns out we created a profile with the same name both in our Dev and our Prod environment, but the UI did not show us a difference..

Azure UI shows the CDN profile name for both resource groups

Now this is of course a great reminder that you should use naming conventions to differentiate between dev and prod. But we also did not have the time to change to much. So in order to work around the issue we figured we would have a look at the HTML hoping to make some sense of it all.

Azure UI HTML not showing what resources are being used

However the HTML it self did not reveal anything. There is no identifier, guids or anything else to make sense of what the actual value is. Only the CDN Profile name is visible and thats it. We did have a final check left, turning on the network trace and see what happens when you select a value in the drop down. Whenever you pick an option you can find a checkResourceUsage call being made that does contain the subscription id, resource group name and profile name.

Check resource call in the Azure Portal

This call was exactly what we needed to validate the option we should pick, just pick one of your options, check the call and validate if the request URL points you to the correct subscription and resource group. If not? Pick the other option. Rest assured that the proper fix is to implement a correct profile naming convention and it has been put on the backlog but if you are ever in a hurry and need to know what option to pick? Crank open the developer tools and capture the network trace to make sure you pick the right one! 🔥

Loading comments…