Azure Cosmos DB Key Rotate REST API

Taylor, Philip Robert 41 Reputation points
2021-03-25T15:42:32.457+00:00

Is there a way to do this via a rest api?
I want to implement via logic app or python function app

$resourceGroupName = "myResourceGroup" # Resource Group must already exist
$accountName = "mycosmosaccount" # Must be all lower case
$keyKind = "primary" # Other key kinds: secondary, primaryReadOnly, secondaryReadOnly

New-AzCosmosDBAccountKey -ResourceGroupName $resourceGroupName
-Name $accountName `
-KeyKind $keyKind

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,922 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,351 Reputation points
    2021-03-26T04:20:28.963+00:00

    @Taylor, Philip Robert Welcome to Microsoft Q&A Forums.
    You can implement this using REST API's and a Function App.

    Please check the below tutorials for detailed instructions

    Automate the rotation of a secret for resources that use one set of authentication credentials
    Automate the rotation of a secret for resources that have two sets of authentication credentials

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.

    0 comments No comments

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.