My team works a lot with ARM Templates to deploy and maintain Azure-based applications and infrastructure. We normally develop ARM Templates using Visual Studio Code, then manage and release the code using Azure DevOps. Sometimes we hand over code to customers that are less experienced. Having a way for them to visualize the code is very helpful and helps them to understand the code better. Lately, a new extension has been released for Visual Studio Code by Ben Coleman. It’s a very handy extension because it allows you to immediately visualize your code without leaving the tool.
The extension “ARM Template Viewer” from Ben Coleman can be installed from the marketplace from Visual Studio Code. After a few seconds the extension is ready to be used. Read the extension documentation for more details.
Simple ARM Templates
Once you open an ARM Template in Visual Studio Code, you will see a visualizer Icon on top right. Just click it to make the magic happen.
The following example shows a simple ARM Template that deploys and manages a Storage Account. Using the extension, I can easily visualize the template and by clicking on a resource also get access to all details of the containing resources.
Linked ARM Templates
Linked ARM Templates are harder to read because the service is kind of decomposed into multiple components and files. We often use linked ARM Templates to code services because it gives us lots of flexibility. The extension can also handle linked templates in various ways. The following example shows a simple, cloud-native app we built for demo purposes. Every single resource lives in it’s own resource template. A single deployment template that contains all details and dependencies is used to orchestrate the deployment process. The extension can display all resources, no matter if they need to be accessed by using a URI or if they live in a local directory. The solution is pretty flexible and the extension documentation will tell you all details.
It’s a really nice and handy, perfectly integrated extension to visualize ARM Templates. I will give it a try in the next weeks and (if needed) come back with another article. Again, kudos to Ben for developing this great extension!