public static async Task ValidateAndResolveWasbScriptActionEndpointUri(Uri uri, WabStorageAccountConfiguration storage)
        {
            if (uri == null)
            {
                throw new ArgumentNullException("uri");
            }

            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }

            // Try to check the existence of the script in the URI specified.
            var storageAbstractionCreds = new WindowsAzureStorageAccountCredentials()
            {
                Key  = storage.Key,
                Name = GetFullyQualifiedStorageAccountName(storage.Name),
            };

            var storageAbstraction = new WabStorageAbstraction(storageAbstractionCreds);

            bool exists = false;

            try
            {
                // Firstly converts the URI to wasb style and then test it against wasb storage for existence.
                exists = await storageAbstraction.Exists(ConvertToWasbUriIfNeeded(uri));
            }
            catch (Exception e)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Script action URI: {0} cannot be retrieved correctly. Inner exception: {1}", uri.AbsoluteUri, e.Message), e);
            }

            if (!exists)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Script action URI: {0} cannot be retrieved correctly because it does not exist", uri.AbsoluteUri));
            }
        }