Event-Based Real-Time handling for Azure

Azure Blob function app setup

  1. Deploy the Azure function app using the Terraform script: https://github.com/OPSWAT/metadefender-k8s/tree/main/terraform/azure-function-docker
  2. Configure STORAGECLIENTID, APIKEY, and APIENDPOINT variables in the .tvars file:
Python
Copy

Request Format (with examples)

The request body differs based on storage type. Below are the specifications for each supported storage:

Amazon S3 and S3 Compatible

Format
Example (file in root)
Example (file in nested directory)
Copy

Response Formats

Success

When a webhook is successfully processed, the system returns:

Success response example
Copy
FieldDescription
correlationIdA unique identifier that references the submitted file in our database. You can use this ID for tracking the file's processing status or for future API calls related to this file.

Error

When an error occurs during processing, the system returns:

Error response example
Copy
FieldDescription
responseKeyMachine-readable error code that identifies the specific error condition.
responseMessageHuman-readable explanation of the error.

Common error responses

Response MessageDescriptionRecommended Action
The storage could not be foundThe specified storage client ID does not exist in the system.Verify the storageClientId is correct and the storage has been properly configured in the system.
Real-Time Process is not enabled.Real-time processing has not been activated for this storage client.Enable real-time processing for the storage client in your account settings.
Real-Time Process is enabled, but it is not set to Event Based.The storage is configured for real-time processing, but is using polling rather than event-based processing.Stop the current RTP scan and start another one using Event-Based

Azure Blob Event Grid RTP configuration

Refer to the example for detailed configuration: https://github.com/OPSWAT/metadefender-k8s/tree/main/terraform/CloudFunctions/Azure/webhook-notification

Event Notifications for Page and Append blob are NOT supported.

Events for these blob types are triggered upon the first block commit, potentially before the upload is complete.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard