protected void PopulateFromBlobUrl(string url) { BlobUri blobUri; if (BlobUri.TryParse(url, out blobUri)) { SetProperty(ref containerUrl, blobUri.ContainerUri.ToString(), ValidateContainerUrl, ContainerUrlPropertyName); SetProperty(ref accountKey, blobUri.AccountKey, ValidateNonEmptyString, AccountKeyPropertyName); SetProperty(ref blobName, blobUri.BlobName, ValidateNonEmptyString, BlobNamePropertyName); SetBlobUrl(url); } }
protected static BlobReference GetBlobReference(string url) { BlobUri blobUri; if (!BlobUri.TryParse(url, out blobUri)) { throw Errors.InvalidBlobUrl(); } return(new BlobReference( new CloudBlobContainer( blobUri.ContainerUri, new StorageCredentials(blobUri.AccountName, blobUri.AccountKey)), blobUri.BlobName)); }