static void SetLength(CloudPageBlob blob, long newLength, int timeout = 10000)
        {
            var credentials = blob.ServiceClient.Credentials;

            var requestUri = blob.Uri;

            if (credentials.NeedsTransformUri)
            {
                requestUri = new Uri(credentials.TransformUri(requestUri.ToString()));
            }

            var request = BlobRequest.SetProperties(requestUri, timeout, blob.Properties, null, newLength);

            request.Timeout = timeout;

            credentials.SignRequest(request);

            using (request.GetResponse()) { }
        }
        public void Resize_Blob(CloudPageBlob pageBlob, CloudBlobClient blobStorage, long newBlobSize)
        {
            Uri requestUri = pageBlob.Uri;

            if (blobStorage.Credentials.NeedsTransformUri)
            {
                requestUri = new Uri(blobStorage.Credentials.TransformUri(requestUri.ToString()));
            }

            HttpWebRequest request = BlobRequest.SetProperties(requestUri, timeout,
                                                               pageBlob.Properties, null, newBlobSize);

            request.Timeout = timeout;
            blobStorage.Credentials.SignRequest(request);
            using (WebResponse response = request.GetResponse())
            {
                // call succeeded
            };
        }