Complete the code to create a block blob client in Azure Blob Storage.
blob_client = container_client.get_blob_client([1])To create a block blob client, you specify the blob name as a string. The type is determined by the client method, so the blob name should be the actual blob's name.
Complete the code to upload data to an append blob.
append_blob_client = container_client.get_blob_client([1])
append_blob_client.create_append_blob()
append_blob_client.append_block(data)Append blobs are used for append operations like logs. The blob name should reflect the append blob you want to create.
Fix the error in the code to upload a page blob with correct size alignment.
page_blob_client = container_client.get_blob_client([1]) page_blob_client.create_page_blob(size=5120) page_blob_client.upload_page(data, offset=0, length=512)
Page blobs require the size to be a multiple of 512 bytes. The blob name must be for a page blob.
Fill both blanks to create and upload a block blob with data.
block_blob_client = container_client.get_blob_client([1]) block_blob_client.upload_blob([2], overwrite=True)
The first blank is the block blob name. The second blank is the data variable holding the content to upload.
Fill all three blanks to create an append blob, append data, and set metadata.
append_blob_client = container_client.get_blob_client([1]) append_blob_client.create_append_blob() append_blob_client.append_block([2]) append_blob_client.set_blob_metadata([3])
The first blank is the append blob name. The second is the data variable to append. The third is a dictionary with metadata keys and values.