how to get the latest secret version value from azure key vault in one rest api call

我的梦境 提交于 2020-01-02 03:44:09

问题


I can get the secret from azure key vault in rest api if I already know the version number using this endpoint:

https://my-key-vault-dev.vault.azure.net/secrets/MyTestSecret/13f8347b8518483f8236670197497c93?api-version=2016-10-01

But what if I don't know what the latest version number is?

I guess I could get the latest version number query list first:

GET {vaultBaseUrl}/secrets/{secret-name}/versions?api-version=2016-10-01

Is it possible to do it all in one query? For example, something like this would be great:

https://my-key-vault-dev.vault.azure.net/secrets/MyTestSecret/?api-version=2016-10-01

回答1:


Microsoft.Azure.KeyVault library passes String.Empty as an version to the call when there is no specific version requested, so your suggestion should work.

In my case it is just https://mykeyvault.vault.azure.net/secrets/testSecret/



来源:https://stackoverflow.com/questions/48432376/how-to-get-the-latest-secret-version-value-from-azure-key-vault-in-one-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!