1

How to Quickly Fix Dashboard After Moving Resources in Azure

 3 years ago
source link: https://edi.wang/post/2020/10/3/how-to-quickly-fix-dashboard-after-moving-resources-in-azure
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Azure users often need to move resources to another resource group or subscription because they are not rich enough. After the move is completed, the corresponding Dashboard components will become invalid. Usually, we need to delete and rebuild these dashboard cards one by one. Is there a quick and accurate way to repair Dashboard in one 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:

img-57cadf1d-2285-4073-a4ca-6bb8bcdb3220.png

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.

img-fefafa8c-86db-4f4d-8800-e2ca587652e4.png

Open the JSON file with Visual Studio Code.

img-f3df77f7-03f6-400d-ac0c-5da24a4d4fea.png

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.

img-e6c9ff00-be45-4c08-8b90-451a3f0da017.png

Go back to Azure, click "+ New dashboard", "Upload", and select the modified JSON file.

img-ba8c06d6-3776-46f8-9236-48054cf6ca96.png

Now, the dashboard is restored correctly, you can delete the old broken dashboard now.

img-8b875a01-8ee8-4746-a691-602a7915627f.png

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK