Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Primary key and Secondary key in Azure IoT hub?

When creating a shared access policy or registering a device in Azure IoT hub, there will be a Primary key and Secondary key pair generated. And I noticed I can connect a device to IoT hub using either Primary key or Secondary key.

So, what's the purpose of having Primary/Secondary keys? How should I design the use of both keys?

like image 230
Shuping Avatar asked Jan 18 '16 11:01

Shuping


People also ask

What are the three components of an azure IoT hub message?

A message enrichment has three key elements, the key name for the enrichment, the value of the enrichment key, and the endpoints that the enrichment applies to. Message enrichments are added to the IoT Hub message as application properties.

Which of the following methods provides device authentication in Azure?

Downstream devices can authenticate with IoT Hub using one of three methods: symmetric keys (sometimes referred to as shared access keys), X. 509 self-signed certificates, or X. 509 certificate authority (CA) signed certificates.


1 Answers

The goal of primary and secondary key is two-fold. First of all it would allow you to keep using your service when you want to replace your key. Say you connect all your services using the primary and you want to refresh it. You could use the secondary temporarily in your services and then change your primary without having downtime. After you do the change you can configure your services to use the new Primary key.

The second possibility would be that you give partners your secondary key and you use your primary if one of your partners would abuse the key you could replace it without having downtime in your own services.

like image 65
RoteS Avatar answered Sep 22 '22 06:09

RoteS