Skip to main content
Use the Siteline Azure CDN Log Processor to track Azure CDN or Front Door traffic with Siteline. This integration processes CDN diagnostic logs from Blob Storage, triggers on blob-created events via Event Grid, and forwards pageview events to the Siteline API — no application code changes required.

Prerequisites

  • A Siteline website key
  • An existing Azure CDN or Front Door profile
  • Azure CLI configured for the target subscription
  • Node.js 18+ and npm
Azure CDN diagnostic logs are batched hourly. Expect a 5–60 minute delay between a CDN request and the pageview appearing in Siteline.

Setup

1

Clone and install

git clone https://github.com/siteline-ai/siteline-azure-cdn.git
cd siteline-azure-cdn
npm install
2

Log in to Azure

az login
3

Run the setup wizard

npm run setup
The interactive wizard will:
  • Prompt for your Siteline website key
  • List available CDN / Front Door profiles in your subscription
  • Provision all required Azure resources via Bicep (storage account, Function App, Event Grid subscription, diagnostic settings)

How it works

This integration uses Diagnostic Settings, Blob Storage, Event Grid, and Azure Functions:
Azure CDN / Front Door (diagnostic logs)
  -> Blob Storage (cdn-logs container)
  -> Event Grid (BlobCreated)
  -> Azure Function (processor)
  -> Siteline intake API
Processing flow:
  1. Azure CDN or Front Door writes hourly log batches to Blob Storage via Diagnostic Settings.
  2. Blob Storage emits BlobCreated events to Event Grid.
  3. Event Grid triggers the Azure Function processor.
  4. The Function downloads and decompresses the log blob.
  5. The Function parses records, normalizes fields across all CDN SKUs (Standard Microsoft, Standard/Premium Verizon, Front Door Standard/Premium), and sends pageview events to Siteline with 10 concurrent requests and 3 retries.
Failed events are routed to a dead-letter queue (dlq container) for inspection.

Configuration

All settings are defined in infra/main.bicepparam and can be edited directly before running setup.
sitelineWebsiteKey
string
required
Your Siteline website key. Used to authenticate requests to the Siteline API.
cdnProfileResourceId
string
required
The full Azure resource ID of the target CDN or Front Door profile.
location
string
Azure deployment region. Defaults to eastus.
storageAccountName
string
Storage account name. Defaults to sitelineazurecdnlogs. Must be globally unique.
functionAppName
string
Function App name. Defaults to siteline-azure-cdn-processor.
logContainerName
string
Blob container name for CDN logs. Defaults to cdn-logs.
sitelineEndpoint
string
Siteline intake endpoint. Defaults to https://api.siteline.ai/v1/intake/pageview.
sitelineDebug
boolean
Enables verbose logging in the Function App. Defaults to false.

Deploying updates

After initial setup, redeploy function code with:
npm run deploy
This rebuilds, packages, and deploys the Function App interactively, prompting for resource group and function app with saved defaults.

Troubleshooting

Install the Azure CLI and ensure it is available on your PATH.
Verify you are logged into the correct Azure subscription. You can also enter the CDN profile resource ID manually when prompted.
Storage account names are globally unique. Edit storageAccountName in infra/main.bicepparam with a unique name and rerun setup.
Role assignments can take 1–2 minutes to propagate. Wait briefly and rerun npm run setup — Bicep deployments are idempotent.
The setup wizard auto-resolves this. If it persists, specify a concrete region like eastus in the location parameter.
Diagnostic logs are batched hourly — wait up to 60 minutes after initial setup. If pageviews still don’t appear, check the dlq blob container for failed events.
Edit parameters directly in infra/main.bicepparam and rerun npm run setup. The Bicep deployment is idempotent and will update resources in place.
Need help? Book a setup call and we’ll walk you through it.