http_request plugin
services: data-explorer
http_request plugin
The http_request plugin sends an HTTP GET request and converts the response into a table.
Prerequisites
- Run
.enable plugin http_requestto enable the plugin - Set the URI to access as an allowed destination for
webapiin the Callout policy
Syntax
evaluate http_request ( Uri [, RequestHeaders [, Options]] )
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Uri | string | ✔️ | The destination URI for the HTTPS request. |
| RequestHeaders | dynamic | A property bag containing HTTP headers to send with the request. | |
| Options | dynamic | A property bag containing additional properties of the request. |
Authentication and authorization
To authenticate, use the HTTP standard Authorization header or any custom header supported by the web service.
Returns
The plugin returns a table that has a single record with the following dynamic columns:
- ResponseHeaders: A property bag with the response header.
- ResponseBody: The response body parsed as a value of type
dynamic.
If the HTTP response indicates (via the Content-Type response header) that the media type is application/json,
the response body is automatically parsed as-if it’s a JSON object. Otherwise, it’s returned as-is.
Headers
The RequestHeaders argument can be used to add custom headers to the outgoing HTTP request. In addition to the standard HTTP request headers and the user-provided custom headers, the plugin also adds the following custom headers:
| Name | Description |
|---|---|
x-ms-client-request-id | A correlation ID that identifies the request. Multiple invocations of the plugin in the same query will all have the same ID. |
x-ms-readonly | A flag indicating that the processor of this request shouldn’t make any persistent changes. |
Example
The following example retrieves Azure retails prices for Azure Purview in west Europe:
let Uri = "https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Azure Purview' and location eq 'EU West'";
evaluate http_request(Uri)
| project ResponseBody.Items
| mv-expand ResponseBody_Items
| evaluate bag_unpack(ResponseBody_Items)
Output
| armRegionName | armSkuName | currencyCode | effectiveStartDate | isPrimaryMeterRegion | location | meterId | meterName | productId | productName | retailPrice | serviceFamily | serviceId | serviceName | skuId | skuName | tierMinimumUnits | type | unitOfMeasure | unitPrice |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| westeurope | Data Insights | USD | 2022-06-01T00:00:00Z | false | EU West | 8ce915f7-20db-564d-8cc3-5702a7c952ab | Data Insights Report Consumption | DZH318Z08M22 | Azure Purview Data Map | 0.21 | Analytics | DZH318Q66D0F | Azure Purview | DZH318Z08M22/006C | Catalog Insights | 0 | Consumption | 1 API Calls | 0.21 |
| westeurope | Data Map Enrichment - Data Insights Generation | USD | 2022-06-01T00:00:00Z | false | EU West | 7ce2db1d-59a0-5193-8a57-0431a10622b6 | Data Map Enrichment - Data Insights Generation vCore | DZH318Z08M22 | Azure Purview Data Map | 0.82 | Analytics | DZH318Q66D0F | Azure Purview | DZH318Z08M22/005C | Data Map Enrichment - Insight Generation | 0 | Consumption | 1 Hour | 0.82 |
| westeurope | USD | 2021-09-28T00:00:00Z | false | EU West | 053e2dcb-82c0-5e50-86cd-1f1c8d803705 | Power BI vCore | DZH318Z08M23 | Azure Purview Scanning Ingestion and Classification | 0 | Analytics | DZH318Q66D0F | Azure Purview | DZH318Z08M23/0005 | Power BI | 0 | Consumption | 1 Hour | 0 | |
| westeurope | USD | 2021-09-28T00:00:00Z | false | EU West | a7f57f26-5f31-51e5-a5ed-ffc2b0da37b9 | Resource Set vCore | DZH318Z08M22 | Azure Purview Data Map | 0.21 | Analytics | DZH318Q66D0F | Azure Purview | DZH318Z08M22/000X | Resource Set | 0 | Consumption | 1 Hour | 0.21 | |
| westeurope | USD | 2021-09-28T00:00:00Z | false | EU West | 5d157295-441c-5ea7-ba7c-5083026dc456 | SQL Server vCore | DZH318Z08M23 | Azure Purview Scanning Ingestion and Classification | 0 | Analytics | DZH318Q66D0F | Azure Purview | DZH318Z08M23/000F | SQL Server | 0 | Consumption | 1 Hour | 0 | |
| westeurope | USD | 2021-09-28T00:00:00Z | false | EU West | 0745df0d-ce4f-52db-ac31-ac574d4dcfe5 | Standard Capacity Unit | DZH318Z08M22 | Azure Purview Data Map | 0.411 | Analytics | DZH318Q66D0F | Azure Purview | DZH318Z08M22/0002 | Standard | 0 | Consumption | 1 Hour | 0.411 | |
| westeurope | USD | 2021-09-28T00:00:00Z | false | EU West | 811e3118-5380-5ee8-a5d9-01d48d0a0627 | Standard vCore | DZH318Z08M23 | Azure Purview Scanning Ingestion and Classification | 0.63 | Analytics | DZH318Q66D0F | Azure Purview | DZH318Z08M23/0009 | Standard | 0 | Consumption | 1 Hour | 0.63 |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.