question

TaylorPhilipRobert-0859 avatar image
0 Votes"
TaylorPhilipRobert-0859 asked KalyanChanumolu-MSFT answered

Azure Cosmos DB Key Rotate REST API

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered

@TaylorPhilipRobert-0859 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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.