How to auto rotate an API subscription key in Azure

Raja 1 Reputation point
2022-08-11T06:31:31.357+00:00

As part of security measures, I need to rotate the API subscription key very frequently and regularly in an automated way. Is there a way to achieve it in Azure APIM?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,454 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Takahito Iwasa 4,851 Reputation points MVP Volunteer Moderator
    2022-08-11T08:46:54.727+00:00

    Hi, @Raja

    You can use Azure Automation and a PowerShell script to regenerate API subscription keys periodically to achieve rotation.

    You may find the following articles helpful.

    https://tutorialslink.com/Articles/What-is-Azure-API-Management-How-to-do-Subscription-Key-rotation/3346

    Alternatively, if you can use the REST API or SDK, you can use the regeneration API as follows.

    https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/subscription/regenerate-primary-key?tabs=HTTP

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.