Intermittent 404 (HTML response) from Salesforce Connector in Logic Apps (UK South) across multiple operations
- Dominant language
- TypeScript
- Stars
- 111
- Forks
- 109
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 20
Description
### Severity
P1 - Critical (Blocking production)
### Describe the Bug with repro steps
Description
We are experiencing intermittent HTTP 404 errors when using the Salesforce connector in Azure Logic Apps (UK South region).
The issue occurs across multiple connector operations, including:
Execute SOQL query
Update record (PATCH)
The failures occur with identical configurations and payloads, while other runs succeed.
Error Details
Status Code: 404
Source: logic-apis-uksouth.azure-apim.net
Message: "The response is not in a JSON format."
Response contains HTML (IIS 404 page) instead of JSON
Additional headers observed:
x-ms-apihub-cached-response: true
The response body contains:
"404 - File or directory not found."
**Observed Behaviour**
Same Logic App, same connection, same payload:
Some runs succeed
Some runs fail with 404
Failures occur across different connector operations
Failures appear to occur before reaching Salesforce
HTML response suggests routing failure at API Management / connector backend layer
**Expected Behaviour**
Connector should return:
Valid JSON response from Salesforce, or
A valid Salesforce error response
Connector should not return HTML responses
**Business Impact**
This Logic App supports a production workflow for document processing and fulfilment.
Due to the issue:
Salesforce data cannot be reliably retrieved or updated
Documents are not consistently processed end-to-end
Files may not be sent to downstream systems
Salesforce records may remain out of sync
There is a risk of backlog and manual reprocessing
**Additional Context**
Issue is intermittent and not consistently reproducible
Occurs across multiple operations (not query or payload specific)
Direct HTTP calls to Salesforce (OAuth and file retrieval) are working correctly
Indicates the issue is isolated to the Azure Salesforce connector layer
**Availability Note**
I will be travelling outside the country and, due to company policy, I will have no access to the Azure portal, emails, or phone during this period.
Please do not close the ticket due to inactivity, as I will not be able to respond until I return, which will be after 12th April.
Given this is impacting a production workflow, I would appreciate if the investigation can continue based on the details already provided.
### What type of Logic App Is this happening in?
Consumption (Portal)
### Are you experiencing a regression?
Seen for the first time.
### Which operating system are you using?
Windows
### Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg
Yes
### Workflow JSON
```json
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"triggers": {
"Recurrence": {
"recurrence": {
"interval": 1,
"frequency": "Day",
"timeZone": "GMT Standard Time",
"startTime": "2024-04-01T21:00:00Z",
"schedule": {
"hours": [
3
],
"minutes": [
0
]
}
},
"evaluatedRecurrence": {
"interval": 1,
"frequency": "Day",
"timeZone": "GMT Standard Time",
"startTime": "2024-04-01T21:00:00Z",
"schedule": {
"hours": [
3
],
"minutes": [
0
]
}
},
"type": "Recurrence"
}
},
"actions": {
"Scope_Process_FPN_Print_And_Fulfilment": {
"actions": {
"If_there_are_files_to_be_printed": {
"actions": {
"Get_Salesforce-Live-Password": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('Salesforce-Live-Password')}/value"
}
},
"Get_Salesforce_API_Client_Secret": {
"runAfter": {
"Get_Salesforce-Live-Password": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('Salesforce-API-Client-Secret')}/value"
}
},
"Get_Salesforce_Live_Security_Token": {
"runAfter": {
"Get_Salesforce_API_Client_Secret": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('Salesforce-Live-Security-Token')}/value"
}
},
"Get_Salesforce_Access_Token": {
"runAfter": {
"Get_Salesforce_Live_Security_Token": [
"Succeeded"
]
},
"type": "Http",
"inputs": {
"uri": "https://login.salesforce.com/services/oauth2/token",
"method": "POST",
"headers": {
"Content-type": "multipart/form-data; boundary=SalesforceTokenGeneration"
},
"body": "--SalesforceTokenGeneration\nContent-Disposition: form-data; name=\"username\"\n\n@{parameters('Salesforce_Username')}\n\n--SalesforceTokenGeneration\nContent-Disposition: form-data; name=\"password\"\n\n@{concat(body('Get_Salesforce-Live-Password')?['value'],body('Get_Salesforce_Live_Security_Token')?['value'])}\n\n--SalesforceTokenGeneration\nContent-Disposition: form-data; name=\"grant_type\"\n\npassword\n\n--SalesforceTokenGeneration\nContent-Disposition: form-data; name=\"client_id\"\n\n@{parameters('Salesforce_API_Client_ID')}\n\n--SalesforceTokenGeneration\nContent-Disposition: form-data; name=\"client_secret\"\n\n@{body('Get_Salesforce_API_Client_Secret')?['value']}\n\n--SalesforceTokenGeneration--"
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
},
"Parse_Salesforce_Access_Token_Message": {
"runAfter": {
"Get_Salesforce_Access_Token": [
"Succeeded"
]
},
"type": "ParseJson",
"inputs": {
"content": "@body('Get_Salesforce_Access_Token')",
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"instance_url": {
"type": "string"
},
"id": {
"type": "string"
},
"token_type": {
"type": "string"
},
"issued_at": {
"type": "string"
},
"signature": {
"type": "string"
}
}
}
}
},
"For_each_Document": {
"foreach": "@body('Get_ContentDocumentId_from_ContentVersion')?['value']",
"actions": {
"Get_FPN_File_from_Salesforce": {
"type": "Http",
"inputs": {
"uri": "@concat(body('Parse_Salesforce_Access_Token_Message')?['instance_url'],item()?['VersionData'])",
"method": "GET",
"headers": {
"Authorization": "Bearer @{body('Parse_Salesforce_Access_Token_Message')?['access_token']}"
}
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
},
"Get_LinkedEntityId_from_ContentDocumentLink": {
"runAfter": {
"Get_FPN_File_from_Salesforce": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['salesforce']['connectionId']"
}
},
"method": "post",
"body": {
"query": "SELECT LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentID = '@{item()?['ContentDocumentId']}'"
},
"path": "/soql/executesoqlquery"
}
},
"For_each_LinkedEntityId": {
"foreach": "@body('Get_LinkedEntityId_from_ContentDocumentLink')?['records']",
"actions": {
"Get_Name_from_Process": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['salesforce']['connectionId']"
}
},
"method": "post",
"body": {
"query": "SELECT Name, RecordTypeId, arcusregserv__Status__c from arcusregserv__RS_Activity__c WHERE Id='@{items('For_each_LinkedEntityId')?['LinkedEntityId']}'"
},
"path": "/soql/executesoqlquery"
}
},
"If_Process_Name_found": {
"actions": {
"Create_file_in_SharePoint": {
"runAfter": {
"Append_to_Process_Statuses": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['sharepointonline']['connectionId']"
}
},
"method": "post",
"body": "@body('Get_FPN_File_from_Salesforce')",
"path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://officesharedservice.sharepoint.com/sites/ITSS-MobileWorking'))}/files",
"queries": {
"folderPath": "/Shared Documents/Staging/Files to Print/Prod",
"name": "@concat(body('Get_Name_from_Process')?['records'][0]?['Name'],'_',formatDateTime(convertTimeZone(utcNow(),'UTC','GMT Standard Time'),'yyyy-MM-ddTHH-mm-ss'),'_',items('For_each_Document')?['PathOnClient'])",
"queryParametersSingleEncoded": true
}
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
},
"Call_Ricoh_SFTP_API_Workflow": {
"runAfter": {
"Create_file_in_SharePoint": [
"Succeeded"
]
},
"type": "Http",
"inputs": {
"uri": "https://wcc-prd-commonftp-las.azurewebsites.net:443/api/wcc-prd-safer-cities-ricoh-mba-fpn-ob-wf/triggers/Receive_Ricoh_Files/invoke?api-version=2022-05-01&sp=%2Ftriggers%2FReceive_Ricoh_Files%2Frun&sv=1.0&sig=Lf7kLPnbd7uWY35wtSI9k1E_u5myMsOAVVtkegC7WHQ",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"fileName": "@{concat(body('Get_Name_from_Process')?['records'][0]?['Name'],'_',formatDateTime(convertTimeZone(utcNow(),'UTC','GMT Standard Time'),'yyyy-MM-ddTHH-mm-ss'),'_',items('For_each_Document')?['PathOnClient'])}",
"fileContent": "@{body('Get_FPN_File_from_Salesforce')?['$content']}"
},
"retryPolicy": {
"type": "fixed",
"count": 3,
"interval": "PT300S"
}
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
},
"Update_Print_And_Fulfil_to_No_in_Content_Version": {
"runAfter": {
"Call_Ricoh_SFTP_API_Workflow": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['salesforce']['connectionId']"
}
},
"method": "patch",
"body": {
"Title": "@items('For_each_Document')?['Title']",
"WCC_Print_and_Fulfil__c": false,
"Submitted_Date__c": "@utcNow()"
},
"path": "/v3/datasets/default/tables/@{encodeURIComponent(encodeURIComponent('ContentVersion'))}/items/@{encodeURIComponent(encodeURIComponent(items('For_each_Document')?['Id']))}"
}
},
"Update_Process_Record": {
"runAfter": {
"Update_Print_And_Fulfil_to_No_in_Content_Version": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['salesforce']['connectionId']"
}
},
"method": "patch",
"body": {
"arcusregserv__Served_Date__c": "@formatDateTime(utcNow(),'yyyy-MM-dd')",
"arcusregserv__Status__c": "@if(\n and( greater(length(body('Get_Name_from_Process')?['records']), 0),\n equals(\n body('Get_Name_from_Process')?['records']?[0]?['RecordTypeId'], parameters('Salesforce_Process_RecordTypeId')\n )\n ),\n 'Notice Served',\n body('Get_Name_from_Process')?['records']?[0]?['arcusregserv__Status__c']\n)"
},
"path": "/v3/datasets/default/tables/@{encodeURIComponent(encodeURIComponent('arcusregserv__RS_Activity__c'))}/items/@{encodeURIComponent(encodeURIComponent(items('For_each_LinkedEntityId')?['LinkedEntityId']))}"
}
},
"Append_to_Process_Ids": {
"type": "AppendToArrayVariable",
"inputs": {
"name": "Process_Ids",
"value": "@items('For_each_LinkedEntityId')?['LinkedEntityId']"
}
},
"Append_to_Process_Names": {
"runAfter": {
"Append_to_Process_Ids": [
"Succeeded"
]
},
"type": "AppendToArrayVariable",
"inputs": {
"name": "Process_Names",
"value": "@body('Get_Name_from_Process')?['records']?[0]?['Name']"
}
},
"Append_to_Process_Statuses": {
"runAfter": {
"Append_to_Process_Names": [
"Succeeded"
]
},
"type": "AppendToArrayVariable",
"inputs": {
"name": "Process_Statuses",
"value": "@if(\n equals(\n body('Get_Name_from_Process')?['records']?[0]?['RecordTypeId'], parameters('Salesforce_Process_RecordTypeId')\n ),\n 'Notice Served',\n coalesce(\n body('Get_Name_from_Process')?['records']?[0]?['arcusregserv__Status__c'],\n 'UNKNOWN'\n )\n)"
}
}
},
"runAfter": {
"Get_Name_from_Process": [
"Succeeded"
]
},
"else": {
"actions": {}
},
"expression": {
"and": [
{
"not": {
"equals": [
"@body('Get_Name_from_Process')?['totalSize']",
0
]
}
}
]
},
"type": "If"
}
},
"runAfter": {
"Get_LinkedEntityId_from_ContentDocumentLink": [
"Succeeded"
]
},
"type": "Foreach",
"runtimeConfiguration": {
"concurrency": {
"repetitions": 1
}
}
}
},
"runAfter": {
"Parse_Salesforce_Access_Token_Message": [
"Succeeded"
]
},
"type": "Foreach",
"runtimeConfiguration": {
"concurrency": {
"repetitions": 1
}
}
}
},
"runAfter": {
"Get_ContentDocumentId_from_ContentVersion": [
"Succeeded"
]
},
"else": {
"actions": {}
},
"expression": {
"and": [
{
"greater": [
"@length(body('Get_ContentDocumentId_from_ContentVersion')?['value'])",
0
]
}
]
},
"type": "If"
},
"Get_ContentDocumentId_from_ContentVersion": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['salesforce']['connectionId']"
}
},
"method": "get",
"path": "/datasets/default/tables/@{encodeURIComponent(encodeURIComponent('ContentVersion'))}/items",
"queries": {
"$filter": "IsLatest eq true and WCC_Print_and_Fulfil__c eq true"
}
}
}
},
"runAfter": {
"Initialize_variables": [
"Succeeded"
]
},
"type": "Scope"
},
"Send_Failure_Notification_Email": {
"runAfter": {
"Scope_Process_FPN_Print_And_Fulfilment": [
"Failed"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"body": {
"To": "@parameters('Notification_Distribution_List')",
"Subject": "Azure Notification - Logic App <@{workflow()['name']}> Failure !!",
"Body": "
Logic App Name: @{workflow()['name']}
Run History Identifier: @{workflow()['run']['name']}
Related Record Details:
Process Ids:
@{variables('Process_Ids')}
Process Names:
@{variables('Process_Names')}
Process Statuses:
@{variables('Process_Statuses')}
","Importance": "High"
},
"path": "/v2/Mail"
}
},
"Initialize_variables": {
"runAfter": {},
"type": "InitializeVariable",
"inputs": {
"variables": [
{
"name": "Process_Ids",
"type": "array"
},
{
"name": "Process_Names",
"type": "array"
},
{
"name": "Process_Statuses",
"type": "array"
}
]
}
}
},
"outputs": {},
"parameters": {
"Salesforce_Username": {
"defaultValue": "jmeredith2@westminster.gov.uk",
"type": "String"
},
"Salesforce_API_Client_ID": {
"defaultValue": "3MVG9DREgiBqN9WlGFYoA8u0hdldeCznT3NT2ke0SDNDVSwNY4_f8J5_5GzfhUCS0JNtEOVP1I79XgywjMeQ6",
"type": "String"
},
"Salesforce_Live_URL": {
"defaultValue": "https://login.salesforce.com",
"type": "String"
},
"Notification_Distribution_List": {
"defaultValue": "wcc-int-notifications@westminster.gov.uk;safecitydigital@westminster.gov.uk",
"type": "String"
},
"Salesforce_Process_RecordTypeId": {
"defaultValue": "0128d000000Y9CxAAK",
"type": "String"
},
"$connections": {
"type": "Object",
"defaultValue": {}
}
}
},
"parameters": {
"$connections": {
"type": "Object",
"value": {
"keyvault": {
"id": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/providers/Microsoft.Web/locations/uksouth/managedApis/keyvault",
"connectionId": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/resourceGroups/wcc-prd-scf-rg/providers/Microsoft.Web/connections/keyvault",
"connectionName": "keyvault",
"connectionProperties": {
"authentication": {
"type": "ManagedServiceIdentity"
}
}
},
"salesforce": {
"id": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/providers/Microsoft.Web/locations/uksouth/managedApis/salesforce",
"connectionId": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/resourceGroups/wcc-prd-scf-rg/providers/Microsoft.Web/connections/salesforce",
"connectionName": "salesforce",
"connectionProperties": {}
},
"sharepointonline": {
"id": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/providers/Microsoft.Web/locations/uksouth/managedApis/sharepointonline",
"connectionId": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/resourceGroups/wcc-prd-scf-rg/providers/Microsoft.Web/connections/sharepointonline",
"connectionName": "sharepointonline",
"connectionProperties": {}
},
"office365": {
"id": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/providers/Microsoft.Web/locations/uksouth/managedApis/office365",
"connectionId": "/subscriptions/6a4aa4e1-b4ef-4ce0-94b8-5b9db96d6087/resourceGroups/wcc-prd-scf-rg/providers/Microsoft.Web/connections/office365-2",
"connectionName": "office365-2",
"connectionProperties": {}
}
}
}
}
}
```
### Screenshots or Videos
### Environment
Environment
Service: Microsoft Azure Logic Apps (Consumption)
Connector: Salesforce Connector (Shared)
Region: UK South
Execution Type: Scheduled (Recurrence trigger – daily run at 03:00 GMT)
Authentication: API Connection (OAuth via Salesforce)
Integration Pattern:
Logic App → Salesforce Connector (SOQL + Update operations)
Logic App → HTTP (Salesforce token + file retrieval)
Logic App → SharePoint + downstream SFTP workflow
Browser: Chrome (latest)
Azure Portal: Web-based (no VS Code used)
Azure CLI: Not used
### Additional context
Additional Context
The issue is intermittent — same Logic App, same connection, same payload:
Some runs succeed
Some runs fail with HTTP 404
Failures occur across multiple Salesforce connector operations, including:
Execute SOQL query
Update record (PATCH)
The failure response consistently includes:
404 from logic-apis-uksouth.azure-apim.net
HTML error page (404 - File or directory not found)
"The response is not in a JSON format"
The presence of header:
x-ms-apihub-cached-response: true
indicates the request is failing within the Azure connector/APIM layer, before reaching Salesforce
The same Logic App also uses direct HTTP calls to Salesforce (OAuth + file retrieval) which are working consistently, further indicating the issue is isolated to the connector layer
The issue impacts a production workflow responsible for document processing and fulfilment, and causes:
Incomplete processing
Missing updates in Salesforce
Downstream integration failures
No recent changes have been made to:
Logic App definition
Salesforce schema
Connector configuration
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.