Azure Monitor

Overview

This topic explains how to stream Azure Monitor logs and metrics from your Azure subscription to LaunchDarkly’s observability features. This integration allows you to monitor your Azure infrastructure alongside your feature flag data for unified observability.

The integration uses Azure Event Hubs and a serverless Azure Function to forward diagnostic data to LaunchDarkly. An Azure Resource Manager (ARM) template automates the entire setup:

  1. Azure Diagnostic Settings stream logs and metrics from your resources to an Event Hub.
  2. An Azure Function triggers on each batch of events, separates logs from metrics, and forwards both as OTLP JSON to LaunchDarkly’s OpenTelemetry collector.

Prerequisites

To use the Azure Monitor integration, you need:

  • A LaunchDarkly client-side ID for your target environment
  • An Azure subscription with permissions to create:
    • Event Hub namespaces
    • Function Apps
    • Storage accounts

To find and copy your LaunchDarkly client-side ID, read View or copy keys and credentials.

Deploy the ARM template

The ARM template creates all required infrastructure and deploys the forwarding function automatically.

To deploy the ARM template:

  1. Open the Azure Portal.
  2. Search for Deploy a custom template and select it.
  3. Click Build your own template in the editor.
  4. Clear the default contents, then paste the ARM template below into the editor.
  5. Click Save.
  6. Select a Resource group or create a new one.
  7. Enter your LaunchDarkly environment’s client-side ID into the LaunchDarkly Client Side Id parameter.
  8. Click Review + create, then click Create.

The deployment takes 2-3 minutes. After it completes, the Event Hub and forwarding function are ready to receive data. Copy and save the Event Hub namespace name from the deployment outputs to use when you configure Diagnostic Settings.

ARM template

