My application allows users to enter an Azure Blob Storage SAS URL. How would I go about validating it? I'm using the Azure Storage Blobs client library, and there doesn't seem to be any way of validating SAS URLs without actually performing a blob operation (which I don't want to do).
The validation operation can be asynchronous and involve an API call if necessary (ie it can be triggered with a button).
public class SASURLValidator
{
public async Task<bool> ValidateSASURL(string sasURL)
{
// What goes here?
}
public async Task Test()
{
var result = await ValidateSASURL("https://blobstorageaccountname.blob.core.windows.net/containerName?sp=w&st=2022-02-15T02:07:49Z&se=2022-03-15T10:07:49Z&spr=https&sv=2020-08-04&sr=c&sig=JDFJEF342JDSFJIERJsdjfkajiwSKDFJIQWJIFJSKDFJWE%3D")
// result should be true if the above is a valid SAS
}
}