Book Image

Microsoft Azure Development Cookbook Second Edition

Book Image

Microsoft Azure Development Cookbook Second Edition

Overview of this book

Table of Contents (15 chapters)
Microsoft Azure Development Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Uploading blocks to a block blob


The Azure Blob service supports two types of blobs: block blobs optimized for streaming and page blobs optimized for random access. Block blobs are so named because they comprise blocks (identified by block IDs) and can be updated either by replacing the entire blob or by replacing individual blocks. Page blobs can be updated either by replacing the entire blob or by modifying individual pages.

A block blob can be up to 200 GB in size and comprises blocks that can be up to 4 MB; a block blob cannot exceed 50,000 blocks. Block blobs larger than 64 MB must be uploaded in blocks, and then, a list of uploaded blocks must be committed to create the blob. The various upload methods in the CloudBlob class handle this two-phase process automatically. However, there are times when it is worthwhile taking direct control of the block upload and commit process. These include uploading very large blobs, performing parallel uploads of blocks, or updating individual blocks...