You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/managed-grafana/create-grafana-dashboard.md
+90-2Lines changed: 90 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,10 @@ To quickly create a dashboard, import a dashboard template from the Grafana Labs
26
26
27
27
1. From the Grafana Labs website, browse through [Grafana dashboards templates](https://grafana.com/grafana/dashboards/?category=azure) and select a dashboard to import.
28
28
1. Select **Copy ID to clipboard**.
29
-
1. In the Azure portal, open your Azure Managed Grafana workspace and select the **Endpoint** URL.
29
+
30
+
### [Portal](#tab/azure-portal)
31
+
32
+
3. In the Azure portal, open your Azure Managed Grafana workspace and select the **Endpoint** URL.
30
33
1. In your Grafana endpoint, go to **Dashboards > Import**.
31
34
1. On the **Import** page, under **Import via grafana.com**, paste the Grafana dashboard ID copied earlier, and select **Load**.
32
35
@@ -37,10 +40,23 @@ To quickly create a dashboard, import a dashboard template from the Grafana Labs
37
40
1. A new dashboard is displayed.
38
41
1. Review the visualizations displayed and edit the dashboard if necessary.
39
42
43
+
### [Azure CLI](#tab/azure-cli)
44
+
45
+
1. Open a CLI and run the `az login` command.
46
+
1. Run the [az grafana dashboard import](/cli/azure/grafana/dashboard#az-grafana-update)command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, and `<dashboard-id>` with the name of the Azure Managed Grafana instance, its resource group, and the dashboard ID you copied earlier.
47
+
48
+
```azurecli
49
+
az grafana dashboard import --name <AMG-name> --resource-group <AMG-resource-group> --definition <dashboard-id>
50
+
```
51
+
52
+
---
53
+
40
54
## Create a new Grafana dashboard
41
55
42
56
If none of the pre-configured dashboards listed on the Grafana Labs website fit your needs, create a new dashboard.
43
57
58
+
### [Portal](#tab/azure-portal)
59
+
44
60
1. In the Azure portal, open your Azure Managed Grafana workspace and select the **Endpoint** URL.
45
61
1. In your Grafana endpoint, go to **Dashboards > New Dashboard**.
46
62
1. Select one of the following options:
@@ -50,9 +66,37 @@ If none of the pre-configured dashboards listed on the Grafana Labs website fit
50
66
51
67
:::image type="content" source="media/dashboard/from-scratch.png" alt-text="Screenshot of the Grafana instance. Create a new dashboard.":::
52
68
69
+
### [Azure CLI](#tab/azure-cli)
70
+
71
+
Run the [az grafana dashboard create](/cli/azure/grafana/dashboard#az-grafana-dashboard-create) command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, `<title>`, and `<definition>` with the name of the Azure Managed Grafana instance, its resource group, a title and a definition for the new dashboard. The definition consists of a dashboard model in JSON string, a path or URL to a file with such content.
az grafana dashboard create --name myGrafana --resource-group myResourceGroup --title "My dashboard" --folder folder1 --definition '{
81
+
"dashboard": {
82
+
"annotations": {
83
+
...
84
+
},
85
+
"panels": {
86
+
...
87
+
}
88
+
},
89
+
"message": "Create a new test dashboard"
90
+
}'
91
+
```
92
+
93
+
---
94
+
53
95
## Duplicate a Grafana dashboard
54
96
55
-
To copy a Grafana dashboard.
97
+
### [Portal](#tab/azure-portal)
98
+
99
+
To copy a Grafana dashboard:
56
100
57
101
1. Open an existing dashboard in your Grafana instance
58
102
1. Select **Dashboard settings**
@@ -61,8 +105,42 @@ To copy a Grafana dashboard.
61
105
62
106
:::image type="content" source="media\dashboard\copy-dashboard.png" alt-text="Screenshot of the Grafana instance. Duplicate a dashboard.":::
63
107
108
+
### [Azure CLI](#tab/azure-cli)
109
+
110
+
1. Run the [az grafana dashboard show](/cli/azure/grafana/dashboard#az-grafana-dashboard-show) command to show the definition of the dashboard you want to duplicate, and copy the output.
111
+
112
+
```azurecli
113
+
az grafana dashboard show --name <AMG-name> --dashboard <dashboard-UID>
114
+
```
115
+
116
+
1. Run the [az grafana dashboard create](/cli/azure/grafana/dashboard#az-grafana-dashboard-create) command and replace the placeholders `<AMG-name>`, `<AMG-resource-group>`, `<title>`, and `<dashboard-id>` with your own information. Replace `<definition>` with the output you copied in the previous step, and remove the `uid`and `id`.
0 commit comments