You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/rotate-keys.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,17 +13,17 @@ ms.author: pafarley
13
13
14
14
# Rotate subscription keys in Cognitive Services
15
15
16
-
Each Cognitive Services resource has two API keys to enable secret rotation. This is a security precaution that lets you regularly change the keys that can access your service, protecting the privacy of your resource in the event that a key gets leaked.
16
+
Each Cognitive Services resource has two API keys to enable secret rotation. This is a security precaution that lets you regularly change the keys that can access your service, protecting the privacy of your resource if a key gets leaked.
17
17
18
18
## How to rotate keys
19
19
20
20
Keys can be rotated using the following procedure:
21
21
22
-
1. If you're using both keys in production, change your code so that only one key is in use. For the purpose of this guide, assume it's key 1.
23
-
*This is a necessary step because once a key is regenerated, the older version of that key will stop working immediately. This would cause clients using the older key to get 401 access denied errors.
24
-
1. Once you have only key 1 in use, you can regenerate the key 2. Go to your resource's page on the Azure portal, select the **Keys and Endpoint** tab, and select the **Regenrate Key 2** button at the top of the page.
22
+
1. If you're using both keys in production, change your code so that only one key is in use. In this guide, assume it's key 1.
23
+
This is a necessary step because once a key is regenerated, the older version of that key will stop working immediately. This would cause clients using the older key to get 401 access denied errors.
24
+
1. Once you have only key 1 in use, you can regenerate the key 2. Go to your resource's page on the Azure portal, select the **Keys and Endpoint** tab, and select the **Regenerate Key 2** button at the top of the page.
25
25
1. Next, update your code to use the newly generated key 2.
26
-
*It will help to have logs or availability to check that users of the key have successfully swapped from using key 1 to key 2 before you proceed.
26
+
It will help to have logs or availability to check that users of the key have successfully swapped from using key 1 to key 2 before you proceed.
27
27
1. Now you can regenerate the key 1 using the same process.
28
28
1. Finally, update your code to use the new key 1.
0 commit comments