Skip to content

Commit b45e847

Browse files
authored
[azure] Use variable instead of hardcoded value for eventHubName, fix potential deployment issue error, update versions (#988)
* Use variable instead of hardcoded value for eventHubName * Update index.js * Update index.js * update version, update azure sdk, update deploy.zip * revert zip file
1 parent c2ad1a1 commit b45e847

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

azure/activity_logs_monitoring/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
const { app, InvocationContext } = require('@azure/functions');
77

8-
const VERSION = '2.1.0';
8+
const VERSION = '2.1.1';
99

1010
const STRING = 'string'; // example: 'some message'
1111
const STRING_ARRAY = 'string-array'; // example: ['one message', 'two message', ...]
@@ -29,6 +29,8 @@ const DD_SOURCE = process.env.DD_SOURCE || 'azure';
2929
const DD_SOURCE_CATEGORY = process.env.DD_SOURCE_CATEGORY || 'azure';
3030
const DD_PARSE_DEFENDER_LOGS = process.env.DD_PARSE_DEFENDER_LOGS; // Boolean whether to enable special parsing of Defender for Cloud logs. Set to 'false' to disable
3131

32+
const EVENTHUB_NAME = process.env.EVENTHUB_NAME || 'datadog-eventhub'; // The event hub name inside your eventhub namespace
33+
3234
const MAX_RETRIES = 4; // max number of times to retry a single http request
3335
const RETRY_INTERVAL = 250; // amount of time (milliseconds) to wait before retrying request, doubles after every retry
3436

@@ -651,11 +653,12 @@ class EventhubLogHandler {
651653
}
652654
}
653655

654-
app.eventHub('datadog-function', {
656+
// using a function-name with dashes can cause deployment errors on function update
657+
app.eventHub('datadogFunction', {
655658
trigger: {
656659
type: 'eventHubTrigger',
657660
name: 'eventHubMessages',
658-
eventHubName: 'datadog-eventhub',
661+
eventHubName: EVENTHUB_NAME,
659662
connection: 'EVENTHUB_CONNECTION_STRING',
660663
cardinality: 'many',
661664
consumerGroup: '$Default',

azure/activity_logs_monitoring/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "datadog-eventhub-forwarder",
3-
"version": "2.0.0",
3+
"version": "2.1.1",
44
"main": "index.js",
55
"author": "Datadog",
66
"license": "Apache-2.0",
77
"dependencies": {
8-
"@azure/functions": "^4.7.2"
8+
"@azure/functions": "^4.8.0"
99
}
1010
}

0 commit comments

Comments
 (0)