Azure Asset Inventory
A high level view of all your Azure resources across all accounts accounts and regions.
# Azure Cloud Asset Inventory

This  dashboard provides a high level view of all your resources across all accounts accounts and regions. This works with PostgreSQL as the storage layer and CloudQuery (https://github.com/cloudquery/cloudquery) as the ingestion layer.

## How to Install

 1. Install [CloudQuery](https://www.cloudquery.io/docs/quickstart/) and fetch your resources
 2. [Follow the instructions for installing the view and dashboard here](https://github.com/cloudquery/cloudquery/tree/main/plugins/source/azure/dashboards) 

## GitHub

Feel free to contribute or open an [issue](https://github.com/cloudquery/cloudquery)
{
  "__inputs": [
    {
      "name": "DS_POSTGRESQL",
      "label": "PostgreSQL",
      "description": "",
      "type": "datasource",
      "pluginId": "postgres",
      "pluginName": "PostgreSQL"
    }
  ],
  "__elements": [],
  "__requires": [
    {
      "type": "panel",
      "id": "barchart",
      "name": "Bar chart",
      "version": ""
    },
    {
      "type": "panel",
      "id": "geomap",
      "name": "Geomap",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.0.2"
    },
    {
      "type": "panel",
      "id": "piechart",
      "name": "Pie chart",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "postgres",
      "name": "PostgreSQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1657121653142,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "panels": [],
      "title": "CloudQuery",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "description": "This panel will show OK if the aws_resources view has been created and is accessible to the current Postgres user. See https://github.com/cloudquery/dashboards#aws for more information.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "0": {
                        "index": 1,
                        "text": "Not OK"
                      },
                      "1": {
                        "index": 0,
                        "text": "OK"
                      }
                    },
                    "type": "value"
                  }
                ]
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "green",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 2,
        "w": 7,
        "x": 0,
        "y": 1
      },
      "id": 4,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.0.2",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT count(*) FROM information_schema.tables\n     WHERE  table_schema = 'public'\n     AND    table_name   = 'azure_resources'",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "provisioned_throughput_in_mibps"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "aws_efs_filesystems",
          "timeColumn": "creation_time",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Data Source",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "description": "Time since the most recent CloudQuery fetch happened.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "dateTimeFromNow"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 2,
        "w": 17,
        "x": 7,
        "y": 1
      },
      "id": 8,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^Time$/",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "9.0.2",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "time_series",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select fetch_date as time, 1 from azure_resources order by fetch_date desc limit 1;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "provisioned_throughput_in_mibps"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "aws_efs_filesystems",
          "timeColumn": "creation_time",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Last Fetch",
      "type": "stat"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 3
      },
      "id": 6,
      "panels": [],
      "title": "Resources",
      "type": "row"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 7,
        "x": 0,
        "y": 4
      },
      "id": 10,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "9.0.2",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select count(*) from azure_resources where subscription_id in (${subscription_ids}) AND location in (${locations}) and cq_table in (${cq_tables});",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Total Resources",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": []
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 8,
        "x": 7,
        "y": 4
      },
      "id": 12,
      "options": {
        "displayLabels": [
          "percent"
        ],
        "legend": {
          "displayMode": "list",
          "placement": "bottom"
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "8.4.7",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select coalesce(azss.display_name, ar.subscription_id) as name, count(*) from azure_resources ar\nleft join azure_subscription_subscriptions azss on azss.subscription_id = ar.subscription_id\nwhere \n  location in (${locations}) \n  and cq_table in (${cq_tables}) \ngroup by coalesce(azss.display_name, ar.subscription_id)\norder by count desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Total Resources by Subscription",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 9,
        "x": 15,
        "y": 4
      },
      "id": 20,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "count"
          }
        ]
      },
      "pluginVersion": "9.0.2",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select cq_table, count(*) \nfrom azure_resources \nwhere subscription_id in (${subscription_ids})\nand cq_table in (${cq_tables}) \nand location in (${locations}) \ngroup by cq_table order by count desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "data_transfer_progress_current_rate_in_mega_bytes_per_second"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "aws_redshift_clusters",
          "timeColumn": "cluster_create_time",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Count by Resource Type",
      "type": "table"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "description": "Excludes resources with no specified location",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 0,
        "y": 13
      },
      "id": 16,
      "options": {
        "basemap": {
          "config": {},
          "name": "Layer 0",
          "type": "default"
        },
        "controls": {
          "mouseWheelZoom": true,
          "showAttribution": true,
          "showDebug": false,
          "showScale": false,
          "showZoom": true
        },
        "layers": [
          {
            "config": {
              "blur": 15,
              "radius": 13,
              "weight": {
                "field": "count",
                "fixed": 1,
                "max": 1,
                "min": 0
              }
            },
            "location": {
              "latitude": "latitude",
              "longitude": "longitude",
              "mode": "coords"
            },
            "name": "Location",
            "tooltip": true,
            "type": "heatmap"
          }
        ],
        "tooltip": {
          "mode": "details"
        },
        "view": {
          "id": "zero",
          "lat": 0,
          "lon": 0,
          "zoom": 1
        }
      },
      "pluginVersion": "9.0.2",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select azal.name, latitude::float, longitude::float, count(*) from azure_resources azr\nleft join azure_account_locations azal on azal.name = azr.location\nwhere azr.subscription_id in (${subscription_ids}) \nand azr.location != 'unavailable'\nand cq_table in (${cq_tables}) \ngroup by azal.name, latitude, longitude order by count desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "provisioned_throughput_in_mibps"
                ],
                "type": "column"
              }
            ]
          ],
          "table": "aws_efs_filesystems",
          "timeColumn": "creation_time",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Resource Map",
      "type": "geomap"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-BlYlRd"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "axisSoftMin": 0,
            "fillOpacity": 80,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 1,
            "scaleDistribution": {
              "type": "linear"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 12,
        "y": 13
      },
      "id": 14,
      "options": {
        "barRadius": 0,
        "barWidth": 0.97,
        "groupWidth": 0.7,
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "orientation": "auto",
        "showValue": "auto",
        "stacking": "none",
        "tooltip": {
          "mode": "single",
          "sort": "none"
        },
        "xTickLabelRotation": -90,
        "xTickLabelSpacing": 0
      },
      "pluginVersion": "8.4.7",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select location, count(*) from azure_resources where subscription_id in (${subscription_ids}) and cq_table in (${cq_tables}) group by location order by count desc;",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Resources by Location",
      "type": "barchart"
    },
    {
      "datasource": {
        "type": "postgres",
        "uid": "${DS_POSTGRESQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "cq_meta"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 392
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "cq_table"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 326
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "account_id"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 188
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "region"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 164
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "fetch_date"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 270
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "cq_id"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 293
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 25
      },
      "id": 18,
      "options": {
        "footer": {
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "9.0.2",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "${DS_POSTGRESQL}"
          },
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "select cq_id, cq_table, subscription_id, location, id, fetch_date from azure_resources \nwhere subscription_id in (${subscription_ids}) \nand location in (${locations})\nand cq_table in (${cq_tables});",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "column"
              }
            ]
          ],
          "timeColumn": "time",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Azure Resources",
      "type": "table"
    }
  ],
  "schemaVersion": 36,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {},
        "datasource": {
          "type": "postgres",
          "uid": "${DS_POSTGRESQL}"
        },
        "definition": "select distinct(subscription_id) from azure_resources",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "subscription_ids",
        "options": [],
        "query": "select distinct(subscription_id) from azure_resources",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "postgres",
          "uid": "${DS_POSTGRESQL}"
        },
        "definition": "select distinct(cq_table) from azure_resources;",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "cq_tables",
        "options": [],
        "query": "select distinct(cq_table) from azure_resources;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "allValue": "",
        "current": {},
        "datasource": {
          "type": "postgres",
          "uid": "${DS_POSTGRESQL}"
        },
        "definition": "select distinct(location) from azure_resources;",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "locations",
        "options": [],
        "query": "select distinct(location) from azure_resources;",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Azure Asset Inventory",
  "uid": "ji8R8567z",
  "version": 5,
  "weekStart": "",
  "gnetId": 16569,
  "description": "A high level view of all your Azure resources across all accounts accounts and regions."
}