Azure HTTP Function Job

The Azure HTTP Function job type invokes a function hosted in an Azure Function App — an HTTP-triggered function (regular or Durable orchestrator, both of which expose an HTTP endpoint) or, since the 2026-09-29 second pass, any non-HTTP function (timer, queue, blob, Event Hub, Service Bus) run on demand through the Functions admin API. The function is identified by its name (plus optional route template) — Polysync stores that in the Job's External Id.

How a job is started is decided at dispatch time: on management-capable auth methods Polysync reads the function's trigger binding from the control plane and invokes HTTP triggers on their public URL, while every other trigger goes through the on-demand path (see On-demand execution). Where the binding cannot be read — execution-only platforms (Function Key / Anonymous — no management access), or a failed read — the job's Trigger Type decides: HTTP calls the URL, Non-HTTP (on demand) uses the admin API, and Orchestration is refused with an explanation. A job saved before Trigger Type existed, and never given one, is still routed by whether HTTP Method is set.

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 Type — Azure HTTP Function (set automatically on import).
  • Trigger Type — job attribute Trigger Type: HTTP, Non-HTTP (on demand) or Orchestration. Import fills it from the function's trigger binding. On a Function Key or Anonymous platform jobs are created by hand, so pick it yourself — a timer, queue or blob function needs Non-HTTP (on demand). It has no default on purpose, so an unset value never pretends to be a choice.
  • HTTP Method — job attribute HTTP Method. Defaults to POST when not set. Determines where parameters are placed (see Parameter handling). Shown only while Trigger Type is HTTP or not set.

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 every trigger type — HTTP, Durable orchestration, timer, queue, blob, Event Hub and Service Bus. HTTP-triggered functions are invoked on their public URL; functions with any other trigger become on-demand jobs (see On-demand execution). Each imported job's Trigger Type is set from the binding.

The trigger's route template is captured so route placeholders can be substituted from Polysync parameters at run time. Discovery only creates parameters that are part of the function's real contract: route placeholders for HTTP functions, and a single input parameter for non-HTTP functions. (The legacy fabricated RequestBody/QueryParams pair was removed on 2026-09-29.)

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 supported as manual escape hatches (they are no longer created automatically — add them by hand when a function needs them):

  • 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.
  • QueryParams — pre-encoded name=value pairs appended to the query string verbatim; with an Output direction it is populated from the function's response instead (the live-test functions echo the query they received, which proves parameter placement).
  • input — for on-demand (non-HTTP) jobs, the value sent as the admin API payload {"input": …}.

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 when the attribute is set — it is optional, so Anonymous platforms invoke without the 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 — a running Durable orchestration can be terminated: the provider resolves the durabletask_extension system key through /admin/host/systemkeys and POSTs the instance terminate route (…/runtime/webhooks/durabletask/instances/{id}/terminate). This needs a host/master key — the platform's Function Key attribute when it holds one, otherwise the key is fetched via the Management API (management-capable auth only). Plain HTTP invocations have no cancellation primitive; Cancel returns false for them. Use Cancel on the run in the Monitor page to stop a running orchestration.

On-demand execution (non-HTTP triggers)

Timer, queue, blob, Event Hub and Service Bus triggered functions have no HTTP endpoint, so Polysync starts them through the Functions admin API:

POST https://{Function App URL}/admin/functions/{functionName}
{ "input": "<the job's input parameter value>" }
  • The admin namespace requires a host or master key. Set the platform's Function Key attribute to a host/master key, or use a management-capable auth method so Polysync fetches the master key automatically. A function-level key is rejected by the host (403).
  • A successful call returns 202 Accepted — Polysync reports the run as Success with a message explaining the fire-and-forget contract: the host acknowledges the run but returns no output values. Use the Monitor URL to follow the run in the Function App's portal run history.
  • Orchestration triggers cannot be invoked directly and are refused with an instructive message — start them through your Durable client (HTTP starter) function, which returns the statusQueryGetUri protocol. A job whose Trigger Type is Orchestration is refused before any call is made.

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).