Connect using Power Query and Azure DevOps functions

Azure DevOps Services | Azure DevOps Server 2019

The Data Connector for Azure DevOps includes Power Query M functions which query authors can use. These functions can handle Azure DevOps specific requirements, such as authentication for you. This article describes the arguments for the functions and how to use them to connect to Analytics.

The VSTS.AccountContents function is a replacement for Power Query M function Web.Contents. Intended for more advanced scenarios, VSTS.AccountContents returns the contents downloaded from the URL for Analytics as a binary value. You can use it to call AzureDevOps REST APIs.

Important

You should only use VSTS.AccountContents to access data that isn't available in Analytics. It pulls data directly from Azure DevOps and, to protect other Azure DevOps users, is susceptible to throttling. For information on other approaches, read the Power BI integration overview.

VSTS.AccountContents

Advanced function which returns the contents downloaded from the URL for Analytics as a binary value.

The VSTS.AccountContents function has the same arguments, options and return value format as Web.Contents. For more information please refer to: Power Query (M) Formula Reference - Web.Contents.

If you are already using Web.Contents to access data from Analytics (REST API or OData), you can replace it with VSTS.AccountContents to leverage Data Connector authentication. This will also inform Power BI that these requests are referencing the same data source and you'll be able to combine the data without violating the single data source constraints in Power BI Service.

'VSTS.AccountContents' provides a subset of the Arguments and Options available through 'OData.Contents'. The specific limitations are outlined in the table below:

Arguments for VSTS.Contents

Argument Description
url URL to one of the VSTS service endpoints.
options An options record to control the behavior of this function.

Options fields for VSTS.Contents

Field Description
IsRetry Specifying this logical value as true will ignore any existing response in the cache when fetching data.
ManualStatusHandling Specifying this value as a list will prevent any builtin handling for HTTP requests whose response has one of these status codes.
MaxSize Controls the max size of the table the client is interested in. If request exceeds this limit then server can fail the request immediately. Default value is zero, which tells the servers server to use its default value.
Query Programmatically add query parameters to the URL.
RelativePath Specifying this value as text appends it to the base URL before making the request.
Timeout Specifying this value as a duration will change the timeout for an HTTP request. The default value is 600 seconds.
Version Version of the data model. This option is primary for diagnostics.