Azure HTTP Function Job

The Azure HTTP Function job type invokes an HTTP-triggered function hosted in an Azure Function App (regular HTTP triggers and Durable Functions orchestrator triggers, both of which expose an HTTP endpoint). The function is identified by its name (plus optional route template) — Polysync stores that in the Job's External Id.

This job type is supported on the Azure Functions platform.

Required job fields

  • External Id — the function name (MyFunction) or name-with-route-template (MyFunction/users/{id}). Route placeholders are substituted from Polysync parameters at run time.
  • Job TypeAzure HTTP Function (set automatically on import).
  • HTTP Method — job attribute HTTP Method. Defaults to POST when not set. Determines where parameters are placed (see Parameter handling).

Job discovery

Polysync calls GET https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{functionApp}/functions?api-version=2025-03-01 and imports any function whose binding contains httpTrigger or orchestrationTrigger (Durable Functions orchestrators are also invoked over HTTP).

The trigger's route template is captured so route placeholders can be substituted from Polysync parameters at run time.

Parameter handling

The provider builds the outgoing HTTP request based on the configured HTTP Method:

Method Where Polysync parameters go
GET, HEAD, DELETE Query string (?name=value&…)
POST, PUT, PATCH JSON body ({ "name": <typed-value>, … })
any Route placeholders ({id} in the route template) are substituted from a matching Polysync parameter regardless of method.

Two parameter names are reserved:

  • RequestBody — when present, its value is sent as the entire body verbatim (other parameters go to the query string).
  • QueryString — when present, its value must be a JSON array of { "name": …, "value": … } objects; each entry is appended to the query string.

Values are typed via the parameter's Data Type:

Polysync Data Type JSON token / encoded form
String / Secret String
Int / Float JSON number
Bool JSON true / false
JSON / JsonArray Raw JSON object / array (embedded verbatim in the body)
Direction Sent in request Updated from response
Input
Output
Input&Output

The function-app function key (Platform attribute Function Key) is added automatically as the x-functions-key header.

Output parameters

For synchronous (regular) HTTP triggers that return HTTP 200, the response body is parsed as JSON and any top-level property whose name matches a Polysync Output / Input&Output parameter (case-insensitive) is written back to that parameter.

For Durable Functions, the immediate 202 response is parsed for the standard orchestrator URLs (statusQueryGetUri, sendEventPostUri, terminatePostUri); the statusQueryGetUri is reused for status polling and the final orchestrator output is extracted from the polled status response when the run completes.

Execution flow

  1. Polysync resolves the function URL (https://{functionAppUrl}/api/{route-or-name}) substituting route placeholders from parameters.

  2. Polysync issues the configured HTTP method with the assembled body / query string and the x-functions-key header.

  3. On HTTP 200 with no Durable async indicators → result is read synchronously and output parameters are populated immediately.

  4. On HTTP 202 with Durable async indicators → Polysync returns Status = Running and stores statusQueryGetUri as the StatusQueryUrl for polling.

  5. Polysync polls the durable status URL (also appending x-functions-key) and decodes runtimeStatus:

    Durable Function runtimeStatus Polysync status
    Pending Starting
    Running / ContinuedAsNew Running
    Completed Success
    Failed Failed
    Canceled / Terminated Cancelled

    Without a statusQueryGetUri (regular HTTP trigger that returned a non-200), status is reported as Unknown.

  6. Cancel is not supported — Azure Functions has no cancellation primitive for in-flight HTTP invocations or running Durable orchestrators that's safe to call from Polysync.

Monitor URL

https://portal.azure.com/#@/resource/subscriptions/{subscriptionId}
  /resourceGroups/{resourceGroupName}
  /providers/Microsoft.Web/sites/{functionAppName}
  /functions/{functionName}

Best practices

  • Match the Data Type to the JSON shape the function expects — particularly use JSON / JsonArray for nested payloads instead of pre-serializing them into a string.
  • For long-running work, prefer a Durable Function orchestrator over a regular HTTP trigger so Polysync can poll status reliably (regular HTTP triggers report Unknown once the call returns 200).
  • Use the Anonymous auth method only when the function key truly is not required (e.g., AAD-protected functions behind APIM); otherwise store the function key in the Platform attribute as normal.

Troubleshooting

  • HTTP 401 Unauthorized — the Platform's Function Key attribute is missing or wrong. Refresh the key in the Azure portal and update the Platform.
  • Route placeholder left literal in URL — no Polysync parameter matches the placeholder name. Add a parameter with the exact name used in the route template ({id} → parameter id).
  • Output parameter stays empty after a synchronous call — the function did not return a JSON object at the root, or the property name does not match the parameter name (case-insensitive). Wrap the function's return value in return new { score, ... } (or its language equivalent).
  • Durable run reports Unknown forever — the response did not include statusQueryGetUri; check that the orchestrator returns the standard 202 response (don't override the binding output).