# Azure Event Hubs

Send Airship user-level event data into Azure using our Event Hubs integration.

By integrating with Microsoft Azure Event Hubs, you can store events from your airship project in Microsoft Azure. With Azure, you can store events for long term analysis and pass data to real-time analytics providers, making it easy to take advantage of your Airship engagement data in external business intelligence platforms.

As a part of this integration, you must create an Event Hub to receive and store events from Airship. An Event Hub exists within a namespace belonging to a resource group. This setup assumes that you've already set up a resource group and a namespace to contain your Airship Real-Time Data Streaming Event Hub. If you have not already done so, [create your resource group and namespace before you begin](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create).

## Azure Integration Requirements

This integration requires these accounts:
1. Azure
1. Airship — Must include both:
   * Messaging
   * [Real-Time Data Streaming](https://www.airship.com/docs/reference/feature-packages/#data)

## Creating an Airship Event Hub

1. Go to the Azure Portal and select **Event Hubs**. If **Event Hubs** is not in your Favorites menu, select **All Services** and locate it from there.
1. Select the namespace in which to create your Airship Event Hub.
1. Select **Event Hubs** in your namespace page.
1. Select ** Event Hub**.
1. Type a name for your Event Hub, then select **Create**. You can check the status of the Event Hub creation in alerts. When complete, your new Event Hub appears in the list.

## Getting Keys from your Shared Access Policy

A shared-access policy contains the keys you'll provide to Airship to authenticate with your Event Hub.

![An Azure shared access policy](https://www.airship.com/docs/images/azure-keys.png)

*An Azure shared access policy*

1. Go to the Azure Portal and select **Event Hubs**. If **Event Hubs** is not in your Favorites menu, select **All Services** and locate it from there.

1. In the list of Event Hubs, select the namespace containing your Airship Event Hub.

1. Select **Shared Access Policies**.

1. Select a policy from the list. The default policy is `RootManageSharedAccessPolicy`. If you add a new policy, it must have at least the `send` (write) permission.

1. Copy the policy name and primary key. These are the Shared Access Signature (SAS) Policy Name and Shared Access Signature (SAS) Primary Key Name that you will provide to Airship to authenticate with your Azure Event Hub.

   You can also copy the Connection string-primary key, which contains both the Shared Access Signature Primary Key and Policy Name.

## Configuring the Integration in Airship

Before you configure your Azure integration, you must have configured a namespace and a specific Event Hub to store events from Airship. To configure your Microsoft Azure Event Hubs integration in Airship, you will need:

* Event Hub namespace name
* Event Hub name
* Shared access signature (SAS) policy name — This is the *Policy Name* of a shared access policy in the namespace containing your Event Hub.
* Shared access signature (SAS) primary key — This is the *Connection string-primary key* from a shared access policy in the namespace containing your Event Hub.

In Airship:

1. Next to your project name, select the dropdown menu (
), then **Settings**.
1. Under **Project settings**, select **Partner Integrations**.
1. Select **Microsoft Azure**.
1. Select **Configure** for the outbound integration and follow the onscreen instructions to:
   * Enter your Event Hub information.
   * Select the Airship events to send to your Event Hub.
