URL formats

There are two endpoints through which you can address the Application Insights APIs. These differ based on the choice of authentication you plan to use. Unless you area already using Azure Active Directory, the recommendation is to use the Public API format and authenticate with an API key.

Public API format

The Public API format supports authentication via API key authentication. It has the format:

https://{hostname}/{api-version}/{resource}/{area}/[path]?[parameters]

For the Public API format, the components of URL are:

  1. hostname: api.applicationinsights.io
  2. resource: this is the Application ID which uniquely identifies your app in Application Insights. (Note that this is not the Instrumentation Key, which is used by Application Insights SDKs to identify where to to submit telemetry data.)
  3. api-version: the API versions required to use in the path, for example beta.
  4. area: the supported query types are metrics, events and query
  5. path: provides more specifics to the requests such as which metric to query
  6. parameters: these parameters specify the details of the data and depend on the query-path

Azure API format

The Azure API format requires authentication using Azure Active Directory. The format of this API is:

https://{hostname}/{resource}/api/{area}/[path]?[parameters]&api-version={api-version}

For the Azure API format, the components of URL are:

  1. hostname: management.azure.com
  2. resource: this is Azure path of your Application Insights resource of the form /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/components/{component-name}
  3. api-version: the API version used in the query string, for example 2014-12-01-preview.
  4. area: the base supported query paths are metrics, events and query
  5. path: provides more specifics to the requests such as which metric to query
  6. parameters: these parameters specify the details of the data and depend on the query-path

Since most of the following content is going to focus on the parameters for a particular path, the Public API will be used in the examples.