add some changes to allow the code to auto-detect a suitable storage account using the new REST API functions