API - Translator Text / Speech: Why are there two keys for my API subscription?

Only one key is needed at a time. You are getting two keys so that you can expire a key without having any system downtime. For example, you want to replace your primary key. The procedure is:

  1. Configure your service or application to use the secondary key.
  2. Deploy or ship it to your customers.
  3. Regenerate the primary key
  4. (Optional) reconfigure your service to use the new primary key

If there was only one key at a time, your service would be down while you did the key replacement.

Good practice is to replace your keys on a regular basis (every 6 months or whatever is appropriate based on the sensitivity of your data). You should also replace keys when anyone who has access to the keys leaves your business or team. Finally, you should obviously replace them if you believe they have been compromised in some way, or accidentally written to a log or posted to a public GitHub repo.

Both the primary and secondary keys can be regenerated in the Azure portal. Select your subscription, and then the Keys pane. There are two buttons at the top of the keys pane, to renew either one of the keys. Be careful not to renew the key for your currently deployed app or service - there is no way to get your old key back once you renewed it. There is also no option to move the same key from one Azure account to a different one.

Thanks to Mike Goodwin for elegantly answering a similar question on Stack Overflow.


  1. Announcements: Microsoft Translator Moves to the Azure portal
  2. API - Translator Speech: Microsoft Translator Speech API references
  3. API - Translator Text / Speech: Get a report of your consumption
  4. API - Translator Text / Speech: Why are there two keys for my API subscription?
  5. API - Translator Text: My CAT tool isn't working and is asking for the Client ID and Client Secret
  6. API - Translator Text: Limits
  7. API - Translator Text: How Microsoft Translator counts characters
  8. API - Translator Text: Gender selection in the Speak() method
  9. API - Translator Text: Trados plugin for Microsoft Translator
  10. API - Translator Text: Java- Using SSL with the Microsoft Translator API
  11. API - Translator Text: European datacenter
  12. API - Translator Text: Languages detected by the Detect() method
  13. API - Translator Text: First few Microsoft Translator API requests succeed, then the calls fail
  14. API - Translator Text: Microsoft Translator with IP filtered firewalls
  15. API - Translator Text: Profanity filtering in the TranslateArray() method
  16. API - Translator Text: How to report an issue with the API
  17. API and Hub: Confidentiality
  18. Hub: API Preview released
  19. Hub: August 2016 Release notes
  20. Hub: Deployment of a custom system requires a Microsoft Translator Text API subscription in the Azure portal
  21. Hub: Capacity of custom Microsoft Translator Hub systems
  22. Hub: Building a custom system using a dictionary only
  23. Hub: Translator Hub Resource Guide
  24. Hub: Deployment of a custom system requires a Microsoft Translator subscription in the Azure portal

Feedback and Knowledge Base