Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I update value of my Secret created in Azure Key Vault using .Net SDK

I added a connection string in my KeyVault Secret. I wanted to update the same using .Net SDK but not able to find any method that will allow me to do so.

I tried using UpdateSecretAsync() but this method doesn't accept Secret Value.

Can someone please point me to correct method.

like image 888
NKDev Avatar asked Oct 23 '25 03:10

NKDev


1 Answers

Use the SetSecretAsync method. If the secretName doesn't exists it will create it. If it does exist it will replace it.

// Code to generate a new secret
var newSecret = "<the new secret>"

// Update the secret in the key vault
client.SetSecretAsync(vault, secretName, newSecret);
like image 178
Rick Rainey Avatar answered Oct 24 '25 19:10

Rick Rainey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!