Azure Function Destination

Segment makes it easy to send your data to Azure Function (and lots of other destinations). Once you track your data using our open-source libraries we’ll translate and route your data to Azure Function in the format they understand. Learn more about how to use Azure Function with Segment.

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.

NOTE: Azure Function is currently in beta, and this doc was last updated on May 6, 2019. This means that there may still be some bugs for us to iron out and we’re excited to hear your thoughts. If you are interested in joining or have any feedback to help us improve the Azure Function Destination and its documentation, let us know!

Getting Started

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.

Web Mobile Server
📱 Device-mode
☁️ Cloud-mode

Build an Azure Function to Process Segment Events

In order to process events from Segment, you will need to provide a Azure Function that can handle your event flow:

  • Go to
  • Click on Functions App.

  • Click on +Add to create your Function App.

  • In the App name field, name your app.
  • Configure the other fields with your own flavor.
  • Click on the Create button.

  • Once your function app is created, click on its name (you may have to refresh the list by clicking on the Refresh button.

  • On the left pane, click on the Functions button.

  • In the main frame, click on New function.

  • Click on HTTP trigger.

  • In the Name field, name your function.
  • In Authorization level field, chose Function.
  • Click on the Create button.

  • set up your function code.
  • In the created function screen, click on </> Get function URL.

  • In the Key field, if not already selected, select default (Function key).
  • Click on the Copy button in order to copy the URL. Keep this URL in order to later set up the Azure Function Segment destination.

Configure Azure Function Destination

Once the Azure Function is created, a destination that will call the function must be configured:

  • In our Destinations section, click on Add Destination. You will be redirected to our Catalog.
  • Search and client on Azure Function destination.
  • Click on Configure Azure Function.
  • Fill the settings.


HTTP Trigger The URL copied from </> Get function URL button in the Azure function code screen.


You can send computed traits and audiences generated using Segment Personas to this destination as a user property. To learn more about Personas, contact us for a demo.

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 indicade 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 false.

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.


Segment lets you change these destination settings from the Segment app without having to touch any code.

HTTP Trigger

The URL to call the Function. It must follow the ` https://{function app name}{function name}?code={function key}` pattern.

This page was last modified: 17 Jul 2020

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
Create free account