Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 1.97 KB

howto-secure-rotate-access-key.md

File metadata and controls

45 lines (27 loc) · 1.97 KB
title description author ms.author ms.service ms.topic ms.date
Rotate access keys
Learn how and when to rotate Azure Web PubSub access keys by regenerating one key at a time.
yjin81
yajin1
azure-web-pubsub
how-to
08/16/2024

Rotate access keys

Each Azure Web PubSub instance has a pair of access keys that helps you authenticate clients when requests are made to the service. Both keys are associated with the instance endpoint URL.

Each instance has a primary access key and a secondary access key. Rotate one access key at a time by regenerating a new key of that type, either primary or secondary. Update one access key while the other access key maintains existing authenticated connections.

When to rotate access keys

For security and compliance requirements, we recommend that you routinely rotate your access keys.

To regenerate an access key, complete the steps that are described in the following sections.

Enforced access key rotation

In some scenarios, Azure Web PubSub might enforce a mandatory access key rotation. The service sends notifications via email and in the portal. If you receive this kind of notification or if you encounter service failure due to an access key issue, regenerate your access keys to rotate the keys.

Regenerate an access key

  1. In the Azure portal, sign in with your subscription credentials.

  2. Go to the Web PubSub instance that has keys you want to rotate.

  3. On the left menu, select Keys.

  4. Select Regenerate Primary Key or Regenerate Secondary Key. A new key and a corresponding connection string are created. You manage them in your Web PubSub instance.

When the Azure Web PubSub service becomes generally available, you can also regenerate a key by using the Azure CLI.

Update configurations with the new connection string

  1. Copy the new connection string.

  2. Update all existing configurations to use the new connection string.

  3. Close the application, and then reopen it.