Complete the code to specify the connection string for an Azure Storage account.
connection_string = "DefaultEndpointsProtocol=https;AccountName=[1];AccountKey=your_key;EndpointSuffix=core.windows.net"
The AccountName in the connection string must be the name of your Azure Storage account.
Complete the code to create a BlobServiceClient using the connection string.
from azure.storage.blob import BlobServiceClient client = BlobServiceClient.from_connection_string([1])
The from_connection_string method requires the full connection string to create the client.
Fix the error in the code to upload a blob to Azure Blob Storage.
blob_client = client.get_blob_client(container=[1], blob='example.txt') with open('example.txt', 'rb') as data: blob_client.upload_blob(data)
The container name must be a string literal with quotes in Python.
Fill both blanks to list blobs in a container and print their names.
container_client = client.get_container_client([1]) for blob in container_client.[2](): print(blob.name)
get_blobs().The container name must be a string, and the method to list blobs is list_blobs().
Fill all three blanks to download a blob and save it locally.
blob_client = client.get_blob_client(container=[1], blob=[2]) with open([3], 'wb') as file: data = blob_client.download_blob() file.write(data.readall())
The container and blob names must be strings with quotes, and the local file name is also a string.