This sample shows you how to use the Azure Resource Manager (preview) query control to list all existing alerts in a subscription. This guide will also use JSON Path transformations to format the results.
- Create an empty workbook.
- Click
Add parameterto create a new one. Use the following settings:- Parameter name:
Subscription - Parameter type:
Subscription picker - Required:
Checked - Get data from:
Default Subscriptions - Use the
Savebutton in the toolbar to save this parameter.
- Parameter name:
To get a list of existing alerts for a subscription, we will utilize the Alerts - Get All REST call
-
Click
Add queryto create a query control.-
Data source:
Azure Resource Manager (Preview) -
Http Method:
GET -
Path:
/subscriptions/{Subscription:id}/providers/Microsoft.AlertsManagement/alerts -
Add the api-version parameter in the
Parameterstab- Parameter:
api-version - Value:
2018-05-05
Note: Supported api-versions are listed in the Azure REST API Reference documentation
- Parameter:
-
Select a subscription from the created subscription parameter and click the
Run Querybutton to see the results.
This is the raw JSON results returned from Azure Resource Manager (ARM).
-
You may be satisfied with the information here. However, let us extract some interesting properties and format the response in an easy to read way.
- Navigate to the tab
Result Settings - Switch the Result Format from
ContenttoJSON Path. JSON Path is a Workbook transformer. Click here to learn more about JSON Path in Workbooks. - In the JSON Path Settings - JSON Path Table:
$.value.[*].properties.essentials. This extracts all "value.*.properties.essentials" fields from the returned JSON. - Click
Run Queryto see the grid.
JSON Path also allows you to pick and choose information from the generated table to show as columns. For example, if you would like to filter the results to the following columns: TargetResource, Severity, AlertState, Description, AlertRule, StartTime, ResolvedTime
- Add the following rows in the columns table in JSON Path:
| Column ID | Column JSON Path |
|---|---|
| TargetResource | $.targetResource |
| Severity | $.severity |
| AlertState | $.alertState |
| AlertRule | $.alertRule |
| Description | $.description |
| StartTime | $.startDateTime |
| ResolvedTime | $.monitorConditionResolvedDateTime |
Click here to see a list of other supported ARM calls.


