Skip to content

Commit c94e95a

Browse files
authored
Merge pull request #98 from SumoLogic/hpal_evtgridtopic_fix
adding condition system topic
2 parents 198ec1d + 26c72a2 commit c94e95a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2898
-838
lines changed

.github/workflows/arm-template-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ jobs:
5353
- uses: bridgecrewio/checkov-action@master
5454
with:
5555
file: ${{ matrix.dir }}/${{ matrix.file }}
56-
skip_check: CKV_AZURE_16,CKV_AZURE_17,CKV_AZURE_35
56+
skip_check: CKV_AZURE_16,CKV_AZURE_17,CKV_AZURE_35,CKV_AZURE_78
5757
quiet: false
5858
framework: arm
5959
output_format: cli
60-
output_bc_ids: true
60+
output_bc_ids: true

AppendBlobReader/src/appendblobproducer.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,7 @@ function getDateDifferenceInMinutes(date_a, date_b) {
318318
*/
319319
function getTasksForUnlockedFiles(context) {
320320

321-
var maxIngestionDelayPerFile = 5;
322-
let MS_PER_MINUTE = 60*1000;
323-
var dateVal = new Date(new Date() - maxIngestionDelayPerFile*MS_PER_MINUTE);
324-
// fetching unlocked files which were not enqueued in last 5 minutes
325-
var existingFileQuery = `done eq ${false} and blobType eq '${'AppendBlob'}' and offset ge ${0} and ( not (lastEnqueLockTime gt '') or lastEnqueLockTime le '${dateVal.toISOString()}')`
321+
var existingFileQuery = `done eq ${false} and blobType eq '${'AppendBlob'}' and offset ge ${0}`
326322
return new Promise(function (resolve, reject) {
327323
return queryFiles(existingFileQuery, context).then(function (allentities) {
328324
var newFiletasks = [];

AppendBlobReader/src/appendblobreaderdeploy.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@
444444
"properties": {
445445
"name": "[parameters('serverfarms_BlobReaderPlan_name')]",
446446
"maximumElasticWorkerCount": 1,
447-
"perSiteScaling": false,
447+
"perSiteScaling": true,
448448
"targetWorkerCount": 0,
449449
"targetWorkerSizeId": 0,
450450
"reserved": false,
@@ -470,7 +470,7 @@
470470
"properties": {
471471
"name": "[parameters('serverfarms_ConsumerPlan_name')]",
472472
"maximumElasticWorkerCount": 1,
473-
"perSiteScaling": false,
473+
"perSiteScaling": true,
474474
"targetWorkerCount": 0,
475475
"targetWorkerSizeId": 0,
476476
"reserved": false,
@@ -501,6 +501,7 @@
501501
"http20Enabled": true,
502502
"minTlsVersion": "1.2",
503503
"scmMinTlsVersion": "1.2",
504+
"netFrameworkVersion": "v6.0",
504505
"alwaysOn": true,
505506
"cors": {
506507
"allowedOrigins": [ "https://portal.azure.com" ]
@@ -595,6 +596,7 @@
595596
"http20Enabled": true,
596597
"minTlsVersion": "1.2",
597598
"scmMinTlsVersion": "1.2",
599+
"netFrameworkVersion": "v6.0",
598600
"alwaysOn": true,
599601
"cors": {
600602
"allowedOrigins": [ "https://portal.azure.com" ]
@@ -701,6 +703,7 @@
701703
"http20Enabled": true,
702704
"minTlsVersion": "1.2",
703705
"scmMinTlsVersion": "1.2",
706+
"netFrameworkVersion": "v6.0",
704707
"alwaysOn": true,
705708
"cors": {
706709
"allowedOrigins": [ "https://portal.azure.com" ]

AppendBlobReader/src/consumer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function downloadErrorHandler(err, serviceBusTask, context) {
131131
async function archiveIngestedFile(serviceBusTask, context) {
132132
try {
133133
// Delete entity from Azure Table Storage
134+
// blobName should not be used directly since they might be truncated
134135
await azureTableClient.deleteEntity(serviceBusTask.partitionKey, serviceBusTask.rowKey);
135136
context.log(`Entity deleted, rowKey: ${serviceBusTask.rowKey}`);
136137
} catch (error) {

AppendBlobReader/src/producer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function getRowKey(metadata) {
1313
var arr = metadata.url.split('/').slice(3);
1414
var keyArr = [storageName];
1515
Array.prototype.push.apply(keyArr, arr);
16-
return keyArr.join("-");
16+
// key cannot be greater than 1KB or 1024 bytes;
17+
var rowKey = keyArr.join("-");
18+
return rowKey.substr(0,Math.min(1024, rowKey.length)).replace(/^-+|-+$/g, '');
19+
1720
}
1821

1922
function getBlobMetadata(message) {
@@ -301,8 +304,7 @@ module.exports = async function (context, eventHubMessages) {
301304
context.done();
302305
}
303306

304-
}
305-
else {
307+
} else {
306308
context.log(`eventHubMessages might not pertain to appendblob or files with supported extensions, Exit now!`);
307309
context.done();
308310
}

AppendBlobReader/target/appendblob_producer_build/AppendBlobTaskProducer/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,7 @@ function getDateDifferenceInMinutes(date_a, date_b) {
318318
*/
319319
function getTasksForUnlockedFiles(context) {
320320

321-
var maxIngestionDelayPerFile = 5;
322-
let MS_PER_MINUTE = 60*1000;
323-
var dateVal = new Date(new Date() - maxIngestionDelayPerFile*MS_PER_MINUTE);
324-
// fetching unlocked files which were not enqueued in last 5 minutes
325-
var existingFileQuery = `done eq ${false} and blobType eq '${'AppendBlob'}' and offset ge ${0} and ( not (lastEnqueLockTime gt '') or lastEnqueLockTime le '${dateVal.toISOString()}')`
321+
var existingFileQuery = `done eq ${false} and blobType eq '${'AppendBlob'}' and offset ge ${0}`
326322
return new Promise(function (resolve, reject) {
327323
return queryFiles(existingFileQuery, context).then(function (allentities) {
328324
var newFiletasks = [];

AppendBlobReader/target/appendblob_producer_build/host.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"default": "Warning",
2222
"Host.Aggregator": "Trace",
2323
"Host.Results": "Information",
24-
"Function": "Trace"
24+
"Function": "Information"
2525
}
2626
},
2727
"functionTimeout": "00:10:00",

AppendBlobReader/target/appendblob_producer_build/package-lock.json

Lines changed: 242 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AppendBlobReader/target/consumer_build/AppendBlobTaskConsumer/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function downloadErrorHandler(err, serviceBusTask, context) {
131131
async function archiveIngestedFile(serviceBusTask, context) {
132132
try {
133133
// Delete entity from Azure Table Storage
134+
// blobName should not be used directly since they might be truncated
134135
await azureTableClient.deleteEntity(serviceBusTask.partitionKey, serviceBusTask.rowKey);
135136
context.log(`Entity deleted, rowKey: ${serviceBusTask.rowKey}`);
136137
} catch (error) {

AppendBlobReader/target/consumer_build/host.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"default": "Warning",
2929
"Host.Aggregator": "Trace",
3030
"Host.Results": "Information",
31-
"Function": "Trace"
31+
"Function": "Information"
3232
}
3333
}
3434
}

0 commit comments

Comments
 (0)