> For the complete documentation index, see [llms.txt](https://docs.kpnthings.com/kpn-things/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpnthings.com/kpn-things/building-blocks/destinations/azure-iot-hub.md).

# Azure IoT Hub

Below instructions help you connecting your Azure IoT Hub to KPN Things.

Don't have an Azure IoT Hub yet? Head on over to the Microsoft documentation on Azure IoT Hub. You can try one for free using the [Azure free account](https://azure.microsoft.com/en-us/free/)!

{% embed url="<https://docs.microsoft.com/azure/iot-hub/iot-hub-create-through-portal>" %}

For now, a **Basic tier** will be sufficient for a working connection with KPN Things. Later, we will introduce downlink and device twin functionality to the connection and for that the Standard tier is required.

## Connect an Azure IoT Hub

The following parameters are available to connect your Azure IoT Hub:

<table data-header-hidden><thead><tr><th width="223">Parameter</th><th></th><th>Description</th><th>Example value</th></tr></thead><tbody><tr><td>Parameter</td><td></td><td>Description</td><td>Example value</td></tr><tr><td><code>name</code></td><td>*</td><td>The name of the destination</td><td><em>My IoT Hub</em></td></tr><tr><td><code>description</code></td><td></td><td>Description of the destination</td><td><em>IoT Hub with all my devices</em></td></tr><tr><td><code>destinationFormat</code></td><td>*</td><td>The data format used for outgoing payloads</td><td><em>SenML</em></td></tr><tr><td><code>hostName</code></td><td>*</td><td>Host name of your IoT Hub</td><td><em>hubName.azure-devices.net</em></td></tr><tr><td><em><code>sasKeyName</code></em></td><td>*</td><td>The access policy name for KPN Things to use to connect to your IoT Hub</td><td></td></tr><tr><td><code>sasKey</code></td><td>*†</td><td>The primary key of the access policy for KPN Things to use</td><td></td></tr></tbody></table>

*\*) required value*\
\&#xNAN;*†) secret value, not returned by our API's*

## Where to find the required configuration values in the Azure Portal?

### Hostname

You can find the hostname on the overview page of your IoT Hub, as highlighted in the screenshot below:

<figure><img src="/files/5drvRMikIAqi6AVXGQbm" alt=""><figcaption></figcaption></figure>

### SAS key name and SAS key

For the key name and key you need to create a [**Shared access policy**](https://docs.microsoft.com/nl-nl/azure/iot-hub/iot-hub-create-through-portal#shared-access-policies) for your IoT Hub. Make sure you enable all permissions for the Policy you create for KPN Things, since all permissions are required:

* Registry write
* Service connect
* Device connect

After creation of your policy, you can find the SAS key name and SAS key in the&#x20;

<figure><img src="/files/XVHaAt0bX9VSjTr2yj2S" alt=""><figcaption></figcaption></figure>

## What does the connection do?

* KPN Things will **register new devices** in the IoT hub when IoT data is forwarded for devices that are not yet in the IoT Hub.
* KPN Things will **forward all IoT data** as telemetry in the IoT Hub from devices linked to the destination.

*In the future we plan to support downlink communication using Cloud-to-Device communication in the IoT Hub, and we plan to support device twin synchronization between KPN Things and the IoT Hub.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kpnthings.com/kpn-things/building-blocks/destinations/azure-iot-hub.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
