http_request plugin

Learn how to use the http_request plugin to send an HTTP request and convert the response into a table.

services: data-explorer

http_request plugin

The http_request plugin sends an HTTP GET request and converts the response into a table.

Prerequisites

Syntax

evaluate http_request ( Uri [, RequestHeaders [, Options]] )

Parameters

NameTypeRequiredDescription
Uristring✔️The destination URI for the HTTPS request.
RequestHeadersdynamicA property bag containing HTTP headers to send with the request.
OptionsdynamicA 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:

NameDescription
x-ms-client-request-idA correlation ID that identifies the request. Multiple invocations of the plugin in the same query will all have the same ID.
x-ms-readonlyA 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

armRegionNamearmSkuNamecurrencyCodeeffectiveStartDateisPrimaryMeterRegionlocationmeterIdmeterNameproductIdproductNameretailPriceserviceFamilyserviceIdserviceNameskuIdskuNametierMinimumUnitstypeunitOfMeasureunitPrice
westeuropeData InsightsUSD2022-06-01T00:00:00ZfalseEU West8ce915f7-20db-564d-8cc3-5702a7c952abData Insights Report ConsumptionDZH318Z08M22Azure Purview Data Map0.21AnalyticsDZH318Q66D0FAzure PurviewDZH318Z08M22/006CCatalog Insights0Consumption1 API Calls0.21
westeuropeData Map Enrichment - Data Insights GenerationUSD2022-06-01T00:00:00ZfalseEU West7ce2db1d-59a0-5193-8a57-0431a10622b6Data Map Enrichment - Data Insights Generation vCoreDZH318Z08M22Azure Purview Data Map0.82AnalyticsDZH318Q66D0FAzure PurviewDZH318Z08M22/005CData Map Enrichment - Insight Generation0Consumption1 Hour0.82
westeuropeUSD2021-09-28T00:00:00ZfalseEU West053e2dcb-82c0-5e50-86cd-1f1c8d803705Power BI vCoreDZH318Z08M23Azure Purview Scanning Ingestion and Classification0AnalyticsDZH318Q66D0FAzure PurviewDZH318Z08M23/0005Power BI0Consumption1 Hour0
westeuropeUSD2021-09-28T00:00:00ZfalseEU Westa7f57f26-5f31-51e5-a5ed-ffc2b0da37b9Resource Set vCoreDZH318Z08M22Azure Purview Data Map0.21AnalyticsDZH318Q66D0FAzure PurviewDZH318Z08M22/000XResource Set0Consumption1 Hour0.21
westeuropeUSD2021-09-28T00:00:00ZfalseEU West5d157295-441c-5ea7-ba7c-5083026dc456SQL Server vCoreDZH318Z08M23Azure Purview Scanning Ingestion and Classification0AnalyticsDZH318Q66D0FAzure PurviewDZH318Z08M23/000FSQL Server0Consumption1 Hour0
westeuropeUSD2021-09-28T00:00:00ZfalseEU West0745df0d-ce4f-52db-ac31-ac574d4dcfe5Standard Capacity UnitDZH318Z08M22Azure Purview Data Map0.411AnalyticsDZH318Q66D0FAzure PurviewDZH318Z08M22/0002Standard0Consumption1 Hour0.411
westeuropeUSD2021-09-28T00:00:00ZfalseEU West811e3118-5380-5ee8-a5d9-01d48d0a0627Standard vCoreDZH318Z08M23Azure Purview Scanning Ingestion and Classification0.63AnalyticsDZH318Q66D0FAzure PurviewDZH318Z08M23/0009Standard0Consumption1 Hour0.63