AI-102 Question 73
Single answerYou are managing an Azure Cognitive Services account for your organization. To enhance security, you need to rotate the account keys periodically. What is the best approach to ensure uninterrupted access to the service while rotating the keys?
- A
Regenerate the primary key and update all applications to use the new primary key immediately.
- B
Regenerate the secondary key, update all applications to use the secondary key, and then regenerate the primary key.
- C
Delete the current keys and generate new keys for the account.
- D
Regenerate the primary key and secondary key simultaneously to ensure both are updated.
Show answer and explanation
Correct answer: B
Explanation
The best practice for rotating account keys is to regenerate the secondary key first, update all applications to use it, and then regenerate the primary key. This ensures there is always a valid key in use, avoiding service interruptions.
- A. Incorrect.
Regenerating the primary key and immediately updating all applications can cause downtime if the key update in the applications is not instantaneous.
- B. Correct.
Regenerating the secondary key first allows you to switch all applications to use it while retaining the primary key for fallback. Once the applications are updated, you can safely regenerate the primary key without causing service interruptions.
- C. Incorrect.
Deleting the current keys and generating new ones will render the service inaccessible to applications until the new keys are configured, leading to downtime.
- D. Incorrect.
Regenerating both keys simultaneously will cause immediate loss of access for all applications, as neither the old nor new keys will be valid during the transition.