1{
2 "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3 "contentVersion": "1.0.0.0",
4 "parameters": {
5 "launchDarklyClientSideId": {
6 "type": "string",
7 "metadata": {
8 "description": "Your LaunchDarkly environment client-side ID"
9 }
10 },
11 "location": {
12 "type": "string",
13 "defaultValue": "[resourceGroup().location]",
14 "metadata": {
15 "description": "Azure region for all resources"
16 }
17 }
18 },
19 "variables": {
20 "suffix": "[uniqueString(resourceGroup().id)]",
21 "eventHubNamespaceName": "[format('ld-obs-{0}', variables('suffix'))]",
22 "eventHubName": "launchdarkly-diagnostics",
23 "storageAccountName": "[format('ldobs{0}', variables('suffix'))]",
24 "functionAppName": "[format('ld-obs-func-{0}', variables('suffix'))]",
25 "hostingPlanName": "[format('ld-obs-plan-{0}', variables('suffix'))]"
26 },
27 "resources": [
28 {
29 "type": "Microsoft.EventHub/namespaces",
30 "apiVersion": "2022-10-01-preview",
31 "name": "[variables('eventHubNamespaceName')]",
32 "location": "[parameters('location')]",
33 "sku": {
34 "name": "Standard",
35 "tier": "Standard",
36 "capacity": 1
37 }
38 },
39 {
40 "type": "Microsoft.EventHub/namespaces/eventhubs",
41 "apiVersion": "2022-10-01-preview",
42 "name": "[format('{0}/{1}', variables('eventHubNamespaceName'), variables('eventHubName'))]",
43 "dependsOn": ["[resourceId('Microsoft.EventHub/namespaces', variables('eventHubNamespaceName'))]"],
44 "properties": {
45 "messageRetentionInDays": 1,
46 "partitionCount": 2
47 }
48 },
49 {
50 "type": "Microsoft.Storage/storageAccounts",
51 "apiVersion": "2023-01-01",
52 "name": "[variables('storageAccountName')]",
53 "location": "[parameters('location')]",
54 "sku": {
55 "name": "Standard_LRS"
56 },
57 "kind": "StorageV2"
58 },
59 {
60 "type": "Microsoft.Web/serverfarms",
61 "apiVersion": "2023-01-01",
62 "name": "[variables('hostingPlanName')]",
63 "location": "[parameters('location')]",
64 "sku": {
65 "name": "Y1",
66 "tier": "Dynamic"
67 },
68 "properties": {}
69 },
70 {
71 "type": "Microsoft.Web/sites",
72 "apiVersion": "2023-01-01",
73 "name": "[variables('functionAppName')]",
74 "location": "[parameters('location')]",
75 "kind": "functionapp",
76 "dependsOn": [
77 "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
78 "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
79 "[resourceId('Microsoft.EventHub/namespaces', variables('eventHubNamespaceName'))]"
80 ],
81 "properties": {
82 "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
83 "siteConfig": {
84 "appSettings": [
85 {
86 "name": "AzureWebJobsStorage",
87 "value": "[format('DefaultEndpointsProtocol=https;AccountName={0};EndpointSuffix={1};AccountKey={2}', variables('storageAccountName'), environment().suffixes.storage, listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2023-01-01').keys[0].value)]"
88 },
89 {
90 "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
91 "value": "[format('DefaultEndpointsProtocol=https;AccountName={0};EndpointSuffix={1};AccountKey={2}', variables('storageAccountName'), environment().suffixes.storage, listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2023-01-01').keys[0].value)]"
92 },
93 {
94 "name": "WEBSITE_CONTENTSHARE",
95 "value": "[toLower(variables('functionAppName'))]"
96 },
97 {
98 "name": "FUNCTIONS_EXTENSION_VERSION",
99 "value": "~4"
100 },
101 {
102 "name": "FUNCTIONS_WORKER_RUNTIME",
103 "value": "node"
104 },
105 {
106 "name": "WEBSITE_NODE_DEFAULT_VERSION",
107 "value": "~22"
108 },
109 {
110 "name": "EventHubConnection",
111 "value": "[listKeys(resourceId('Microsoft.EventHub/namespaces/authorizationRules', variables('eventHubNamespaceName'), 'RootManageSharedAccessKey'), '2022-10-01-preview').primaryConnectionString]"
112 },
113 {
114 "name": "LAUNCHDARKLY_CLIENT_SIDE_ID",
115 "value": "[parameters('launchDarklyClientSideId')]"
116 },
117 {
118 "name": "LAUNCHDARKLY_SERVICE",
119 "value": "azure"
120 }
121 ]
122 }
123 }
124 },
125 {
126 "type": "Microsoft.Web/sites/functions",
127 "apiVersion": "2023-01-01",
128 "name": "[format('{0}/ForwardToLaunchDarkly', variables('functionAppName'))]",
129 "dependsOn": [
130 "[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
131 ],
132 "properties": {
133 "config": {
134 "bindings": [
135 {
136 "type": "eventHubTrigger",
137 "name": "eventHubMessages",
138 "direction": "in",
139 "eventHubName": "[variables('eventHubName')]",
140 "connection": "EventHubConnection",
141 "cardinality": "many",
142 "consumerGroup": "$Default"
143 }
144 ]
145 },
146 "files": {
147 "index.js": "const https = require('https')\n\nconst PROJECT_ID = process.env.LAUNCHDARKLY_CLIENT_SIDE_ID\nconst SERVICE = process.env.LAUNCHDARKLY_SERVICE || 'azure'\nconst OTEL_HOSTNAME = 'otel.observability.app.launchdarkly.com'\nconst MAX_RETRIES = 6\nconst RETRY_INTERVAL = 1000\n\nconst SEVERITY_MAP = {\n verbose: 'TRACE', debug: 'DEBUG', informational: 'INFO',\n info: 'INFO', warning: 'WARN', warn: 'WARN',\n error: 'ERROR', critical: 'FATAL',\n}\n\nfunction sendWithRetries(context, path, payload) {\n const options = {\n hostname: OTEL_HOSTNAME,\n path,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'x-launchdarkly-project': PROJECT_ID,\n },\n }\n let numRetries = MAX_RETRIES\n let retryInterval = RETRY_INTERVAL\n return new Promise((resolve, reject) => {\n const sendRequest = () => {\n const retryRequest = errMsg => {\n if (numRetries === 0) return reject(errMsg)\n context.log.warn(`Request failed: ${errMsg}. Retrying ${numRetries} more times`)\n numRetries--\n retryInterval *= 2\n setTimeout(sendRequest, retryInterval)\n }\n const req = https\n .request(options, resp => {\n if (resp.statusCode >= 200 && resp.statusCode <= 299) {\n resolve(true)\n } else if (resp.statusCode >= 400 && resp.statusCode <= 499) {\n reject(`HTTP ${resp.statusCode}`)\n } else {\n retryRequest(`HTTP ${resp.statusCode}`)\n }\n })\n .on('error', error => retryRequest(error.message))\n .on('timeout', () => {\n req.destroy()\n retryRequest('request timed out')\n })\n req.write(JSON.stringify(payload))\n req.end()\n }\n sendRequest()\n })\n}\n\nconst toNanos = ts => String(new Date(ts).getTime() * 1000000)\nconst toAttr = (k, v) => ({ key: k, value: { stringValue: String(v) } })\n\nfunction parseRecords(eventHubMessages) {\n const logs = []\n const metrics = []\n for (const message of eventHubMessages) {\n const items = message.records || [message]\n for (const item of items) {\n const timestamp = new Date(item.time || item.timeStamp || Date.now()).toISOString()\n\n if (item.metricName) {\n const dimensions = (item.dimensions || []).reduce((acc, d) => {\n acc[`azure.dimension.${d.name}`] = d.value\n return acc\n }, {})\n metrics.push({\n name: `azure.${item.metricName}`,\n timestamp,\n count: item.count ?? 1,\n sum: item.total ?? item.average ?? 0,\n min: item.minimum,\n max: item.maximum,\n attributes: {\n 'azure.resource.id': item.resourceId,\n 'azure.namespace': item.namespace,\n 'azure.timeGrain': item.timeGrain,\n ...dimensions,\n },\n })\n } else {\n const level = (item.level || item.resultType || 'info').toLowerCase()\n let props = {}\n if (item.properties) {\n try {\n props = typeof item.properties === 'string'\n ? JSON.parse(item.properties) : item.properties\n } catch (_) { /* ignore parse errors */ }\n }\n let message = item.resultDescription || item.operationName\n if (!message && props.CsMethod) {\n message = `${props.CsMethod} ${props.CsUriStem || '/'} ${props.ScStatus || ''} ${props.TimeTaken != null ? props.TimeTaken + 'ms' : ''}`.trim()\n }\n if (!message) message = JSON.stringify(item)\n const attrs = {\n 'azure.resourceId': item.resourceId,\n 'azure.category': item.category,\n 'azure.operationName': item.operationName,\n }\n for (const [k, v] of Object.entries(props)) {\n if (v != null && v !== '') attrs[`azure.properties.${k}`] = String(v)\n }\n logs.push({\n message,\n timestamp,\n severityText: SEVERITY_MAP[level] || 'INFO',\n attributes: attrs,\n })\n }\n }\n }\n return { logs, metrics }\n}\n\nfunction buildOtlpLogs(logs) {\n return {\n resourceLogs: [{\n resource: {\n attributes: [\n toAttr('service.name', SERVICE),\n toAttr('highlight.project_id', PROJECT_ID),\n ],\n },\n scopeLogs: [{\n scope: { name: 'azure-monitor-forwarder', version: '1.0.0' },\n logRecords: logs.map(l => ({\n timeUnixNano: toNanos(l.timestamp),\n body: { stringValue: l.message },\n severityText: l.severityText,\n attributes: Object.entries(l.attributes)\n .filter(([, v]) => v != null)\n .map(([k, v]) => toAttr(k, v)),\n })),\n }],\n }],\n }\n}\n\nfunction buildOtlpMetrics(metrics) {\n return {\n resourceMetrics: [{\n resource: {\n attributes: [\n toAttr('service.name', SERVICE),\n toAttr('highlight.project_id', PROJECT_ID),\n ],\n },\n scopeMetrics: [{\n scope: { name: 'azure-monitor-forwarder', version: '1.0.0' },\n metrics: metrics.map(m => {\n const dp = {\n timeUnixNano: toNanos(m.timestamp),\n count: m.count,\n sum: m.sum,\n explicitBounds: [],\n bucketCounts: [m.count],\n attributes: Object.entries(m.attributes)\n .filter(([, v]) => v != null)\n .map(([k, v]) => toAttr(k, v)),\n }\n if (m.min != null) dp.min = m.min\n if (m.max != null) dp.max = m.max\n return {\n name: m.name,\n histogram: {\n aggregationTemporality: 1,\n dataPoints: [dp],\n },\n }\n }),\n }],\n }],\n }\n}\n\nmodule.exports = async function (context, eventHubMessages) {\n if (!PROJECT_ID) {\n context.log.error('LAUNCHDARKLY_CLIENT_SIDE_ID is not configured.')\n return\n }\n\n const { logs, metrics } = parseRecords(eventHubMessages)\n const promises = []\n\n if (logs.length > 0) {\n promises.push(\n sendWithRetries(context, '/v1/logs', buildOtlpLogs(logs))\n .catch(e => context.log.error(e))\n )\n }\n\n if (metrics.length > 0) {\n promises.push(\n sendWithRetries(context, '/v1/metrics', buildOtlpMetrics(metrics))\n .catch(e => context.log.error(e))\n )\n }\n\n const results = await Promise.all(promises)\n if (!results.every(v => v === true)) {\n context.log.error('Failed to send some records')\n }\n}"
148 }
149 }
150 }
151 ],
152 "outputs": {
153 "functionAppName": {
154 "type": "string",
155 "value": "[variables('functionAppName')]"
156 },
157 "eventHubNamespaceName": {
158 "type": "string",
159 "value": "[variables('eventHubNamespaceName')]"
160 },
161 "eventHubName": {
162 "type": "string",
163 "value": "[variables('eventHubName')]"
164 }
165 }
166}

