The Azure Dashboard is sometimes overlooked, but it is a powerful tool for operations and service desk teams that operate Microsoft Azure at any scale. It allows a simple interface to be the first stop for all teams to see what they need to keep an eye on, and it is easy to customize using a web interface. It can also easily to be deployed using ARM templates.
Azure Dashboard overview
Any user with access to the Azure Portal is able to create and modify Azure Dashboards and customize their experience. They can also be shared among users (we will tackle that in a little bit). The first step is to understand the options available, which can be seen in the image below. Let’s start customizing by clicking on Edit.
Let’s use a simple scenario here of creating a standard dashboard for our teams. Let’s say that we have several offices around the planet, and we must make sure to inform our cloud operators about some basic information to help them with their day-to-day operations.
When we click on the Edit button, we will have our Azure Dashboard in edit mode. Basically, a toolbox on the left side will show all the tiles available, but we can also dig deeper and select per type, resource group, tag, and even search. On the right side, we have the dashboard itself. We can see some lines that show the Azure Dashboard in different resolutions (1024x768, 1366,768, 1440x900), which helps a lot when building a dashboard to be distributed among several users.
We can move tiles by just dragging and dropping them as we want. The tiles can be resized and removed at any time — just hit the button … and all options available will be listed. In some tiles, we also have the button Edit, which allows specific settings of the tile. In the Clock tile, for example, we can configure the location and if we want 12hs or 24hs display.
I personally like Markdown Tiles because they allow simple HTML code where we can add images, links, headers, bold, and italic features to some important text that we want on our dashboard.
The basic customization like the one that we have just done is simple. We can go up a notch and use RestAPI to create a button to perform an action for our operations team, for example. Let’s say that we want to start a VM called TORFS01. These are the basic steps to create a tile for that.
- Open the VM resource in Azure Portal, click on Properties, copy the Resource ID text
- Open the link at this page, and find the actions available for the resource that we are looking for
- Add an ARM Action tile, and add the following code “<ResourceID>/start?api-version=2017-12-01” to start that given VM
The result should be like the image below. The next step is to turn off the desired VM and hit the button to see if it is working as expected. The Start/Stop are simple examples — use your imagination and requirements to take advantage of RestAPI to help our operations team.
Now we can see how the Azure Dashboard looks like after a few changes. We added a couple of tiles and that gives you a good idea of what is available for the operations team. We can see the time on all three locations, some useful links about our cloud environment, an ARM action to start a VM that goes down every night to save costs, and so forth.
Sharing an Azure Dashboard
An Azure Dashboard can be created for your own use, but a great dashboard deserves to be shared with your cloud operations/administrators, and Azure allows that to be accomplished in a few steps. Click on Share, and on the new blade, select the region, a name for your dashboard, and make sure to check the options Publish to the dashboards resource group checkbox, and click on Publish.
A new resource group called dashboards will be created. This first shared one and all other ones will be stored at that location. There is a built-in integration with this new structure created when we click on the name of any dashboard we can see that it has an option browse existent dashboards. Your operations team can always have access to the latest without copying files by email and so forth.
When we have a dashboard published in the shared area (dashboards Resource Group), we can use Resource Explorer to navigate in the subscription, <subscription>, Resource Groups, dashboards, Resources.
Advanced Azure Dashboard
Besides the easy interface provided by the Azure Portal, we also have the option to generate a JSON file of the Azure Dashboard and edit it on our own. That can be easily done using Download and Upload.
I like the idea of deploying using ARM Templates, where we have consistency and we can take advantage of variables to deploy to a shared location or to an individual user.
Let’s create a new Dashboard and we are going to add a single tile that shows the CPU utilization of a given VM. Simple and easy! We want to show the functionality and it is easy to grasp the changes that way. Let’s Download the content, which is a JSON file.
In order to make it “deployable,” we need to add some instructions at the beginning of the file (the end result will be an ARM template file), and close the brackets and braces at the end of the file. The code below has in bold all the changes that we performed to the original JSON file.
Another change is to remove the static reference and use variables. We are asking three things: the name of the VM, the Resource Group where the VM is located, and the dashboard name. Within the code, we are going to replace all static names for the variables that we will be passing as parameters.
Note: The code with parameters and its variables came from official Microsoft documentation.
"value": "[resourceId(parameters('virtualMachineResourceGroup'), 'Microsoft.Compute/virtualMachines', parameters('virtualMachineName'))]"
"location": "East US",
Now that we have an ARM template, let’s save this file as dashboardDeployment.json, and logged on Microsoft Azure, search for Deploy a custom Template. In the new page, click on Build your own template in the editor.
The editor will be displayed on a new blade. Click on Load File, and select the JSON file that we have just modified in the previous step, click on Save.
Back on the main page of the Custom Deployment, fill out the parameters that we defined in the script, select the I agree to the terms and conditions stated above, and click on Purchase. Note: We selected dashboards Resource Group, which means that deployment will be automatically shared among our users.
The result will be a new dashboard focused on that given VM. We can apply the same concept to have a complete dashboard to a specific Resource Group or VM. Just create the skeleton and when completed, replace the static values for variables and make it available as an ARM template.
As you can see, setting up, customizing, and even sharing an Azure Dashboard is a relatively easy process. And the information it will display will make your job so much easier, too
Featured image: Shutterstock