0

From the Azure Portal, on the Configure Tab for a notification hub I am able to generate a primary key and secondary key. I understand these are required to gain programmatic access to the Azure API - allowing my client app to create registrations and send messages.

Could anyone please explain:

Why are there two keys (primary and secondary)? Do the keys generated from this UI expire and if so how long do they live before expiry?

4

1 回答 1

2

它们不会过期。有两个原因是因为出于安全原因,建议您定期重新生成密钥。例如,假设您的应用程序今天正在使用主键。如果您重新生成了主键,那么您的应用程序将被破坏,直到您可以更新它并导致停机。相反,您可以更改您的应用程序以使用辅助键,而停机时间基本上很少或没有。然后,在您的应用程序更新后,您可以重新生成主键。下个月(或任何您喜欢的时间表),您可以重复该过程,切换回主键并重新生成辅助键。

这不是通知中心独有的。您将在存储和媒体服务等其他服务中看到主键和辅助键。这个想法是一样的。

于 2014-06-22T14:26:32.267 回答