I'm trying to create a function that given Azure credentials check if they are valid.
In this case, I'm taking ADLS account name and account key credentails.
The Azure Java SDK does not provide an API for this, os I'm doing the following manually
def testConnection(account: String, accountKey: String): Boolean = {
val storageConnectionString = s"DefaultEndpointsProtocol=https;AccountName=${accountName};AccountKey=${accountKey}"
val storageAccount = CloudStorageAccount.parse(storageConnectionString)
val client = storageAccount.createCloudBlobClient()
Try{ client.downloadServiceProperties() }.isSuccess
}
the problem is downloadServiceProperties()
is relatively slow, it may take a minute or so. Are they other faster options to check if the user ADLS credentials are valid ones?