Azure Logic App returns 404 with valid Project Online ODATA query using /_api/Projectdata

676 views Asked by At

I want to filter and select Project Online data using Enterprise Custom Fields (ECF) in an Azure Logic App. I start with the out-of-the-box Project Online connector to trigger on project publish, then list project and task details.

Using the default connector, I can return project data but it does not contain the ECF data. Looking at the generated code, the Project Online connector uses /_api/ProjectServer. If I make similar requests (outside of Logic Apps) using /_api/Projectdata I get the ECF data.

If I edit the Logic App code with modified URL and fields, I get a 404 error. There seems to be something missing that I cannot see when I make the request with the modified values from within the Logic App.

My guess is the connector is limiting access to /_api/Projectdata (though the trigger itself is using this URL).

The following returns the data I want if I request it straight from the browser: https://tenant.sharepoint.com/sites/PWA/_api/Projectdata/Projects(guid'project_GUID')

This is the raw input in the logic app:

{
"host": {
    "connection": {
        "name": "/subscriptions/subscription_GUID/resourceGroups/MyRG/providers/Microsoft.Web/connections/projectonline-1"
    }
},
"method": "get",
"path": "/_api/Projectdata/Projects(guid'project_GUID')",
"queries": {
    "siteUrl": "https://tenant.sharepoint.com/sites/PWA"
}

}

This is the raw output of the error:

{
"statusCode": 404,
"headers": {
    "Access-Control-Allow-Methods": "GET, PUT, PATCH, DELETE, POST",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max-Age": "3600",
    "Access-Control-Expose-Headers": "*",
    "Date": "Thu, 20 Sep 2018 16:58:42 GMT",
    "Content-Length": "54",
    "Content-Type": "application/json"
},
"body": {
    "statusCode": 404,
    "message": "Resource not found"
}

}

URLs and GUID have been modified in the examples above.

0

There are 0 answers