Skip to content

Export EdgeX events to Azure Blob Storage

Overview

Azure Blob Storage is Microsoft's object storage solution for the cloud. Edge Xpert provides a proprietary XpertHTTPExport function to send data to Azure Blob Storage through the Put Blob REST API. This article will take you through steps to create an Edge Xpert application service to export data as generated by virtual device service to Azure Blob Storage.

Prerequisites

  1. Understand Edge Xpert Application Services
  2. Launch Edge Xpert services
    edgexpert up sys-mgmt xpert-manager device-virtual 
    
    or use --secret option to run in security mode
    edgexpert up --secret sys-mgmt xpert-manager device-virtual 
    
  3. Create an Azure storage account
  4. Create a Container
  5. Generate a shared access signature

    NOTE: The permissions should at least contain "Create", which allows users to create new resources but not overwrite existing resources. More details about SAS token refer to Azure Storage Documentation.

    Azure blob storage generate SAS

Configure an application service to export events to Azure Blob Storage

Edge Xpert provides a proprietary built-in function XpertHTTPExport to produce events to the Azure Blob Storage endpoint. Refer to Export to HTTP endpoints for more details. In the following steps, you will use Edge Xpert Manager to add an Application service.

  1. Navigate to localhost:9090 in a web browser. The default username/password is admin/admin.
  2. Navigate to App Service page. Select the Add App Service (+) button. Choose Advanced
  3. Enter a unique name used to identify the app service, such as azure-blob
  4. Click the Next button
  5. Drag and drop the Context Variable pipeline function from the Others section
  6. Enter the Variable Name: timestamp and thenValue JSON Path: origin, and then click Save
  7. Drag and drop the HTTP pipeline function from the Connectivity section
  8. Enter the following fields and click Save

    Config Value Description
    Method PUT
    URL https://${storage_account}.blob.core.windows.net/${container_name}/event_{timestamp}.json${SAS_token} Replace the ${storage_account}(e.g. shellopenxpot), ${container_name}(e.g. edgexpertevents) and ${SAS_token}(e.g. sp=rcl&st=2023-05-01T15:59:59Z...) that obtain from the Prerequisites
    HTTP Request Headers Field Name: x-ms-blob-type, Value: BlockBlob Required Azure request header
  9. Click Save

  10. Verify the data from the Azure Portal, or use List Blobs REST API if your SAS token permissions contain "List"

    Azure Blob Storage data

More configuration details about XpertHTTPExport

Refer to XpertHTTPExport configuration.