Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sumo 236067: Append Blob Function v1.0.0 #80

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
a5720bf
added support for append blob
himanshu219 Dec 9, 2020
6729682
created armv2 and build folder
himanshu219 Dec 10, 2020
014b4ab
added default sourcename/storageaccount switch case/auto cleanup/arch…
himanshu219 Dec 16, 2020
0105535
changing branch name back to master
himanshu219 Dec 16, 2020
f2bddf3
added content variables
himanshu219 Dec 16, 2020
bccc836
added custom fields support
himanshu219 Dec 17, 2020
8211965
reduced maxdelivery count and improved the blob parsing
himanshu219 Dec 18, 2020
3969a54
build generated
himanshu219 Dec 18, 2020
b37b731
added lock mechanism to avoid duplicate tasks
himanshu219 Jan 7, 2021
b4af0bf
dlq successhandler changed
himanshu219 Jan 7, 2021
5ef30c1
appendblob producer refactored
himanshu219 Jan 8, 2021
d2bdcdd
build generated for azuremonitorToeventHub functions with support for…
himanshu219 Jan 8, 2021
e466027
adding logs for parser exception
himanshu219 Jan 11, 2021
4a260c6
added condition to remove lock for success case
himanshu219 Jan 11, 2021
4739884
making lastEnqueLocktime backward compatible
himanshu219 Jan 11, 2021
09d957b
DLQ fixes
himanshu219 Jan 11, 2021
deaba2d
changed insertOrmerge entity to only merge entity
himanshu219 Jan 11, 2021
8ba0f9d
added msi refresh token
himanshu219 Jan 12, 2021
22d3e77
fixed the error with date filtering
himanshu219 Jan 12, 2021
661b267
added streaming api support for appendblobs
himanshu219 Jan 20, 2021
e21b5ac
added condition to ignore DLQ for appendblob
himanshu219 Jan 22, 2021
59dc6d5
removed unnecessary logs, fixed locking bug
himanshu219 Mar 8, 2021
c4e87c7
added support for multiple sumo endpoints
himanshu219 Mar 8, 2021
da365c0
added splitting handler
himanshu219 Mar 22, 2021
a70ded8
added comments/removed logging/fixedOffset in no log sent scenario
himanshu219 Mar 23, 2021
abbf9c8
separated appendblob function
himanshu219 May 20, 2021
2cc316e
premium plan added
himanshu219 Jul 8, 2021
ff4d36e
reduced prefetch count
himanshu219 Jul 8, 2021
413c1e5
build synced
himanshu219 Jul 8, 2021
5669521
Arm Toolkit Standards
priyansh-sumo Feb 13, 2024
19ea7fb
checkov security standards
priyansh-sumo Feb 13, 2024
6950f52
AzureWebJobsStorage & WebsiteContAzureFileConStr
priyansh-sumo Feb 14, 2024
fd5876a
WEBSITE_NODE_DEFAULT_VERSION "6.11.0" to "20.11.1"
priyansh-sumo Feb 15, 2024
fef9170
update version to ~18
priyansh-sumo Feb 15, 2024
6d24f35
removed node modules
himanshu219 Feb 15, 2024
ad66447
node modules removed from blockblobreader
himanshu219 Feb 15, 2024
0b1b1ec
Merge pull request #79 from SumoLogic/SUMO-236063-fix-arm-template-wi…
himanshu219 Feb 15, 2024
d3ce7cb
update host and required node
priyansh-sumo Feb 19, 2024
809f380
setup and update logs
priyansh-sumo Feb 19, 2024
051ed6f
Node require update
priyansh-sumo Feb 20, 2024
eed80cc
getBlockBlobService
priyansh-sumo Feb 20, 2024
a818df9
messageHandler, setSourceCategory, getSumoEndpoint
priyansh-sumo Feb 20, 2024
e66b120
removed releaseMessagefromDLQ
priyansh-sumo Feb 20, 2024
e36d22d
remove getSumoEndpoint
priyansh-sumo Feb 20, 2024
c0c92f0
added comments
priyansh-sumo Feb 20, 2024
72c6e2d
lib removed
priyansh-sumo Feb 20, 2024
749f0d5
getData
priyansh-sumo Feb 20, 2024
f61d6f1
@azure/data-tables
priyansh-sumo Feb 20, 2024
398d747
tokenCredential, TableServiceClient
priyansh-sumo Feb 20, 2024
7fab4a1
Modefied ARM temp
priyansh-sumo Feb 20, 2024
fb57fae
remove extra char
priyansh-sumo Feb 20, 2024
68ca7a7
Host version
priyansh-sumo Feb 20, 2024
0086b30
logAnalyticsWorkspaceName
priyansh-sumo Feb 20, 2024
76bc601
testing - try with revert host
priyansh-sumo Feb 21, 2024
b5302d3
package.json update and ARM modification
priyansh-sumo Feb 21, 2024
4fadfc5
added extensionBundle
priyansh-sumo Feb 21, 2024
b427d86
Modification in consumer function
priyansh-sumo Feb 22, 2024
6a94887
@azure/storage-blob
priyansh-sumo Feb 22, 2024
92d4acc
Fetch data lib modifications and ARM temp
priyansh-sumo Feb 25, 2024
3db5c61
Cunsumer js changes
priyansh-sumo Feb 25, 2024
582c628
getHeaderRecursively
priyansh-sumo Feb 25, 2024
3869c65
StorageAccountConnectionString check
priyansh-sumo Feb 25, 2024
5ae61ec
ContainerClient implemented check
priyansh-sumo Feb 25, 2024
d19991c
revert to blobServiceClient
priyansh-sumo Feb 25, 2024
737ba10
AzureBlobStorage
priyansh-sumo Feb 25, 2024
6f25a03
remove servicebushandler timetriggerhandler method
priyansh-sumo Feb 26, 2024
ce492d8
revert getSumoEndpoint
priyansh-sumo Feb 26, 2024
9da0458
consumer update
priyansh-sumo Feb 27, 2024
da38e3e
getUpdatedEntity
priyansh-sumo Feb 27, 2024
8cabdb2
error log
priyansh-sumo Feb 27, 2024
e208d8f
tested with data, chunks to sumo
priyansh-sumo Feb 27, 2024
ae52131
update const
priyansh-sumo Feb 27, 2024
27ee7fc
producer azure function
priyansh-sumo Feb 27, 2024
31c57b9
WEBSITE_NODE_DEFAULT_VERSION ~18
priyansh-sumo Feb 27, 2024
f737ac4
Revert "WEBSITE_NODE_DEFAULT_VERSION ~18"
priyansh-sumo Feb 28, 2024
af1ceb1
Revert "producer azure function"
priyansh-sumo Feb 28, 2024
91c0f54
setup logs
priyansh-sumo Feb 28, 2024
e701d88
producer function
priyansh-sumo Feb 28, 2024
3cdb03d
sumoutils js
priyansh-sumo Feb 28, 2024
713e770
sumoutils moved
priyansh-sumo Feb 28, 2024
a5df6bd
Producer JS with local testing
priyansh-sumo Feb 29, 2024
08cc9e9
Append procedure
priyansh-sumo Feb 29, 2024
f8bbbb2
AppendBlobProcessor ARM, Host
priyansh-sumo Mar 1, 2024
277fa07
Library Upgrade @azure/data-tables
priyansh-sumo Mar 1, 2024
8d481af
resolve update issue
priyansh-sumo Mar 4, 2024
c2ddd07
Log updates
priyansh-sumo Mar 4, 2024
9c5b696
Merge pull request #83 from SumoLogic/SUMO-237139
priyansh-sumo Mar 4, 2024
7f70876
ARM temp: update sourceCodeBranch
priyansh-sumo Mar 5, 2024
2b06b7b
ARM Update
priyansh-sumo Mar 5, 2024
7b96a75
minor fix
priyansh-sumo Mar 5, 2024
dc27cd0
Modification in ARM and functions
priyansh-sumo Mar 6, 2024
2b9e14f
Function update
priyansh-sumo Mar 6, 2024
214a996
Update all 3 functions
priyansh-sumo Mar 6, 2024
684b44c
ARM template and error Code modifications
priyansh-sumo Mar 7, 2024
09cd7cd
Create Resource group, tables, Sumo collector
priyansh-sumo Mar 8, 2024
d6873ec
upload file chunks using append blobs
priyansh-sumo Mar 11, 2024
819c8e2
Modefied Consumer Fucntion
priyansh-sumo Mar 12, 2024
1965ca0
test_03_insert_chunks and function log update
priyansh-sumo Mar 13, 2024
ae451ec
Merge pull request #85 from SumoLogic/SUMO-236064-unit-test
priyansh-sumo Mar 13, 2024
d81ea5c
SUMO-236064: Update Consumer Logs
priyansh-sumo Mar 14, 2024
0cbc923
SUMO-236064: Update Consumer Index file
priyansh-sumo Mar 14, 2024
218016b
SUMO-236064: 'Update offset result' log update
priyansh-sumo Mar 15, 2024
e9016e2
SUMO-236064: Unit test modification
priyansh-sumo Mar 15, 2024
02210df
SUMO-236064: check blobType 'AppendBlob'
priyansh-sumo Mar 15, 2024
46b4737
SUMO-236064: added context.done()
priyansh-sumo Mar 18, 2024
2cfd899
SUMO-236064: Unit test and base test file update
priyansh-sumo Mar 18, 2024
e69b451
SUMO-236064: Modefy logs, skipping api calls
priyansh-sumo Mar 19, 2024
f26a7b8
SUMO-236064: Rearrange logs
priyansh-sumo Mar 19, 2024
054f4dd
SUMO-236064: Function name changed
priyansh-sumo Mar 20, 2024
36967d9
SUMO-236064: rename BR to AB
priyansh-sumo Mar 20, 2024
04ca54c
disabled destroy in case of testfail/added logline
himanshu219 Mar 20, 2024
f763cb9
added else condition
himanshu219 Mar 20, 2024
e19f6ce
SUMO-236064: test_storage_res_group name update
priyansh-sumo Mar 20, 2024
b1fd05b
added delay
himanshu219 Mar 20, 2024
b7af404
fixed wasSuccessful check
himanshu219 Mar 21, 2024
fb27c66
SUMO-236064: setSourceCategory Update
priyansh-sumo Mar 21, 2024
123b26b
SUMO-236064: Modefied source_category & filter
priyansh-sumo Mar 21, 2024
a6b6220
fixed result not showing error
himanshu219 Mar 21, 2024
db8832f
renamed template
himanshu219 Mar 21, 2024
9f68e00
Merge pull request #87 from SumoLogic/SUMO-236064-rename_function_name
himanshu219 Mar 21, 2024
994a057
SUMO-236067: Package update for function
priyansh-sumo Mar 22, 2024
3c6a423
SUMO-236062: Microsoft.Web/sites version update
priyansh-sumo Mar 27, 2024
b1a3446
Merge pull request #89 from SumoLogic/SUMO-236062-update-github-actio…
himanshu219 Mar 27, 2024
308d63a
resolved conflicts
himanshu219 Mar 28, 2024
fd883a2
resolved conflicts
himanshu219 Mar 28, 2024
dc990c9
Merge branch 'master' into SUMO-236067-update-azure-function-code-for…
himanshu219 Mar 28, 2024
12faecd
removed zip json
himanshu219 Mar 28, 2024
b393567
fix block blob test
himanshu219 Mar 28, 2024
04e06bf
SUMO-23061: Append ReadMe
priyansh-sumo Mar 28, 2024
b46f6dc
SUMO-236062: Github Action
priyansh-sumo Mar 28, 2024
0ac06cb
Merge pull request #91 from SumoLogic/SUMO-236062-update-github-action
himanshu219 Mar 28, 2024
f86179f
SUMO-236061: added access_id, access_key
priyansh-sumo Mar 28, 2024
3917558
added context and http agent
himanshu219 Mar 28, 2024
3c70259
Merge branch 'master' into SUMO-236067-update-azure-function-code-for…
himanshu219 Mar 28, 2024
4d69340
revert capacity to 1
himanshu219 Mar 28, 2024
42e72e3
SUMO-236061: Modified ReadMe
priyansh-sumo Mar 29, 2024
f1850a0
Update README.md
himanshu219 Mar 29, 2024
8f51626
Merge pull request #90 from SumoLogic/SUMO-236061-ReadMe
himanshu219 Mar 29, 2024
c3597e3
SUMO-238754: Arm template used custom topic
priyansh-sumo Apr 2, 2024
10f7f7b
SUMO-238754: added condition for new and existing
priyansh-sumo Apr 5, 2024
ce85323
SUMO-238754: deployingAgainForSameStorageAccount
priyansh-sumo Apr 8, 2024
f6e7791
Merge pull request #99 from SumoLogic/SUMO-238754
npande Apr 9, 2024
6effc89
SUMO-236067: deployingAgain4SameStorageAccount No
priyansh-sumo Apr 10, 2024
581854b
SUMO-23920: int64 check
priyansh-sumo Apr 13, 2024
1a776b5
SUMO-239204: offset Int64
priyansh-sumo Apr 13, 2024
60a2c3b
SUMO-239204: filterAppendBlob
priyansh-sumo Apr 13, 2024
e7405be
SUMO-239204: update all function for offset int64
priyansh-sumo Apr 13, 2024
96703b6
SUMO-239204: update index files
priyansh-sumo Apr 13, 2024
7f342be
SUMO-239204: filterByFileExtension
priyansh-sumo Apr 13, 2024
478c2ca
SUMO-239204: update filterByFileExtension
priyansh-sumo Apr 15, 2024
8bde965
SUMO-239204: add warning
priyansh-sumo Apr 15, 2024
a13a02b
SUMO-239204: update index
priyansh-sumo Apr 15, 2024
cae7f65
SUMO-239204: JSON.stringify to length
priyansh-sumo Apr 16, 2024
df6402f
Merge pull request #100 from SumoLogic/SUMO-239204
priyansh-sumo Apr 16, 2024
4255040
SUMO-239656: Minor changes as jira
priyansh-sumo Apr 22, 2024
5d1e560
SUMO-239656: checkAndTruncate blob name
priyansh-sumo Apr 22, 2024
89311cb
Merge pull request #101 from SumoLogic/SUMO-239656-minor-internal-fix…
himanshu219 Apr 24, 2024
0ef2fca
SUMO-239656: releaseLockfromOffsetTable
priyansh-sumo Apr 24, 2024
af809b6
SUMO-239656: releaseLockfromOffsetTable err update
priyansh-sumo Apr 24, 2024
1df047c
Merge pull request #102 from SumoLogic/SUMO-239656
himanshu219 Apr 24, 2024
a246ef5
SUMO-239656: JSON Parse Unittest
priyansh-sumo Apr 26, 2024
59b3f8d
SUMO-239656: Unit test for JSON and logs
priyansh-sumo Apr 28, 2024
5d1f47c
CON-239656: json, logs & offset unit test
priyansh-sumo Apr 30, 2024
7d225f8
SUMO-239656: Update version for storageAccounts
priyansh-sumo May 1, 2024
60cb147
SUMO-239656: blockblob ARM: storageAccounts update
priyansh-sumo May 1, 2024
0eebe9e
SUMO-239656: blobreaderdeploywithPremiumPlan ARM
priyansh-sumo May 1, 2024
e4c5f3a
SUMO-239656: Update 2 more unit test for JSON
priyansh-sumo May 1, 2024
c1a7d49
SUMO-239656: minor modification
priyansh-sumo May 1, 2024
88247ee
SUMO-239656: Update Unit test
priyansh-sumo May 1, 2024
88c1408
increased per storage account limit,added condition to not fetch file…
himanshu219 May 2, 2024
c3ea0c5
Merge branch 'SUMO-236067-update-azure-function-code-for-append-blob'…
priyansh-sumo May 2, 2024
35c021d
SUMO-239656: suffix trim, apiPerfile
priyansh-sumo May 3, 2024
4e97437
SUMO-239656: Update index files
priyansh-sumo May 3, 2024
9ba6261
SUMO-239656: Custom js and functions
priyansh-sumo May 5, 2024
79e528f
SUMO-239656: traget files
priyansh-sumo May 5, 2024
cf81bf5
SUMO-239656: test files
priyansh-sumo May 5, 2024
2c767fb
SUMO-239656: Azure Append Blob consumer.js
priyansh-sumo May 6, 2024
1294948
SUMO-239656: moved unit test and remove regex
priyansh-sumo May 6, 2024
60d6d5e
SUMO-239656: existingFileQuery update
priyansh-sumo May 6, 2024
31503d4
SUMO-239656 moved test to test folder
priyansh-sumo May 6, 2024
ad2a6b4
Merge pull request #103 from SumoLogic/SUMO-239656
himanshu219 May 6, 2024
91f12b2
SUMO-236067: Update fetch batchSize
priyansh-sumo May 9, 2024
589870a
SUMO-236067: Update regex stringToWorkWith
priyansh-sumo May 9, 2024
93ff181
SUMO-236067: Update target files
priyansh-sumo May 10, 2024
63f98c2
SUMO-236067: Update decodeDataChunks with log parse
priyansh-sumo May 10, 2024
85421e2
SUMO-236067: updated stringToWorkWith
priyansh-sumo May 10, 2024
4a963bd
SUMO-241025: Modefied ARM to update memory
priyansh-sumo May 15, 2024
8d2e45e
SUMO-241025: Update ARM temp with MemoryPercentage
priyansh-sumo May 17, 2024
1f01fa8
Revert "SUMO-241025: Update ARM temp with MemoryPercentage"
priyansh-sumo May 17, 2024
39b2937
Merge pull request #105 from SumoLogic/SUMO-241025-Memory-Update
himanshu219 May 17, 2024
3cf2bbf
removing contendownloaded/updating loglevel, updating maxconcurrentca…
himanshu219 May 20, 2024
b6adc39
SUMO-241025: update index
priyansh-sumo May 20, 2024
c7630f5
SUMO-241025: update reset dataLenSent on error
priyansh-sumo May 21, 2024
8f120bd
Merge pull request #106 from SumoLogic/hpal_appendblob_fixes
himanshu219 May 21, 2024
71ee22b
fixed bug with asc order
himanshu219 May 24, 2024
561643e
build index files
himanshu219 May 27, 2024
4387c51
SUMO-241560: Consumer function restructure
priyansh-sumo May 27, 2024
043f4d5
SUMO-241650: identity.type = SystemAssigned
priyansh-sumo May 28, 2024
4a3c61b
SUMO-241650: identity.type = SystemAssigned
priyansh-sumo May 28, 2024
52a0713
SUMO-241650: identity.type = SystemAssigned
priyansh-sumo May 28, 2024
94bb411
SUMO-241560: error.statusCode update for entity
priyansh-sumo May 28, 2024
237287e
SUMO-241560: Remove error log
priyansh-sumo May 28, 2024
c7e49dc
SUMO-241560: downloadErrorHandler
priyansh-sumo May 28, 2024
ea3964f
SUMO-241560: context update
priyansh-sumo May 28, 2024
b49c3aa
SUMO-241560: Inside blob task consumer log
priyansh-sumo May 28, 2024
20a93da
SUMO-241560: downloadBlockBlobResponse
priyansh-sumo May 28, 2024
77b72f2
SUMO-241560: sumoclient error update
priyansh-sumo May 28, 2024
5fc734d
SUMO-241560: remove extra logs
priyansh-sumo May 28, 2024
cc3bcb6
SUMO-241560: remove error log
priyansh-sumo May 28, 2024
fca64ca
Merge pull request #108 from SumoLogic/SUMO-241560
himanshu219 May 28, 2024
31de868
added queueing delay in maxLockThreshold
himanshu219 May 28, 2024
f02d324
removed servicebus output binding && added table creation
himanshu219 May 29, 2024
247ff77
updated index files
himanshu219 May 29, 2024
062beda
fixing typename case
himanshu219 May 29, 2024
9e622fe
added github action for syntax validation
himanshu219 May 29, 2024
f93b231
fixed syntax error
himanshu219 May 29, 2024
efb8909
fixed parameter name
himanshu219 May 29, 2024
27c8fd0
fixing max error
himanshu219 May 29, 2024
c28c4f9
improved logging
himanshu219 May 29, 2024
4b428cc
updated test
himanshu219 May 29, 2024
765d4ee
Merge pull request #109 from SumoLogic/hpal_offsettable_fix
himanshu219 May 29, 2024
6d9a6f4
fixed bug in unit test
himanshu219 May 29, 2024
1c06279
fixed unit test
himanshu219 May 29, 2024
d2ce94c
fixed bug in query
himanshu219 May 31, 2024
09dacaf
Delete AppendBlobReader/requirements.txt
himanshu219 Jun 6, 2024
c67d5ea
Update requirements.txt
himanshu219 Jun 6, 2024
b82986f
removed unused functions and hardcoded logregex
himanshu219 Jun 11, 2024
5141030
fixed CVE error and archive timeout
himanshu219 Jun 11, 2024
3e75f6a
fixed delete entity api
himanshu219 Jun 11, 2024
0e175d4
fixed checkov error
himanshu219 Jun 11, 2024
578da30
updated the description text
himanshu219 Jun 11, 2024
613c12b
updated branch name
himanshu219 Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/arm-template-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
dir: 'BlockBlobReader/src'
- file: 'blobreaderdeploywithPremiumPlan.json'
dir: 'BlockBlobReader/src'
- file: 'appendblobreaderdeploy.json'
dir: 'AppendBlobReader/src'
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -42,6 +44,8 @@ jobs:
dir: 'BlockBlobReader/src'
- file: 'blobreaderdeploywithPremiumPlan.json'
dir: 'BlockBlobReader/src'
- file: 'appendblobreaderdeploy.json'
dir: 'AppendBlobReader/src'
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/package-version-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
- dir: 'BlockBlobReader/target/consumer_build'
- dir: 'BlockBlobReader/target/dlqprocessor_build'
- dir: 'BlockBlobReader/target/producer_build'
- dir: 'AppendBlobReader/target/producer_build'
- dir: 'AppendBlobReader/target/appendblob_producer_build'
- dir: 'AppendBlobReader/target/consumer_build'
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/syntax-validation-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Syntax validation tests"
on: [workflow_dispatch, pull_request]

