'which SDK is better to use for azure: blobs with Python v2.1 SDK or blobs with Python v12 SDK

there are some code using v12 and some with v2.1. and its very confusing sometimes.

this is with v2.1

block_blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)

and this one is with v12

blob_service_client = BlobServiceClient.from_connection_string(self.connection_string)


Solution 1:[1]

You should not be using version 2.1 as it is the legacy version of the SDK. You should always be using the latest version of the SDK (12.x at the time of writing this answer) as it will have support for all the new features Azure Blob Storage has to offer.

Though not recommended but the only reason one would want to use version 2.1 of the SDK if there's a need to have single SDK for managing all Azure Storage resources - Blobs, Files, Queues and Tables. With version 12, each resource type has a dedicated SDK.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gaurav Mantri