Build a sample app in Optimizely Connect Platform (OCP) that lets customers synchronize data from an Azure storage account to Optimizely Data Platform (ODP).
You will learn how to:
- register and scaffold an app
- add objects and fields to ODP schema
- build a setting form that allows authentication in a third-party service (in this case, an Azure storage account)
- build a function that listens to events from an Azure storage account and imports new data to ODP
- build a job that periodically imports data from an Azure storage account to ODP
- test and troubleshoot your app in a sandbox environment
- publish your app to the ODP App Directory
The full source code of this sample app is available in the ocp-quickstart GitHub repository.
Any customers using this app should have a third-party system that can send data to an Azure storage account. For simplicity, this quickstart guide assumes that the data format is fixed and defined by the app.
Typically, the app needs to handle the data format defined by a third-party service.
Ecommerce clients have successfully integrated their online stores with ODP. However, some also have offline stores that they want to integrate. These clients push their offline store data and order information to an Azure storage account.
This quickstart guide shows how to write an OCP app that pulls this data from Azure and writes it to ODP.
Orders are pushed individually as JSON files that contain the following details for order, customer, and offline store:
items- an array of order items, where each item contains:
Offline stores are kept in a single JSONL file that is updated throughout the day:
- Configure the OCP CLI.
- An Azure account. If you want a free trial account, see Azure's page on creating a free account.
- A sandbox ODP account to test your app. Use the same request forms listed in the Request an OCP developer account section.
- Configure resources in Azure.
- Get information from your Azure account so you can test your app.
Configure the following resources in Azure:
- An Azure resource group and storage account. Standard performance and local redundancy are sufficient, and other default settings are okay.
- Two containers in your Azure storage account; one for offline store data and one for offline orders data. Select the
private containeroption for both.
- Register the Event Grid resource provider for your subscription.
- An app registration in Azure (Azure app) to access Azure resources programatically. Default settings are okay.
- A client secret for the app registration.
Store the secret securely when you create it because you cannot view it again.
- The service principal associated with your app registration must have the following permissions:
The easiest way is to assign the
EventGrid EventSubscription Contributorand
Storage Blob Data Readerroles to your service principal at the resource scope. Alternatively, you can assign roles at another scope (such as a storage account or subscription) or create and assign a custom role.
After you configure everything in Azure, you need the following information from your Azure account to test your app:
- Azure client ID –
Application (client) IDfield of your Azure app registration.
- Azure tenant ID – Find your Azure AD tenant or
Directory (tenant) IDof your Azure app registration.
- Azure client secret – The secret you created for your Azure app registration.
- Azure Subscription Id – Find your Azure subscription.
- Azure resource group
- Azure storage account name
- Azure storage container name
Your next step is to initialize the app and define its schema.
Updated 1 day ago