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
- Understand Edge Xpert Application Services
- Launch Edge Xpert services
or use
edgexpert up sys-mgmt xpert-manager device-virtual
--secret
option to run in security modeedgexpert up --secret sys-mgmt xpert-manager device-virtual
- Create an Azure storage account
- Create a Container
-
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.
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.
- Navigate to
localhost:9090
in a web browser. The default username/password is admin/admin. - Navigate to App Service page. Select the Add App Service (+) button. Choose
Advanced
- Enter a unique name used to identify the app service, such as
azure-blob
- Click the
Next
button - Drag and drop the
Context Variable
pipeline function from theOthers
section - Enter the Variable Name:
timestamp
and thenValue JSON Path:origin
, and then clickSave
- Drag and drop the
HTTP
pipeline function from theConnectivity
section -
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 PrerequisitesHTTP Request Headers Field Name: x-ms-blob-type, Value: BlockBlob Required Azure request header -
Click
Save
-
Verify the data from the Azure Portal, or use List Blobs REST API if your SAS token permissions contain "List"
More configuration details about XpertHTTPExport
Refer to XpertHTTPExport configuration.