0
0
Azurecloud~10 mins

Blob storage (block, append, page) in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a block blob client in Azure Blob Storage.

Azure
blob_client = container_client.get_blob_client([1])
Drag options to blanks, or click blank then click option'
A'blockblob1'
B'appendblob'
C'pageblob'
D'blobcontainer'
Attempts:
3 left
💡 Hint
Common Mistakes
Using blob type instead of blob name
Using container name instead of blob name
2fill in blank
medium

Complete the code to upload data to an append blob.

Azure
append_blob_client = container_client.get_blob_client([1])
append_blob_client.create_append_blob()
append_blob_client.append_block(data)
Drag options to blanks, or click blank then click option'
A'blockblob1'
B'container1'
C'pageblob1'
D'appendblob1'
Attempts:
3 left
💡 Hint
Common Mistakes
Using block blob name for append blob client
Using container name instead of blob name
3fill in blank
hard

Fix the error in the code to upload a page blob with correct size alignment.

Azure
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)
Drag options to blanks, or click blank then click option'
A'blockblob1'
B'pageblob1'
C'appendblob1'
D'container1'
Attempts:
3 left
💡 Hint
Common Mistakes
Using block or append blob names
Incorrect size alignment for page blob
4fill in blank
hard

Fill both blanks to create and upload a block blob with data.

Azure
block_blob_client = container_client.get_blob_client([1])
block_blob_client.upload_blob([2], overwrite=True)
Drag options to blanks, or click blank then click option'
A'blockblob2'
Bdata
C'appendblob2'
D'pageblob2'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong blob type names
Passing blob name instead of data to upload_blob
5fill in blank
hard

Fill all three blanks to create an append blob, append data, and set metadata.

Azure
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])
Drag options to blanks, or click blank then click option'
A'appendblob3'
Blog_data
C{'source': 'app', 'type': 'log'}
D'blockblob3'
Attempts:
3 left
💡 Hint
Common Mistakes
Using block blob name
Passing wrong data variable
Incorrect metadata format