Class AzureKeyVaultRestApiUtility
- Namespace
- Songhay
- Assembly
- SonghayCore.dll
Shared REST routines for Azure BLOB Storage.
public static class AzureKeyVaultRestApiUtility
- Inheritance
-
AzureKeyVaultRestApiUtility
- Inherited Members
Remarks
See “How To Access Azure Key Vault Secrets Through Rest API Using Postman” by Anupam Maiti [ https://www.c-sharpcorner.com/article/how-to-access-azure-key-vault-secrets-through-rest-api-using-postman/ ]
Methods
GetAccessTokenAsync(Uri?, Dictionary<string, string>?, Func<HttpClient>)
Calls the specified REST endpoint, using OAuth to authenticate the specified access data.
public static Task<string> GetAccessTokenAsync(Uri? accessUri, Dictionary<string, string>? accessData, Func<HttpClient> clientGetter)
Parameters
accessUriUrithe location of the Azure Active Directory endpoint
accessDataDictionary<string, string>the data required to
POSTto the specified endpointclientGetterFunc<HttpClient>The required client getter.
Returns
Remarks
The conventional way to generate the accessUri is via RestApiMetadata,
its ToAzureActiveDirectoryAccessTokenUri(RestApiMetadata?) method.
The conventional way to generate the accessData is via RestApiMetadata,
its ToAzureActiveDirectoryAccessTokenData(RestApiMetadata?) method.
GetSecretAsync(string, Uri, Func<HttpClient>)
Calls REST endpoint under {vaultName}.vault.azure.net
to get a secret from the specified vault.
public static Task<string> GetSecretAsync(string accessToken, Uri secretUri, Func<HttpClient> clientGetter)
Parameters
accessTokenstringthe JSON obtained from GetAccessTokenAsync(Uri?, Dictionary<string, string>?, Func<HttpClient>)
secretUriUrithe location of the Azure Key Vault endpoint
clientGetterFunc<HttpClient>The required client getter.
Returns
Remarks
The conventional way to generate the secretUri is via RestApiMetadata,
its ToAzureKeyVaultSecretUri(RestApiMetadata?, string) method.