question

Tushar-8132 avatar image
0 Votes"
Tushar-8132 asked ·

automate key rotation for azure resources

i want to create a funcntion that can automate the rotation of keys when they are about to expire in keyvault.

basically i want that when a key is about to expire in keyvault it generates an event which in turn regenerate the key for the specific resource and rotatate the secret in the keyvault hence making it automatic.

i need the code in c# for all azure resources.

azure-functionsazure-automationazure-key-vault
· 4
10 |1000 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.

@Tushar-8132
Thank you for your post!

When it comes to automating key rotation for azure resources, have you looked at our rotation tutorial? It looks like this has a similar concept with what you're asking (besides being in C#), but the last step updates a SQL server or storage account. However, if you don't need to update the secret within a SQL server or Storage Account, you should be able to skip the last step.

71220-image.png
https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/key-vault/secrets/tutorial-rotation-dual.md

I hope this helps! If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.

0 Votes 0 ·
image.png (94.6 KiB)
Tushar-8132 avatar image Tushar-8132 JamesTran-MSFT ·

hi..

i have reviewed this earlier but i have a problem of retrieving the keys from storage account to save it into the key vault..


how to get keys from storage account in an azure function?

0 Votes 0 ·
Tushar-8132 avatar image Tushar-8132 JamesTran-MSFT ·

also i need the code in c# not the powershell script..

0 Votes 0 ·

@Tushar-8132
Thank you for the quick response!

When it comes to getting keys from your Storage account, you should be able to follow this documentation - Automate the rotation of a secret for resources that have two sets of authentication credentials, specifically the Add storage accounts for rotation section.


I've also reached out to our engineering team to see if we have any C# code for automating key rotations and will update as soon as possible.


If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.

0 Votes 0 ·

0 Answers