[Ultimate]{class="badge positive"}
Create an Azure Event Hubs source connection using the Flow Service API
Read this tutorial to learn how to connect Azure Event Hubs (hereinafter referred to as “Event Hubs”) to Experience Platform, using the Flow Service API.
Getting started
This guide requires a working understanding of the following components of Adobe Experience Platform:
- Sources: Experience Platform allows data to be ingested from various sources while providing you with the ability to structure, label, and enhance incoming data using Platform services.
- Sandboxes: Experience Platform provides virtual sandboxes which partition a single Platform instance into separate virtual environments to help develop and evolve digital experience applications.
The following sections provide additional information that you will need to know in order to successfully connect Event Hubs to Platform using the Flow Service API.
Gather required credentials
In order for Flow Service to connect with your Event Hubs account, you must provide values for the following connection properties:
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 | |
---|---|
Credential | Description |
sasKeyName |
The name of the authorization rule, which is also known as the SAS key name. |
sasKey |
The primary key of the Event Hubs namespace. The sasPolicy that the sasKey corresponds to must have manage rights configured in order for the Event Hubs list to be populated. |
namespace |
The namespace of the Event Hub you are accessing. An Event Hub namespace provides a unique scoping container, in which you can create one or more Event Hubs. |
connectionSpec.id |
The connection specification returns a source’s connector properties, including authentication specifications related to creating the base and source connections. The Event Hubs connection specification ID is: bf9f5905-92b7-48bf-bf20-455bc6b60a4e . |
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 | |
---|---|
Credential | Description |
sasKeyName |
The name of the authorization rule, which is also known as the SAS key name. |
sasKey |
The primary key of the Event Hubs namespace. The sasPolicy that the sasKey corresponds to must have manage rights configured in order for the Event Hubs list to be populated. |
namespace |
The namespace of the Event Hub you are accessing. An Event Hub namespace provides a unique scoping container, in which you can create one or more Event Hubs. |
eventHubName |
Fill in your Azure Event Hub name. Read the Microsoft documentation for more information on Event Hub names. |
connectionSpec.id |
The connection specification returns a source’s connector properties, including authentication specifications related to creating the base and source connections. The Event Hubs connection specification ID is: bf9f5905-92b7-48bf-bf20-455bc6b60a4e . |
For more information on shared access signatures (SAS) authentication for Event Hubs, read the Azure guide on using SAS.
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 | |
---|---|
Credential | Description |
tenantId |
The tenant ID that you want to request permission from. Your tenant ID can be formatted as a GUID or as a friendly name. Note: The tenant ID is referred to as the “Directory ID” in the Microsoft Azure interface. |
clientId |
The application ID assigned to your app. You can retrieve this ID from the Microsoft Entra ID portal where you registered your Azure Active Directory. |
clientSecretValue |
The client secret that is used alongside the client ID to authenticate your app. You can retrieve your client secret from the Microsoft Entra ID portal where you registered your Azure Active Directory. |
namespace |
The namespace of the Event Hub you are accessing. An Event Hub namespace provides a unique scoping container, in which you can create one or more Event Hubs. |
For more information on Azure Active Directory, read the Azure guide on using Microsoft Entra ID.
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 | |
---|---|
Credential | Description |
tenantId |
The tenant ID that you want to request permission from. Your tenant ID can be formatted as a GUID or as a friendly name. Note: The tenant ID is referred to as the “Directory ID” in the Microsoft Azure interface. |
clientId |
The application ID assigned to your app. You can retrieve this ID from the Microsoft Entra ID portal where you registered your Azure Active Directory. |
clientSecretValue |
The client secret that is used alongside the client ID to authenticate your app. You can retrieve your client secret from the Microsoft Entra ID portal where you registered your Azure Active Directory. |
namespace |
The namespace of the Event Hub you are accessing. An Event Hub namespace provides a unique scoping container, in which you can create one or more Event Hubs. |
eventHubName |
Fill in your Azure Event Hub name. Read the Microsoft documentation for more information on Event Hub names. |
For more information about these values, refer to this Event Hubs document.
Using Platform APIs
For information on how to successfully make calls to Platform APIs, see the guide on getting started with Platform APIs.
Create a base connection
The first step in creating a source connection is to authenticate your Event Hubs source and generate a base connection ID. A base connection ID allows you to explore and navigate files from within your source and identify specific items that you want to ingest, including information regarding their data types and formats.
To create a base connection ID, make a POST request to the /connections
endpoint while providing your Event Hubs authentication credentials as part of the request parameters.
API format
POST /connections
To create an account using standard authentication, make a POST request to the /connections
endpoint while providing values for your sasKeyName
, sasKey
, and namespace
.
accordion | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request | ||||||||||||||
|
accordion | ||
---|---|---|
Response | ||
A successful response returns details of the newly created base connection, including its unique identifier (
|
To create an account using SAS authentication, make a POST request to the /connections
endpoint while providing values for your sasKeyName
, sasKey
,namespace
, and eventHubName
.
accordion | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request | ||||||||||||||||
|
accordion | ||
---|---|---|
Response | ||
A successful response returns details of the newly created base connection, including its unique identifier (
|
To create an account using Azure Active Directory Auth, make a POST request to the /connections
endpoint while providing values for your tenantId
, clientId
,clientSecretValue
, and namespace
.
accordion | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request | ||||||||||||||||
|
accordion | ||
---|---|---|
Response | ||
A successful response returns details of the newly created base connection, including its unique identifier (
|
To create an account using Azure Active Directory Auth, make a POST request to the /connections
endpoint while providing values for your tenantId
, clientId
,clientSecretValue
, namespace
, and eventHubName
.
accordion | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Request | ||||||||||||||||||
|
accordion | ||
---|---|---|
Response | ||
A successful response returns details of the newly created base connection, including its unique identifier (
|
Create a source connection
A source connection creates and manages the connection to the external source from where data is ingested. A source connection consists of information like data source, data format, and a source connection ID needed to create a dataflow. A source connection instance is specific to a tenant and organization.
To create a source connection, make a POST request to the /sourceConnections
endpoint of the Flow Service API.
API format
POST /sourceConnections
Request
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/sourceConnections' \
-H 'authorization: Bearer {ACCESS_TOKEN}' \
-H 'content-type: application/json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '{
"name": "Azure Event Hubs source connection",
"description": "A source connection for Azure Event Hubs",
"baseConnectionId": "4cdbb15c-fb1e-46ee-8049-0f55b53378fe",
"connectionSpec": {
"id": "bf9f5905-92b7-48bf-bf20-455bc6b60a4e",
"version": "1.0"
},
"data": {
"format": "json"
},
"params": {
"eventHubName": "{EVENT_HUB_NAME}",
"dataType": "raw",
"reset": "latest",
"consumerGroup": "{CONSUMER_GROUP}"
}
}'
name
description
baseConnectionId
connectionSpec.id
bf9f5905-92b7-48bf-bf20-455bc6b60a4e
.data.format
json
.params.eventHubName
params.dataType
raw
and xdm
.params.reset
latest
to start reading from the most recent data, and use earliest
to start reading from the first available data in the stream. This parameter is optional and defaults to earliest
if unprovided.params.consumerGroup
$Default
if unprovided. Refer to this Event Hubs guide on event consumers for more information. Note: An Event Hubs consumer group can only be used for a single flow at a given time.Next steps
By following this tutorial, you have created an Event Hubs source connection using the Flow Service API. You can use this source connection ID in the next tutorial to create a streaming dataflow using the Flow Service API.