The template includes an inline Azure Function that forwards data to LaunchDarkly. To view a readable version of the function source code, read Function code reference below.

Configure Azure Diagnostic Settings

After deploying the integration, configure your Azure resources to stream diagnostic data to the Event Hub.

To configure Diagnostic Settings:

  1. Open the Azure Portal.
  2. Navigate to the Azure resource you want to monitor, such as an App Service, Virtual Machine, or SQL Database.
  3. Click Diagnostic settings under Monitoring in the left menu.
  4. Click Add diagnostic setting.
  5. Enter a name, such as launchdarkly-observability.
  6. Under Logs, select the log categories you want to forward.
  7. Under Metrics, check AllMetrics.
  8. Under Destination details, check Stream to an event hub.
  9. Select the Event Hub namespace created by the ARM template.
  10. Select launchdarkly-diagnostics as the Event Hub name.
  11. Select RootManageSharedAccessKey as the Event Hub policy name.
  12. Click Save.

Repeat these steps for each Azure resource you want to monitor.

Configuring diagnostics at scale

For large environments, use Azure Policy to automatically deploy diagnostic settings to resources as they are created. To learn more, read Create diagnostic settings at scale using Azure Policy in the Microsoft documentation.

What the template creates

The ARM template creates the following Azure resources:

  • Event Hub Namespace and Event Hub: Receives diagnostic data streamed from your Azure resources
  • Function App with forwarding function (Node.js 22): Serverless function that triggers on Event Hub messages, separates logs from metrics, and forwards both as OTLP JSON to LaunchDarkly’s OpenTelemetry collector, deployed automatically by the template
  • App Service Plan (Consumption): Serverless hosting for the Function App with pay-per-execution pricing
  • Storage Account: Required for Function App state and trigger checkpointing

