Unable to schedule refresh of dynamic data source
Hi cpwebb,
I have been looking into this for Analyst-Rene and trying to create a custom connection, and I can get a custom connection working for the Power BI Desktop but not the service, where the refresh says it is not a supported data source.
The end goal is to connect to Azure DevOps and query the wiql (https://dev.azure.com/{org}/{project}/_apis/wit/wiql/) endpoint to return certain workitems, then use the workitem ID's to call the individual work item endpoint (https://dev.azure.com/{org}/{project}/_apis/wit/workItems/{id})
I understand that this will be hard to achieve because of the dynamic building of the URL, so to break it down into smaller chunks I created a very simple custom connector, making a direct call to one of the workitems, and I followed your suggestions of using the relative path field in Web.Contents, like this:
[DataSource.Kind="aha_feature", Publish="aha_feature.Publish"]
shared aha_feature.Contents = (optional message as text) =>
let
headers = [
#"Authorization"="Basic {PAT}",
#"content-Type" = "application/json"
],
Source = Web.Contents(
"https://dev.azure.com",
[
RelativePath = "{org}/{project}/_apis/wit/workItems/283750",
Headers = headers
]
),
json = Json.Document(Source)
in
json;
This connector works in VS Code using the Power Query SDK, and in Power BI Desktop, but will not refresh in the Power BI Service.
I noticed your last comment about using OAuth to authenticate, is it possible that the basic authorization is piece that is causing the refresh to fail?
I haven't ever used OAuth, but will try and figure it out and give it a go.
Cheers,
Tim