In a previous post we discussed the “Deploy to Azure” button and how you could add it to your README.md file in your github repo to enable a more streamlined deployment. Click here if you are interested in reading more about that. Today I wanted to share you with a button called “Visualize”.
With “Visualize” you get a visual representation of the resources being deployed in your template and how they fit together. This could come in handy for those larger more complex deployments with many resources. Many of us relate more so to graphical representations than we do with text. I have seen some people create a Visio diagram of their deployment, capture a screen shot, and paste into the README.md file. This works perfectly fine but does create more work for you and each persons skills with Visio could vary, as well as the icons used. With the “Visualize” button we get consistency, less work for ourselves, and easier to manage when changes are made to our templates.
Let’s discuss how we can add the button. Just as we did with the “Deploy to Azure” button, you will need to copy the code below and insert into your README.md file. Copy the Raw URL for your azuredeploy.json template and paste over the URL in my example.
1 2 3 |
<a href="http://armviz.io/#/?load=https://raw.githubusercontent.com/DarylsCorner/ARM-Templates/master/vm-from-user-image/azuredeploy.json" target="_blank"> <img src="http://armviz.io/visualizebutton.png"/> </a> |
Unlike the “Deploy to Azure” button, we do not need to be concerned with doing URL encoding for the “Visualize” button. When placing the code in the README.md file you can either place it directly after the “Deploy to Azure” button if you desire the buttons to be on the same line, as seem below.
Or you can insert a break (<br>) between the “Deploy to Azure” and the “Visualize” hyperlink tags and the buttons will be on separate lines, as seen below.
If you want to include both buttons at once you can copy the code below and replace the URLs as mentioned previously. Be sure to use URL encoding for the “Deploy to Azure” button.
1 2 3 4 5 |
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FDarylsCorner%2FARM-Templates%2Fmaster%2Fvm-from-user-image%2Fazuredeploy.json" target="_blank"> <img src="http://azuredeploy.net/deploybutton.png"/> </a><a href="http://armviz.io/#/?load=https://raw.githubusercontent.com/DarylsCorner/ARM-Templates/master/vm-from-user-image/azuredeploy.json" target="_blank"> <img src="http://armviz.io/visualizebutton.png"/> </a> |
So let’s take a look and see what the “Visualize” button displays. Upon clicking the button you will be redirected to the Azure Resource Manager Template Visualizer (ArmViz) site. As you can see below we are presented with a visual representation of our template. How cool is that? My example is very simple but you could see how this could be helpful for larger deployments.
In addition to being able to see the resources that you have declared within your ARM JSON template, you also have the capability to edit and validate directly from this representation by double-clicking on a resource. You can add resources by simply clicking on a resource from the toolbox and dragging it onto the canvas. You can open existing templates as well as edit and download the parameters file. When you are done you can download the ARM template and there is an option to actually create the “Visualizer” button for you.
Instead of me trying to explain all the capabilities here, check out this YouTube video by Jason Young, the creator of this project.
I expect this project to improve over time but so far its pretty neat. I hope this has been helpful and you find it useful.