Table of Contents

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>?)

Calls the specified REST endpoint, using OAuth to authenticate the specified access data.

public static Task<string> GetAccessTokenAsync(Uri? accessUri, Dictionary<string, string>? accessData)

Parameters

accessUri Uri

the location of the Azure Active Directory endpoint

accessData Dictionary<string, string>

the data required to POST to the specified endpoint

Returns

Task<string>

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)

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)

Parameters

accessToken string

the JSON obtained from GetAccessTokenAsync(Uri?, Dictionary<string, string>?)

secretUri Uri

the location of the Azure Key Vault endpoint

Returns

Task<string>

Remarks

The conventional way to generate the secretUri is via RestApiMetadata, its ToAzureKeyVaultSecretUri(RestApiMetadata?, string) method.