jobs:
package-version-test:
runs-on: ubuntu-latest
strategy:
matrix:
include: # Includes one more job
- dir: 'BlockBlobReader/target/consumer_build'
- dir: 'BlockBlobReader/target/dlqprocessor_build'
- dir: 'BlockBlobReader/target/producer_build'
- dir: 'AppendBlobReader/target/producer_build'
- dir: 'AppendBlobReader/target/appendblob_producer_build'
- dir: 'AppendBlobReader/target/consumer_build'
- dir: 'AppendBlobReader/target/consumer_build'
- dir: 'AppendBlobReader/target/consumer_build'
- dir: 'EventHubs/target/metrics_build'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- working-directory: ${{ matrix.dir }}
run: |
find ./ -name *.js | xargs node -c
52 changes: 52 additions & 0 deletions AppendBlobReader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Sumo Logic Azure Blob Storage Integration for AppendBlobs
This contains the function to read append blob files from an Azure Storage Account and ingest to SumoLogic.

## About the Configuration Process
Sumo provides an Azure Resource Management (ARM) template to build most of the components in the pipeline. The template creates:

* An event hub to which Azure Event Grid routes create append blobs events.
* A Service Bus for storing tasks.
* Three Azure functions — `AppendBlobFileTracker`, `AppendBlobTaskProducer`, and `AppendBlobTaskConsumer` that are responsible for sending monitoring data to Sumo.
* A storage account to which the Azure functions write their log messages about successful and failed transmissions.

