Articles

Monitoring Azure integrations

CMT Software. Published

To know when an Azure integration has stopped working, watch three things: failures, backlogs and silence. Alert when runs or messages fail, when queues and dead-letter queues grow, and when data that should be flowing hasn't arrived. Send every alert to someone who knows what to do with it, and after any incident check that the backlog has drained and the systems at each end agree.

Why isn't the Azure portal enough to monitor an integration?

Everything you need is in Azure, but none of it is watching on your behalf. Stateful Logic Apps workflows keep a run history, Functions can send telemetry to Application Insights, and Service Bus and Event Grid publish metrics to Azure Monitor. If nobody has set alerts on them, the first sign of trouble is a phone call from finance asking why yesterday's orders aren't in the ledger.

An integration usually spans several services. An order might arrive through Event Grid, wait on a Service Bus queue, be processed by a Function and be posted to an ERP system through a Logic App. Each service can look healthy on its own while the flow as a whole has stopped. Monitoring has to cover each piece and the flow end to end.

What should you monitor in an Azure integration?

Failures

The obvious one. A failed Logic App run, an exception in a Function or a failed delivery from Event Grid means at least one item didn't get through. Some failures are retried and succeed, so the useful alert is usually on failures that are still failing after retries, or on a failure rate above normal.

Backlogs

A queue that keeps growing means the receiver can't keep up, or has stopped. A dead-letter queue with anything in it means an item has given up and needs a person to look at it. Both are easy to measure and both are often missed.

Silence

If a supplier stops sending files, or a webhook subscription quietly expires, nothing fails. There are simply no runs. The only way to catch it is to know what normal looks like and alert when it doesn't happen: no orders received in the last hour during trading hours, or no stock file by 7am.

The systems at each end

An integration can run without errors and still be wrong if the target system rejects records in a way that looks like success, or if records are skipped by a filter. Checks that compare counts or totals between source and target catch what the platform metrics can't.

Which Azure metrics matter most?

ServiceWatchWhat it tells you
Service BusActive messages per queue or subscriptionThe receiver is behind or stopped
Service BusDead-lettered messagesItems have failed and need attention
Service BusServer errors and throttled requestsThe namespace itself is under strain
Event GridDelivery failed, dead-lettered and dropped eventsSubscribers aren't receiving what is published
Logic AppsRuns failed, and runs startedWorkflows are failing, or not running at all
FunctionsFailed executions and exceptions in Application InsightsYour code is throwing errors
FunctionsExecution or request count in Application InsightsThe function is running as often as expected

In Event Grid, if an event can't be delivered within its retry period and no dead-letter destination is configured, it is gone. An alert on that metric is the minimum, and configuring dead-lettering to a storage account is better.

How do you set up alerts in Azure Monitor?

Azure Monitor gives you two kinds of alert that cover most integrations.

Metric alerts fire when a platform metric crosses a threshold, such as dead-lettered messages above zero or active messages above a level that normally clears within minutes. They are quick to set up and evaluate frequently.

Log search alerts run a query against Log Analytics or Application Insights on a schedule and fire when the result matches a condition. These handle anything more specific: exceptions from one function, failures for one customer's orders, or the count of processed orders in the last hour being zero. For Logic Apps, send workflow runtime logs to a Log Analytics workspace through diagnostic settings. For anything per order or per customer, log it from your own code; platform logs don't record what happened to each business item.

Each alert rule triggers the action groups you attach to it. An action group sends an email or SMS, calls a webhook or starts a Logic App. A few practical points:

  • Route alerts to a team, not one person's inbox, and decide who acts on them out of hours, if anyone.
  • Set severities. A dead-lettered payment is urgent; a slow queue at 3am may wait until morning.
  • Write a short runbook for each alert: what it means, where to look, and how to resubmit or replay.
  • Review alerts that fire and get ignored. An alert nobody acts on trains people to ignore the ones that matter.

How do you trace one item through several services?

When something goes wrong, the first question is usually about a single order or invoice: did it arrive, where did it stop, and why? Answering that needs a correlation ID that travels with the item from the first system to the last, written into every log line and passed on in message properties and HTTP headers.

Application Insights correlates requests and dependencies automatically for code it can instrument, and Logic Apps can track properties on each run. Even so, it pays to log your own business identifiers, such as the order number, so support staff can search for the thing they were asked about rather than a technical ID.

Watch the sampling settings in Functions. Application Insights sampling is switched on by default to control cost and volume, which means some traces and dependency calls aren't recorded. That is often fine, but if you need a complete record of every item, adjust or exclude the relevant telemetry from sampling.

How do you check that an integration has recovered?

A green dashboard after an outage doesn't mean everything is back. Before closing an incident, check:

  1. The main queues have drained back to normal levels.
  2. The dead-letter queues have been reviewed, with each item resubmitted, fixed or deliberately discarded.
  3. Failed Logic App runs have been resubmitted where that is safe to do, bearing in mind that resubmitting repeats actions that had already succeeded, such as posting to the target system.
  4. Source and target agree for the period affected, checked record by record on business identifiers rather than by totals alone, so nothing was lost and nothing was processed twice.
  5. Anything that was paused or switched off during the incident, such as a timer trigger or a subscription, is running again.

Resubmitting is only safe if the receiving side can cope with a repeat. Integrations designed so that processing the same item twice has no extra effect are much easier to recover. Where that isn't the case, check what was already processed before replaying anything.

What are common mistakes when monitoring Azure integrations?

  • Alerts on every failure, including ones that retry and succeed. People soon stop reading them.
  • No alert on silence. Most quiet failures look exactly like a quiet day.
  • Dead-letter queues that are never checked.
  • Logs with no business identifiers, so finding one order means searching by timestamp.
  • Monitoring set up by hand in the portal and lost when the integration is redeployed. Define alerts alongside the integration, in the same templates or pipeline.

For how the messaging services behave when things fail, see our guide to Azure Service Bus or Event Grid, and for where run history and logging differ between workflows and code, Logic Apps or Azure Functions.

We set up monitoring, alerting and recovery procedures for Azure integrations, including ones we didn't build. Read more about our integration support service and our work on Azure integration.

Email [email protected] with your brief.