All resource names are auto-generated using a unique suffix derived from your resource group ID.

Customizing the compute resources

The template uses a Consumption (serverless) plan for pay-per-execution pricing, which is sufficient for most workloads. You can modify the template to use a different hosting plan based on your requirements. To learn more, read Azure Functions hosting options in the Microsoft documentation.

View data in LaunchDarkly observability dashboards

After deployment, data appears in the LaunchDarkly observability dashboard within 1-2 minutes of configuring Diagnostic Settings.

To view your data:

  1. Navigate to Observability in LaunchDarkly.
  2. Select the environment you configured.
  3. Navigate to the Logs tab to view Azure diagnostic logs such as HTTP request logs, console output, and audit events.
  4. Navigate to the Metrics tab to view Azure platform metrics such as CPU percentage, memory usage, and request counts.
  5. Use the search and filter controls to query your Azure data.

Log records include attributes such as azure.resourceId, azure.category, and azure.operationName for filtering. Metric records use names following the pattern azure.<metricName>, for example azure.CpuPercentage or azure.Http2xx, and are sent as OTLP histograms with sum, count, min, and max values. Metrics include attributes such as azure.resource.id, azure.namespace, and dimension attributes such as azure.dimension.ActivityName.

All records include a service.name attribute set to azure by default. To distinguish data from multiple Azure subscriptions or environments, change the LAUNCHDARKLY_SERVICE application setting in the Function App to a unique value such as azure-production or azure-staging.

