Created the Azure EH docs (#9462)

* Created the Azure EH docs

* Update release version

Co-Authored-By: Klaas Schoute <klaas_schoute@hotmail.com>

* ✏️ Tweak

After this we can merge it
This commit is contained in:
Eduard van Valkenburg 2019-06-01 10:05:17 +02:00 committed by Paulus Schoutsen
parent 0888428408
commit d3ce0835f6
2 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,103 @@
---
layout: page
title: "Azure Event Hub"
description: "Setup for Azure Event Hub integration"
date: 2019-05-15 08:00
sidebar: true
comments: false
sharing: true
footer: true
logo: azure_event_hub.svg
ha_category:
- History
ha_release: 0.94
---
The `Azure Event Hub` component allows you to hook into the Home Assistant event bus and send events to [Azure Event Hub](https://azure.microsoft.com/en-us/services/event-hubs/) or to a [Azure IoT Hub](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-read-builtin).
## {% linkable_title First time setup %}
This assumes you already have a Azure account. Otherwise create a Free account [here](https://azure.microsoft.com/en-us/free/).
You need to create a Event Hub namespace and a Event Hub in that namespace, you can follow [this guide](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create). Alternatively you can directly deploy an ARM template with the namespace and the Event Hub [from here](https://github.com/Azure/azure-quickstart-templates/tree/master/201-event-hubs-create-event-hub-and-consumer-group/).
You must then create a Shared Access Policy for the Event Hub with 'Send' claims or use the RootManageAccessKey from your namespace (this key has additional claims, including managing the event hub and listening, which are not needed for this purpose), for more details on the security of Event Hubs [go here](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-authentication-and-security-model-overview).
Once you have the name of your namespace, instance, Shared Access Policy and the key for that policy, you can setup the component itself.
## {% linkable_title Configuration %}
Add the following lines to your `configuration.yaml` file:
```yaml
# Example configuration.yaml entry
azure_event_hub:
event_hub_namespace: NAMESPACE_NAME
event_hub_instance_name: EVENT_HUB_INSTANCE_NAME
event_hub_sas_policy: SAS_POLICY_NAME
event_hub_sas_key: SAS_KEY
filter:
include_domains:
- homeassistant
- light
- media_player
```
{% configuration %}
event_hub_namespace:
description: The name of your Event Hub namespace.
required: true
type: string
event_hub_instance_name:
description: The name of your Event Hub instance.
required: true
type: string
event_hub_sas_policy:
description: The name of your Shared Access Policy.
required: true
type: string
event_hub_sas_key:
description: The key for the Shared Access Policy.
required: true
type: string
filter:
description: Filter domains and entities for Event Hub.
required: false
type: map
default: Includes all entities from all domains
keys:
include_domains:
description: List of domains to include (e.g., `light`).
required: false
type: list
exclude_domains:
description: List of domains to exclude (e.g., `light`).
required: false
type: list
include_entities:
description: List of entities to include (e.g., `light.attic`).
required: false
type: list
exclude_entities:
description: List of entities to include (e.g., `light.attic`).
required: false
type: list
{% endconfiguration %}
<p class='note warning'>
Not filtering domains or entities will send every event to Azure Event Hub, thus taking up a lot of space.
</p>
<p class='note warning'>
Event Hubs have a retention time of at most 7 days, if you do not capture or use the events they are deleted automatically from the Event Hub, the default retention is 1 day.
</p>
### {% linkable_title Using the data in Azure %}
There are a number of ways to stream the data that comes into the Event Hub into storages in Azure, the easiest way is to use the built-in Capture function and this allows you to capture the data in Azure Blob Storage or Azure Data Lake store, [details here](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-capture-overview).
Other storages in Azure (and outside) are possible with a [Azure Stream Analytics job](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-define-inputs#stream-data-from-event-hubs), for instance for [Cosmos DB](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-documentdb-output), [Azure SQL DB](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-sql-output-perf), [Azure Table Storage](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-define-outputs#table-storage), custom writing to [Azure Blob Storage](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-custom-path-patterns-blob-storage-output) and [Topic and Queues](https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-quick-create-portal#configure-job-output).
On the analytical side, Event Hub can be directly fed into [Azure Databricks Spark](https://docs.microsoft.com/en-us/azure/azure-databricks/databricks-stream-from-eventhubs?toc=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fevent-hubs%2FTOC.json&bc=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fbread%2Ftoc.json), [Azure Time Series Insights](https://docs.microsoft.com/en-us/azure/time-series-insights/time-series-insights-how-to-add-an-event-source-eventhub) and [Microsoft Power BI](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-tutorial-visualize-anomalies).
The final way to use the data in Azure is to connect a Azure Function to the Event Hub using the [Event Hub trigger binding](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs).

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-163 237 32 32" enable-background="new -163 237 32 32" xml:space="preserve">
<path fill="#B8D432" d="M-144,251.5c0,0.3-0.2,0.5-0.5,0.5h-3.9c-0.3,0-0.5-0.2-0.5-0.5v-2.9c0-0.3,0.2-0.5,0.5-0.5h3.9
c0.3,0,0.5,0.2,0.5,0.5V251.5z"/>
<path fill="#B8D432" d="M-137,254.5c0,0.3-0.2,0.5-0.5,0.5h-3.9c-0.3,0-0.5-0.2-0.5-0.5v-2.9c0-0.3,0.2-0.5,0.5-0.5h3.9
c0.3,0,0.5,0.2,0.5,0.5V254.5z"/>
<path fill="#B8D432" d="M-144,257.5c0,0.3-0.2,0.5-0.5,0.5h-3.9c-0.3,0-0.5-0.2-0.5-0.5v-2.9c0-0.3,0.2-0.5,0.5-0.5h3.9
c0.3,0,0.5,0.2,0.5,0.5V257.5z"/>
<path fill="#B8D432" d="M-151,248.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-3c0-0.3,0.2-0.5,0.5-0.5h3.9
c0.4,0,0.6,0.2,0.6,0.5V248.5z"/>
<path fill="#0072C6" d="M-133.5,238L-133.5,238h-3h-22.1h-1.9h-1c-0.3,0-0.5,0.2-0.5,0.5v6c0,0.3,0.2,0.5,0.5,0.5h3
c0.3,0,0.5-0.2,0.5-0.5V242h21v2.5c0,0.3,0.2,0.5,0.6,0.5h2.9c0.3,0,0.5-0.2,0.5-0.5v-3v-3C-133,238.2-133.2,238-133.5,238z"/>
<path fill="#0072C6" d="M-133.5,261.1h-2.9c-0.3,0-0.5,0.2-0.5,0.5v2.4H-158v-2.5c0-0.3-0.2-0.5-0.6-0.5h-2.9
c-0.3,0-0.5,0.2-0.5,0.6v5.9c0,0.3,0.2,0.5,0.5,0.5h1h2h22.1h2.8h0.1c0.3,0,0.5-0.2,0.5-0.5v-5.9
C-133,261.3-133.2,261.1-133.5,261.1z"/>
<path fill="#B8D432" d="M-151,254.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-3c0-0.3,0.2-0.5,0.5-0.5h3.9
c0.4,0,0.6,0.2,0.6,0.5V254.5z"/>
<path fill="#B8D432" d="M-151,260.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-3c0-0.3,0.2-0.5,0.5-0.5h3.9
c0.4,0,0.6,0.2,0.6,0.5V260.5z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB