Azure users frequently need to transfer resources to a different resource group or subscription due to budget constraints. Once the transfer is complete, the associated Dashboard components typically become invalid. This usually necessitates manually deleting and rebuilding each dashboard card individually. Is there a quick and accurate method to repair the Dashboard in a single step?
Moving resources
Take my blog as an example, I moved my Application Insights resource from "ediwang-blog-group" to "prod-group". Then, my dashboard blows up:
There are more than a dozen of chart like this on the dashboard, manually delete and recreate them will take a few hours. This is not how a typical Microsoft product should be used. We need a more efficient way to fix the dashboard.
Fix the dashboard in a few minutes
In fact, the layout and data of your Azure dashboard is stored and can be exported as JSON file for editing and sharing. We only need to modify a few lines in the JSON file to quickly fix the dashboard.
Click "Download" button on the broken dashboard, and save the JSON file to local file system.
Open the JSON file with Visual Studio Code.
In my case, I just need to replace the old resource group name "ediwang-blog-group" with the new resource group name "prod-group", which is the new location where the resource was moved.
If your resource was moved across subscriptions, you may also need to replace the subscription ID for the moved resources.
Press "CTRL + H" to find and replace values, and then save the file.
Go back to Azure, click "+ New dashboard", "Upload", and select the modified JSON file.
Now, the dashboard is restored correctly, you can delete the old broken dashboard now.
Comments