Azure Function Destination
- Accepts Page, Alias, Group, Identify, and Track calls
- Refer to it as Azure Function in the Integrations object
- This destination is in Beta
Segment makes it easy to send your data to Azure Function (and lots of other destinations). When you track your data using Segment’s open-source libraries, Segment can translate and route your data to an Azure Function in the format it expects.
Azure Function is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure. Use Azure Functions to run a script or piece of code in response to a variety of events.
This document is about a destination which is in beta
This means that the Azure Function Destination is in active development, and some functionality may change before it becomes generally available.
Before you start, make sure Azure Function supports the source type and connection mode you’ve chosen to implement. You can learn more about connection modes here.
Build an Azure Function to Process Segment Events
To process events from Segment, first create a Azure Function that can handle your event flow.
Create a Functions App
Go to https://portal.azure.com, and click Functions App.
Click +Add to create your Function App.
- Enter a name for your app in the App name field, and configure any other fields as needed own flavor.
- Click Create. Azure creates your new function app.
Create a new Azure function
Click the new function app’s name. (You might need to click the Refresh button if the new function doesn’t appear.)
On the left pane, click Functions.
In the main frame, click New function.
Choose HTTP trigger.
- Enter a name for your function, and choose
Functionfor the Authorization level field.
- Set up your function code.
In the created function screen, click on
</> Get function URL.
- In the Key field, choose
default (Function key).
- Click Copy to the right of the URL. You’ll use this URL to tell Segment where to connect to use this Azure Function.
Configure Azure Function Destination
After you create the Azure Function, configure a Segment destination that calls the function.
- In the Segment web app, click Destinations.
- Click Add Destination to go to the Catalog.
- Search for and choose the Azure Function destination.
- Click Configure Azure Function.
- In the HTTP Trigger field, enter the URL you copied from the
</> Get function URLbutton in the Azure function code screen.
For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Personas sends an Identify call with the property
order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Personas sets that value to
When you first create an audience, Personas sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.
Real-time to batch destination sync frequency
Note that real-time audience syncs to Azure Function may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.
Segment lets you change these destination settings from the Segment app without having to touch any code.
This page was last modified: 08 Mar 2022
Questions? Problems? Need more info? Contact Segment Support for assistance!