Azure App Service
Deploy the Levo PCAP Sensor as a sidecar container alongside your app running on Azure App Service to capture API traffic, with no changes to your application code.
Azure App Service sidecar containers are only supported on Linux App Service plans. Windows App Service does not support this feature. See Microsoft's Sidecars overview for details.
Prerequisites
- Your app is deployed on Azure App Service as a Linux custom container.
- Sidecar support is enabled on your App Service. If you're creating a new Web App, enable the "Enhanced configuration with sidecar support" toggle on the Container tab during creation. For an existing app, see Enable sidecar support for Linux custom containers.
- You have the Azure CLI installed and are logged in (
az login), or access to the Azure Portal. - A Levo Satellite is already installed and reachable from your App Service. See Satellite via Docker (or another Satellite install guide) if you haven't set one up yet.
We recommend running Satellite separately from the App Service (for example, on its own VM), rather than as a sidecar. Satellite depends on additional components (a message queue, tagger, etc.) that are heavier than the sidecar model is intended for.
How It Works
All containers in a sidecar-enabled App Service share the same network namespace and communicate over localhost. The PCAP Sensor sidecar passively captures traffic on the shared network interfaces, including traffic to and from your main app container, and forwards it to your Satellite.
Add the PCAP Sensor as a Sidecar
The steps below use the Azure CLI, since it lets you specify every setting in one place. You can alternatively do this from the Azure Portal — go to your App Service > Deployment Center > Containers > Add — following Microsoft's Tutorial: Configure a sidecar for a custom container app for the click-by-click flow. The environment variables and image below are the same either way.
1. Set the sensor's configuration as App Settings
When you configure a sidecar's environment variables via the Azure CLI (--sitecontainers-spec-file, below), each variable's value must be the name of an existing App Setting, not the literal value itself. If you skip this step and put a literal value directly in the sidecar spec, the sidecar will fail to create with an error like is not an app setting.
az webapp config appsettings set \
--resource-group <your-resource-group> \
--name <your-app-name> \
--settings \
SATELLITE_URL="http://<satellite-host>:80" \
APP_ENVIRONMENT="staging" \
ORG_ID="<your-org-id>" \
WORKSPACE_ID="<your-workspace-id>"
These are the same org ID, workspace ID, and Satellite URL used by any other Levo sensor, not something specific to the PCAP Sensor. The names above (SATELLITE_URL, ORG_ID, etc.) are just labels for this App Setting — call them whatever you like, as long as the name matches what you reference in the sidecar spec below.
| App Setting | Description |
|---|---|
SATELLITE_URL | The URL of your Satellite, reachable from Azure, for example http://<satellite-host>:80. |
APP_ENVIRONMENT | The environment the app should show up under in Levo's dashboard, for example staging or production. |
ORG_ID | Your organization's ID. Obtain it from the settings page or by clicking on your profile picture in Levo's dashboard and navigating to User Settings -> Organizations. |
WORKSPACE_ID | Your workspace's ID, obtained from the same settings page. |
2. Create the sidecar container
Create a spec file that defines the sidecar, referencing the App Settings by name:
cat > pcap-sensor-sidecar.json << 'EOF'
[
{
"name": "pcap-sensor",
"properties": {
"image": "levoai/pcap-sensor:0.4.9",
"targetPort": "4000",
"isMain": false,
"environmentVariables": [
{ "name": "LEVO_SATELLITE_URL", "value": "SATELLITE_URL" },
{ "name": "LEVO_APP_ENVIRONMENT", "value": "APP_ENVIRONMENT" },
{ "name": "LEVO_ORG_ID", "value": "ORG_ID" },
{ "name": "LEVO_WORKSPACE_ID", "value": "WORKSPACE_ID" }
]
}
}
]
EOF
az webapp sitecontainers create \
--resource-group <your-resource-group> \
--name <your-app-name> \
--sitecontainers-spec-file pcap-sensor-sidecar.json
The targetPort value is not exposed externally; the PCAP Sensor does not serve any requests itself, but Azure requires a port to be specified for every sidecar.
3. Verify it's running
The app restarts automatically after the sidecar is added. Confirm the sidecar started successfully:
az webapp sitecontainers status \
--resource-group <your-resource-group> \
--name <your-app-name> \
--container-name pcap-sensor
Look for "Status": "Running". To view its logs directly (for example, to confirm it's capturing and exporting traffic):
az webapp sitecontainers log \
--resource-group <your-resource-group> \
--name <your-app-name> \
--container-name pcap-sensor
A healthy sensor logs lines like Running learn mode on interfaces lo, eth0, followed by N traces captured on interface eth0 and Successfully exported spans to satellite as traffic flows through your app.