Developing Custom Dashboards in Azure

Whether you’ve been working with Azure for years or are just getting started, you’ll often find yourself starting at the Dashboard blade as you work in the Azure Portal. Every time you login, as you’re navigating around and working through various tasks, after you’ve spent your entire 8 hour day trying to build out or troubleshoot an application, the Dashboard will always be there along for the ride. Building a custom Dashboard can enable you to quickly consume relevant information, identify issues, and make navigating the Azure Portal a much more enjoyable experience. In this post we’ll explore some of the ins and outs of Dashboard templates as well as some of the features available for working with Dashboards.

Custom Dashboard Sample

This is the default Dashboard that I use for my personal Azure environment. I’ve kept the Dashboard simple, but effective, for my purposes. I’ve embedded my logo, links to some Azure documentation that I visit regularly, the “All Resources” tile to quickly access Resources I’ve recently been working with, an Application Insights availability test that monitors the availability of the cooperscloud.tech site, and an image of a Sample Azure application architecture.

Methods for Creating and Developing Dashboards

In this post we’ll focus on developing and working with Dashboards in code, but Azure provides numerous methods to customize your Dashboard within the Portal:
– Using the Dashboard editor
– Manually pinning Azure Resources to your dashboard
– Developing a Dashboard in JSON and uploading to the portal
– Auto-generating Dashboards that come pre-configured within certain Azure Services (i.e. Application Insights)

Download Existing Azure Dashboards

Existing Dashboards can be downloaded in JSON format from the Dashboard page. This feature provides the ability to manually customize a Dashboard and then save and re-deploy the Dashboard as code. This feature can be really useful when you want to quickly understand how a Tile is formatted before re-writing the code.

Develop Custom Azure Dashboards

Although the Dashboard editor is fairly easy to work with, once you can get the hang of defining Dashboards in code, you’ll have much more flexibility in creating meaningful and reusable Dashboards.

The code for the sample Dashboard in this post can be found here: https://github.com/cooperlutz/cooperscloud/blob/master/azure-dashboards/coopersclouddashboard.json.

Within the sample code, the sections should look fairly familiar if you have previously worked with Azure ARM Templates. The Dashboard definition starts with a name, type, location, and API version, and we define all of our tiles within the Properties object.

Within the properties object is a single “lenses” object where we define a “0” object, which contains a parts object, which identifies each of our tiles by number, and THAT’s where we define our tiles. It’s a little bit confusing but the reason it’s currently defined in this manner is to provide capabilities for future updates to Dashboards (which is always exciting!) My guess is that the lenses will provide a sort of page feature that you can switch between within a single Dashboard (kind of like an image slider on a web page). However, this is purely speculation and my personal opinion of what I’d like to see. But for now, we get 1 Lense. If you’d prefer to just skip over all of the confusion, I’ve provided a template sample that you can start with: https://github.com/cooperlutz/cooperscloud/blob/master/azure-dashboards/baseDashboard.json.

https://github.com/cooperlutz/cooperscloud/blob/master/azure-dashboards/baseDashboard.json.

Taking a further look at the Tile definition, the first JSON object defined is the Tile’s “position”, giving us the ability to control the size and location on the Dashboard grid. The image below displays the Dashboard “edit” view and displays the Dashboard grid. The second part of defining our Tile is the “metadata” object, which is where we define the type and content of the Tile.

The first tile defined in the Sample Dashboard is a Markdown tile which gives us the ability to create and format freeform text in Markdown syntax. In this case, I used this Markdown tile for the sole purpose of embedding my logo.

Now in the case above for linking to a logo, I just linked directly to the image hosted on my website, but for the Sample Application Architecture tile, I link to an Azure Storage Account blob with a SAS token. In this way, I could link to proprietary images, such as application architectures deployed in my Azure environment, reference documentation to my applications, etc.

Once we’ve defined all of the tiles in our Dashboard, all we have to do is save the file and click the “Upload” button from the Dashboard blade. We’ll be prompted to choose the file to upload and then the Dashboard will be deployed and populated!

Share Azure Dashboards

Once you’ve created a Dashboard that you’d like to share amongst others who are working in your Azure environment, you can deploy the Dashboard to a Resource Group so that it may be used by others.

Click the “Share” button at the top of the “Dashboard” blade, then choose a name, subscription, and location. By default Azure will create a “dashboards” Resource Group for the Dashboard resource to be deployed to, but you can deploy it to a different RG if you prefer.

Once the Dashboard is shared, other users will have the ability to switch to the Shared Dashboard under their Dashboard selector. Shared Dashboards also come with the ability to control which users have access to view the Dashboard.

Azure Portal Home versus Dashboard View

With the introduction of the Azure Home page, you now have the ability to choose whether you’d prefer your default Azure Portal view to be Home or Dashboard. To change the preferred default Portal view, all you need to do is open the Settings gear icon in the top right of the Portal, and modify the “Choose your default view” setting.

Although I do like the look and feel of the new “Home” and it has some great resources, it’s currently geared more toward a “first time logging in” experience. I personally hope it evolves toward serving as a hub for news, developments, and releases within Azure in addition to the educational reference links.

Leave a Comment

Your email address will not be published. Required fields are marked *