Error: Unable to Access Cloud Function
Issue
While testing an Azure Functions connection, the following errors appear:
- `Unable to access cloud function: Function Error: Optional
Error response from cloud function : ResponseProcessingException : org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/plain;charset=utf-8, type=class com.fivetran.integrations.functions.common.Response, genericType=class com.fivetran.integrations.functions.common.Response.
Environment
Connector: Azure Functions
Resolution
To resolve this issue, update your Azure Functions code to return a JSON-formatted response and set the Content-Type header to application/json. For more information, see our Azure Functions response format documentation.
Cause
This issue occurs when the Azure Function returns plain text instead of JSON. We expect JSON responses for both successful and failed requests. If the function returns a string without explicitly constructing a JSON response, Azure Functions may default to text/plain. We then try to parse the response as JSON, which causes the error.