I'm working on a client project and over the past couple of days I have created a couple of Azure Logic Apps which are designed to take content from external feeds, Twitter & RSS, and post a News Link into a specified SharePoint Online site. After a little bit of debugging to get the structure of the output correct, including dealing with Tweets which have no Media URLs in them, I had both of these Logic Apps working. They had both completed successfully, posting a New Link (creating a new page for a news item on the respective sites).
I've come back to verify what has happened with any new posts on these feeds and found that both of them have failed with a 502 Bad Gateway error, here's the output from one of the failed executions of the trigger. For what its worth this is looking for new posts from the Office 365 IT Pros site and creating a link on the internal site, by posting a new link (we want to have some automated content curation, bringing together useful external articles into a single central location).
"body": {
"error": {
"code": 502,
"source": "logic-apis-eastus.azure-apim.net",
"clientRequestId": "93066cfc-05c9-4600-868e-8439a54e1c51",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": "{\"odata.error\":{\"code\":\"-2130575336, Microsoft.SharePoint.SPException\",\"message\":{\"lang\":\"en-US\",\"value\":\"Invalid text value.\n\nA text field contains invalid data. Please check the value and try again.\"}}}\r\nclientRequestId: 93066cfc-05c9-4600-868e-8439a54e1c51\r\nserviceRequestId: e17d52a0-40e7-2000-297d-6a42e765e3e7",
"source": "https://mycompany.sharepoint.com/sites/ITInfrastructure-CollaborationMIddleware/_api/sitepages/pages/reposts",
"errors": []
}
}
}
As you can see the error makes reference to an invalid text value, but I can't determine where the problem could be. This is the input
{
"method": "post",
"path": "/datasets/https%253A%252F%252Fmycompany.sharepoint.com%252Fsites%252FITInfrastructure-CollaborationMIddleware/httprequest",
"host": {
"connection": {
"name": "/subscriptions/634e0965-c22c-4e55-ba34-7d320d396e24/resourceGroups/eastus-auto-rg/providers/Microsoft.Web/connections/sharepointonline-2"
}
},
"body": {
"body": "{\"BannerImageUrl\":\"https://i0.wp.com/office365itpros.com/wp-content/uploads/2022/06/O365Cover_800-1.jpg?w=800&ssl=1\",\"Description\":\"Microsoft Graph Support for SharePoint Online Tenant Settings\",\"IsBannerImageUrlExternal\":true,\"OriginalSourceUrl\":\"https://office365itpros.com/2022/07/19/microsoft-graph-api-tenantadmin/?utm_source=rss&utm_medium=rss&utm_campaign=microsoft-graph-api-tenantadmin\",\"ShouldSaveAsDraft\":false,\"Title\":\"Office365 IT Pros - The new tenant admin Microsoft Graph API allows access to read and update SharePoint Online tenant settings. Although the API offers limited capabilities for now, it marks the start of Graph support for tenant settings that are currently managed through admin portals or PowerShell. It's a welcome development.\",\"__metadata\":{\"type\":\"SP.Publishing.RepostPage\"}}",
"headers": {
"accept": "application/json",
"content-type": "application/json;odata=verbose;charset=utf-8"
},
"method": "POST",
"uri": "_api/sitepages/pages/reposts"
}
}
I even tried running the Logic App by resubmitting a trigger which had previously been successfully processed and it also now fails. I found this article https://powerusers.microsoft.com/t5/Using-Connectors/Send-an-HTTP-Request-to-SharePoint-fails-with-502-on-recurrence/td-p/131278, because Power Automate is essentially the same, which suggested that putting in a step which connects to the site before attempting the POST step would work, but this has not resolved the issue.