For more details checkout the [documentation](https://help.sumologic.com/Send-Data/Collect-from-Other-Data-Sources/Azure_Blob_Storage/Collect_Logs_from_Azure_AppendBlob_Storage)

![Append Blob Storage Data Collection Pipeline](https://s3.amazonaws.com/appdev-cloudformation-templates/AppendBlobReader.png)

## For Developers

### Code structure

Currently ARM template is integrated with github and for each functions build folder is present in `AppendBlobReader/target` directory

* AppendBlobReader/target/producer_build/AppendBlobFileTracker - Function for Creating file metadata in file `FileOffsetMap` table in storage account.
* AppendBlobReader/target/consumer_build/AppendBlobTaskConsumer - Function for Downloading Append blobs and ingesting to SumoLogic
* AppendBlobReader/target/appendblob_producer_build/AppendBlobTaskProducer - Function for periodically polling `FileOffsetMap` table and creating tasks in Service Bus to be consumed by consumer function

### Updating target directory

Make all the code changes in `AppendBlobReader/src` directory, once all the changes are completed, run below command to update target directory.

`npm run build`

This command copies required files in `AppendBlobReader/target` directory

### Run Unit Test

Integrations tests are in `AppendBlobReader/tests` folder and unit tests are in sumo-`function-utils/tests` folder

```console

export AZURE_SUBSCRIPTION_ID=`<Your azure subscription id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-azure-subscription>`
export AZURE_CLIENT_ID=`Your application id which you can get after registering application. Refer https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application`
export AZURE_CLIENT_SECRET=`Generate client secret by referring docs https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-credentials`
export AZURE_TENANT_ID=`You tenant id, to obtain it refer docs https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant`
export AZURE_DEFAULT_REGION=`eastus`
export SUMO_ACCESS_ID=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
export SUMO_ACCESS_KEY=`<Generate access id and access key https://help.sumologic.com/docs/manage/security/access-keys/#create-your-access-key>`
export SUMO_DEPLOYMENT=`Enter one of the allowed values au, ca, de, eu, fed, in, jp, us1 or us2. Visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security`
```

Execute below command under `AppendBlobReader/tests` directory

`python test_appendblobreader.py`
Loading
Loading