Control data volume (optional)

By default, only those Azure resources that use Diagnostic Settings send data to LaunchDarkly. To control data volume, enable Diagnostic Settings only on the resources you want to monitor.

You can also filter within Diagnostic Settings by selecting specific log categories instead of all categories. For example, you might select only AppServiceHTTPLogs and AppServiceConsoleLogs for an App Service, omitting audit and platform logs.

Function code reference

The ARM template deploys a Node.js Azure Function that parses Azure Monitor diagnostic records, separates them into logs and metrics, and forwards both as OTLP JSON to LaunchDarkly’s OpenTelemetry collector at /v1/logs and /v1/metrics. Expand this section to view the function source code.

ForwardToLaunchDarkly/index.js
1const https = require('https')
2
3const PROJECT_ID = process.env.LAUNCHDARKLY_CLIENT_SIDE_ID
4const SERVICE = process.env.LAUNCHDARKLY_SERVICE || 'azure'
5const OTEL_HOSTNAME = 'otel.observability.app.launchdarkly.com'
6const MAX_RETRIES = 6
7const RETRY_INTERVAL = 1000
8
9const SEVERITY_MAP = {
10 verbose: 'TRACE', debug: 'DEBUG', informational: 'INFO',
11 info: 'INFO', warning: 'WARN', warn: 'WARN',
12 error: 'ERROR', critical: 'FATAL',
13}
14
15function sendWithRetries(context, path, payload) {
16 const options = {
17 hostname: OTEL_HOSTNAME,
18 path,
19 method: 'POST',
20 headers: {
21 'Content-Type': 'application/json',
22 'x-launchdarkly-project': PROJECT_ID,
23 },
24 }
25 let numRetries = MAX_RETRIES
26 let retryInterval = RETRY_INTERVAL
27 return new Promise((resolve, reject) => {
28 const sendRequest = () => {
29 const retryRequest = errMsg => {
30 if (numRetries === 0) return reject(errMsg)
31 context.log.warn(`Request failed: ${errMsg}. Retrying ${numRetries} more times`)
32 numRetries--
33 retryInterval *= 2
34 setTimeout(sendRequest, retryInterval)
35 }
36 const req = https
37 .request(options, resp => {
38 if (resp.statusCode >= 200 && resp.statusCode <= 299) {
39 resolve(true)
40 } else if (resp.statusCode >= 400 && resp.statusCode <= 499) {
41 reject(`HTTP ${resp.statusCode}`)
42 } else {
43 retryRequest(`HTTP ${resp.statusCode}`)
44 }
45 })
46 .on('error', error => retryRequest(error.message))
47 .on('timeout', () => {
48 req.destroy()
49 retryRequest('request timed out')
50 })
51 req.write(JSON.stringify(payload))
52 req.end()
53 }
54 sendRequest()
55 })
56}
57
58const toNanos = ts => String(new Date(ts).getTime() * 1000000)
59const toAttr = (k, v) => ({ key: k, value: { stringValue: String(v) } })
60
61function parseRecords(eventHubMessages) {
62 const logs = []
63 const metrics = []
64 for (const message of eventHubMessages) {
65 const items = message.records || [message]
66 for (const item of items) {
67 const timestamp = new Date(item.time || item.timeStamp || Date.now()).toISOString()
68
69 if (item.metricName) {
70 const dimensions = (item.dimensions || []).reduce((acc, d) => {
71 acc[`azure.dimension.${d.name}`] = d.value
72 return acc
73 }, {})
74 metrics.push({
75 name: `azure.${item.metricName}`,
76 timestamp,
77 count: item.count ?? 1,
78 sum: item.total ?? item.average ?? 0,
79 min: item.minimum,
80 max: item.maximum,
81 attributes: {
82 'azure.resource.id': item.resourceId,
83 'azure.namespace': item.namespace,
84 'azure.timeGrain': item.timeGrain,
85 ...dimensions,
86 },
87 })
88 } else {
89 const level = (item.level || item.resultType || 'info').toLowerCase()
90 let props = {}
91 if (item.properties) {
92 try {
93 props = typeof item.properties === 'string'
94 ? JSON.parse(item.properties) : item.properties
95 } catch (_) { /* ignore parse errors */ }
96 }
97 let message = item.resultDescription || item.operationName
98 if (!message && props.CsMethod) {
99 message = `${props.CsMethod} ${props.CsUriStem || '/'} ${props.ScStatus || ''} ${props.TimeTaken != null ? props.TimeTaken + 'ms' : ''}`.trim()
100 }
101 if (!message) message = JSON.stringify(item)
102 const attrs = {
103 'azure.resourceId': item.resourceId,
104 'azure.category': item.category,
105 'azure.operationName': item.operationName,
106 }
107 for (const [k, v] of Object.entries(props)) {
108 if (v != null && v !== '') attrs[`azure.properties.${k}`] = String(v)
109 }
110 logs.push({
111 message,
112 timestamp,
113 severityText: SEVERITY_MAP[level] || 'INFO',
114 attributes: attrs,
115 })
116 }
117 }
118 }
119 return { logs, metrics }
120}
121
122function buildOtlpLogs(logs) {
123 return {
124 resourceLogs: [{
125 resource: {
126 attributes: [
127 toAttr('service.name', SERVICE),
128 toAttr('highlight.project_id', PROJECT_ID),
129 ],
130 },
131 scopeLogs: [{
132 scope: { name: 'azure-monitor-forwarder', version: '1.0.0' },
133 logRecords: logs.map(l => ({
134 timeUnixNano: toNanos(l.timestamp),
135 body: { stringValue: l.message },
136 severityText: l.severityText,
137 attributes: Object.entries(l.attributes)
138 .filter(([, v]) => v != null)
139 .map(([k, v]) => toAttr(k, v)),
140 })),
141 }],
142 }],
143 }
144}
145
146function buildOtlpMetrics(metrics) {
147 return {
148 resourceMetrics: [{
149 resource: {
150 attributes: [
151 toAttr('service.name', SERVICE),
152 toAttr('highlight.project_id', PROJECT_ID),
153 ],
154 },
155 scopeMetrics: [{
156 scope: { name: 'azure-monitor-forwarder', version: '1.0.0' },
157 metrics: metrics.map(m => {
158 const dp = {
159 timeUnixNano: toNanos(m.timestamp),
160 count: m.count,
161 sum: m.sum,
162 explicitBounds: [],
163 bucketCounts: [m.count],
164 attributes: Object.entries(m.attributes)
165 .filter(([, v]) => v != null)
166 .map(([k, v]) => toAttr(k, v)),
167 }
168 if (m.min != null) dp.min = m.min
169 if (m.max != null) dp.max = m.max
170 return {
171 name: m.name,
172 histogram: {
173 aggregationTemporality: 1,
174 dataPoints: [dp],
175 },
176 }
177 }),
178 }],
179 }],
180 }
181}
182
183module.exports = async function (context, eventHubMessages) {
184 if (!PROJECT_ID) {
185 context.log.error('LAUNCHDARKLY_CLIENT_SIDE_ID is not configured.')
186 return
187 }
188
189 const { logs, metrics } = parseRecords(eventHubMessages)
190 const promises = []
191
192 if (logs.length > 0) {
193 promises.push(
194 sendWithRetries(context, '/v1/logs', buildOtlpLogs(logs))
195 .catch(e => context.log.error(e))
196 )
197 }
198
199 if (metrics.length > 0) {
200 promises.push(
201 sendWithRetries(context, '/v1/metrics', buildOtlpMetrics(metrics))
202 .catch(e => context.log.error(e))
203 )
204 }
205
206 const results = await Promise.all(promises)
207 if (!results.every(v => v === true)) {
208 context.log.error('Failed to send some records')
209 }
210}

Troubleshooting

If data does not appear in LaunchDarkly after configuring Diagnostic Settings:

  1. Verify the Event Hub is receiving data. Open the Event Hub namespace in the Azure Portal and check the Messages chart under Overview. If no messages appear, check your Diagnostic Settings configuration.

  2. Verify the Function App is running. Open the Function App in the Azure Portal and navigate to Functions > ForwardToLaunchDarkly > Monitor for invocation logs. If invocations fail, check the error messages.

  3. Verify the client-side ID. Confirm that the LAUNCHDARKLY_CLIENT_SIDE_ID application setting in the Function App matches your LaunchDarkly environment’s client-side ID.

  4. Check Function App logs. Open the Function App in the Azure Portal and navigate to Log stream under Monitoring to view real-time logs from the function.