Why Primary key and Secondary key in Azure IoT hub?

徘徊边缘 提交于 2020-06-25 09:36:28

问题


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 to have Primary/Secondary keys? How should I design the use of both keys?


回答1:


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.



来源:https://stackoverflow.com/questions/34853902/why-primary-key-and-secondary-key-in-azure-iot-hub

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!