# 13.1 Configure your Microsoft Azure EventHub environment

Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them into multiple applications. This lets you process and analyze the massive amounts of data produced by your connected devices and applications.

## 13.1.1 What is Azure Event Hubs?

Azure Event Hubs is a big data streaming platform and event ingestion service. It can receive and process millions of events per second. Data sent to an event hub can be transformed and stored by using any real-time analytics provider or batching/storage adapters.

Event Hubs represents the **front door** for an event pipeline, often called an event ingestor in solution architectures. An event ingestor is a component or service that sits between event publishers (like Adobe Experience Platform RTCDP) and event consumers to decouple the production of an event stream from the consumption of those events. Event Hubs provides a unified streaming platform with time retention buffer, decoupling event producers from event consumers.

## 13.1.2 Create a Event Hubs namespace

Go to <https://portal.azure.com/#home> and select **Create a resource**.

![1-01-open-azure-portal.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-c994ceabee6d0d85424144a36ac9cd990ed054a5%2F1-01-open-azure-portal.png?alt=media)

In the resource screen, enter **Event** in the search bar and select **Event Hubs** from the dropdown:

![1-02-search-event-hubs.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-574fed604957f7f859f7b910403e40b3756f214c%2F1-02-search-event-hubs.png?alt=media)

Click **Create**:

![1-03-event-hub-create.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-6ff06425b6dd46d63a71b58352c40af53824b925%2F1-03-event-hub-create.png?alt=media)

If this is the first time that you create a resource in Azure, you will need to create a new **Resource group**. If you have already a resource group you can select it (or create a new one).

Select **Create new**, name your group `--demoProfileLdap---aep-enablement`.

![1-04-create-resource-group.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f2216c74a5ef8cd8003f315d64bd35c8e3ea0ba9%2F1-04-create-resource-group.png?alt=media)

Complete the test of the fields as indicated:

* Namespace : Define your namespace, it has to be unique, use the following pattern `--demoProfileLdap---aep-enablement`
* Location: **West-Europe** refers to the Azure datacenter in Amsterdam
* Pricing tier: **Basic**
* Throughput Units: **1**

![1-05-create-namespace.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9c5bd8cd67bb9925a2ed7b0289d6c107721df040%2F1-05-create-namespace.png?alt=media)

Click **Review + create**.

![1-06-namespace-review-create.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-67e776a5e61e78e23f0a3baa375ebce10c53977a%2F1-06-namespace-review-create.png?alt=media)

Click **Create**.

![1-07-namespace-create.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-a9223e14145470c52532a2c963a9bc9f081fde35%2F1-07-namespace-create.png?alt=media)

The deployment of your resource group can take 1-2 minutes, when successful you will see the following screen:

![1-08-namespace-deploy.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d128a29833831afeb199e1a7e6598e6a5786a32b%2F1-08-namespace-deploy.png?alt=media)

## 13.1.3 Setup your Event Hub in Azure

Go to <https://portal.azure.com/#home> and select **All resources**.

![1-09-all-resources.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-82761fee3af62ea37e84c53415ef9ad95fb94268%2F1-09-all-resources.png?alt=media)

From the resource list, select your `--demoProfileLdap---aep-enablement` namespace:

![1-10-list-resources.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ef782efc94170a51e9158e46d8e05f4ad3534d5c%2F1-10-list-resources.png?alt=media)

In `--demoProfileLdap---aep-enablement` detail screen, select **Event Hubs**:

![1-11-eventhub-namespace.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-44b1fcb8157d3085bc8ab6bdeeaeff01127b582d%2F1-11-eventhub-namespace.png?alt=media)

Click **+ Event Hub**.

![1-12-add-event-hub.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f38cf570d3d7ade486fff6e8a6dfd38c09dac29a%2F1-12-add-event-hub.png?alt=media)

Use `--demoProfileLdap---aep-enablement-event-hub` as the name and click **Create**.

![1-13-create-event-hub.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-0dba552885deb4b372d55fa267f333b3947ebf16%2F1-13-create-event-hub.png?alt=media)

Click **Event Hubs** in your event hub namespace. You should now see your **Event Hub** listed. If that is the case you can move on to the next exercise.

![1-14-event-hub-list.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-1f11d96814c4e51cd6c431b8ba2bffd4fd6b6083%2F1-14-event-hub-list.png?alt=media)

## 13.1.4 Setup your Azure Storage Account

To debug your Azure Event Hub function in later exercises, you'll need to provide an Azure Storage Account as part of your Visual Studio Code project setup. You'll now create that Azure Storage Account.

Go to <https://portal.azure.com/#home> and select **Create a Resource**.

![1-15-event-hub-storage.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-3b8e20b2cfe3875bc1ab5b5df45115c46d7042ae%2F1-15-event-hub-storage.png?alt=media)

Enter **storage** in the search and select **Storage Account** from the list.

![1-16-event-hub-search-storage.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-f0a3d7b1d92c90aeae98558889fac868d4faf602%2F1-16-event-hub-search-storage.png?alt=media)

Select **Create**.

![1-17-event-hub-create-storage.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fc1207418819e5154397124bbea63ffcb2433846%2F1-17-event-hub-create-storage.png?alt=media)

Specify your **Resource Group** (created in the beginning of this exercise), use `--demoProfileLdap--aepstorage` as your Storage account name, and select **Locally-redundant storage (LRS)**, then click **Review + create**.

![1-18-event-hub-create-review-storage.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8d362257fb6b30d38f6ecf44ef9b5f875cabc3b4%2F1-18-event-hub-create-review-storage.png?alt=media)

Click **Create**.

![1-19-event-hub-submit-storage.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-47f6873024e299e2c390f70b23be90b98e0c7c93%2F1-19-event-hub-submit-storage.png?alt=media)

Your Storage Account creation will take a couple seconds:

![1-20-event-hub-deploy-storage.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-dc85e628798d0b6565f79fa1bdd5d8cd753ac3fe%2F1-20-event-hub-deploy-storage.png?alt=media)

When finished your screen will display the **Go to resource** button.

Click **Microsoft Azure**.

![1-21-event-hub-deploy-ready-storage.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-c8517445c71f4d6552c11815a77cb6a44241737d%2F1-21-event-hub-deploy-ready-storage.png?alt=media)

Your Storage Account is now visible under **Recent Resources**.

![1-22-event-hub-deploy-resources-list.png](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8a7f483143c423292ec8b79d11a019fa7609c483%2F1-22-event-hub-deploy-resources-list.png?alt=media)
