The HTTP request provided is:
POST https://management.azure.com/subscriptions/18c51a87-3a69-47a8-aedc-a54745f708a1/resourceGroups/RG1/providers/Microsoft.CognitiveServices/accounts/contosol/regenerateKey?api-version=2017-04-18
Body { " keyName " : " Key2 " }
Key Observations:
The request is made against the Azure Cognitive Services Management API ( Microsoft.CognitiveServices/accounts/.../regenerateKey ).
The regenerateKey operation is specifically designed to regenerate one of the two subscription keys used to authenticate Cognitive Services API calls.
Cognitive Services resources always have two keys: Key1 (primary) and Key2 (secondary).
This design allows key rotation without downtime: you can regenerate one key while using the other in production.
Body Payload:
{ " keyName " : " Key2 " }
This explicitly tells Azure to regenerate Key2 (the secondary subscription key).
After the call, the secondary subscription key value changes, while Key1 (primary) remains unaffected.
Option Analysis
A. A key for Azure Cognitive Services was generated in Azure Key Vault
Incorrect. The operation is not integrated with Key Vault; it only regenerates Cognitive Services subscription keys.
B. A new query key was generated
Incorrect. Query keys are related to Azure Cognitive Search (not general Cognitive Services).
The request clearly targets CognitiveServices/accounts.
C. The primary subscription key and the secondary subscription key were rotated
Incorrect. The request regenerates only the specified key, not both.
D. The secondary subscription key was reset
Correct. The payload specifies " Key2 " , so only the secondary subscription key is regenerated.
Correct Answer: D. The secondary subscription key was reset
Microsoft References
Azure REST API – Cognitive Services regenerate key
Authenticate requests to Azure AI services with keys and endpoint
Manage Cognitive Services keys (key1/key2)