Skip to Content

Azure Functions

Send data to an Azure Functions HTTP trigger endpoint. Use Zeotap to push audience data, model results, or enriched profiles to your custom Azure Functions for serverless processing, transformation, or downstream routing.

Prerequisites

  • An Azure account with an active subscription
  • An Azure Functions app with at least one HTTP trigger function deployed
  • The function URL and an appropriate authentication key (function key, API key, or Azure AD token)

Authentication

Azure Functions supports three authentication methods. Choose the one that matches your function’s authorization level.

Function Key (Default)

This is the most common method for Azure Functions. The function key is appended as a code query parameter.

  1. In the Azure Portal, navigate to your Function App
  2. Select your function and click Function Keys (or App Keys for host-level keys)
  3. Copy the default key or create a new one
  4. In Zeotap, select Function Key as the auth method and paste the key

API Key

Use this method when your function expects an API key in the x-functions-key header.

  1. Obtain your API key from the Azure Portal or your function’s configuration
  2. In Zeotap, select API Key as the auth method
  3. Paste the API key value

Bearer Token

Use this method when your function is protected by Azure Active Directory (Azure AD) authentication.

  1. Register an application in Azure AD and configure your function app to require authentication
  2. Obtain an access token for the registered application
  3. In Zeotap, select Bearer Token as the auth method
  4. Paste the access token

Configuration

FieldTypeRequiredDescription
Function URLTextYesThe full URL of your Azure Functions HTTP trigger endpoint (e.g., https://my-app.azurewebsites.net/api/my-function)
HTTP MethodSelectNoHTTP method to use: POST (default), PUT, or PATCH

Supported Operations

Sync Modes

ModeSupported
InsertYes
UpsertYes
Update
Mirror

Audience Sync Modes

ModeSupported
AddYes
RemoveYes
MirrorYes
UpsertYes

Features

  • Field Mapping: Yes — map source columns to destination field names sent in the payload
  • Schema Introspection: No — Azure Functions accept arbitrary JSON payloads

How It Works

Zeotap sends data to your Azure Functions endpoint as JSON HTTP requests:

  1. Rows are collected into a batch and serialized as a JSON payload
  2. The payload includes a sync_mode field and an array of rows, each containing data, operation, and primary_key
  3. Authentication is applied based on the selected method (query parameter, header, or bearer token)
  4. Sync metadata is included as HTTP headers (X-Sync-Mode, X-Batch-Size) for routing without body parsing
  5. Your function processes the payload and returns an HTTP status code

Payload Format

{ "sync_mode": "upsert", "rows": [ { "data": { "email": "user@example.com", "name": "Jane Doe", "segment": "high_value" }, "operation": "added", "primary_key": "user@example.com" } ] }

HTTP Headers

HeaderDescription
Content-TypeAlways application/json
X-Sync-ModeThe sync mode for this batch (e.g., upsert, insert)
X-Batch-SizeNumber of rows in the batch
x-functions-keyAPI key (when using API Key auth)
AuthorizationBearer token (when using Bearer Token auth)

Rate Limits

Azure Functions rate limits depend on your hosting plan:

  • Consumption plan: 100 concurrent executions per function app (default), up to 200
  • Premium plan: Configurable, typically higher limits
  • Dedicated plan: Based on the App Service plan tier

If your function returns HTTP 429 (Too Many Requests), Zeotap will report the error. Consider scaling your function app or reducing sync frequency if you encounter rate limit errors.

Best Practices

  • Use function-level keys rather than host keys for least-privilege access
  • Return descriptive error messages in your function’s HTTP response body — Zeotap surfaces these in sync run logs
  • Set appropriate timeouts in your function configuration to match expected processing time for batch sizes
  • Use the operation field in the payload to handle inserts, updates, and deletes differently in your function logic
  • Monitor with Application Insights to track function invocations, failures, and latency
  • Consider using a Premium or Dedicated plan for high-volume syncs to avoid cold start latency

Troubleshooting

Authentication failed (HTTP 401 or 403)

Verify your function key, API key, or bearer token is correct and not expired. For function keys, check that you are using the correct key level (function vs. host). For Azure AD tokens, ensure the token has not expired and has the correct audience claim.

Function not found (HTTP 404)

Check that the function URL is correct and the function is deployed. Verify the function app name and function name in the URL match your Azure deployment. Ensure the function app is running and not in a stopped state.

Request timeout

Azure Functions on the Consumption plan have a default timeout of 5 minutes. If your function takes longer to process a batch, consider using a Premium or Dedicated plan with a longer timeout, or reduce the batch size in your sync configuration.

Cold start latency

Functions on the Consumption plan may experience cold starts after periods of inactivity, leading to higher latency for the first batch. Use a Premium plan with always-ready instances to avoid cold starts, or configure a warm-up trigger.

HTTP 500 Internal Server Error

This indicates an error in your function code. Check your function’s Application Insights or log stream in the Azure Portal for detailed error messages. Common causes include unhandled exceptions, missing dependencies, or configuration issues.

Payload too large (HTTP 413)

Azure Functions has a default request size limit of 100 MB. If your batch exceeds this limit, reduce the number of rows per batch in your sync configuration. For very large payloads, consider using Azure Blob Storage as an intermediary.

Last updated on