Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
96776c2
gencode
l0lawrence Jan 29, 2026
e25f505
delete
l0lawrence Jan 29, 2026
71b9fd4
update model imports
l0lawrence Jan 29, 2026
5ef636a
easier diff for rn
l0lawrence Jan 29, 2026
71b7dd0
fix gen->reg code issues -- some Qs HERE
l0lawrence Jan 29, 2026
5d9c979
double base_url
l0lawrence Jan 29, 2026
2a9e534
missing imports here
l0lawrence Jan 29, 2026
a4f0e6e
serialize -- need to look at
l0lawrence Jan 29, 2026
56b4dc1
do wrap the client its easier
l0lawrence Jan 29, 2026
820fde4
regen w/client.tsp changes
l0lawrence Jan 29, 2026
7be5b42
needed _data attribute **look into
l0lawrence Jan 30, 2026
9c4f288
patch updates
l0lawrence Jan 30, 2026
fd41663
param models now splatted -- using TypedDicts
l0lawrence Jan 30, 2026
67a31ae
ai helping to fix the etag/matchcondition mismatch
l0lawrence Jan 30, 2026
894bcbc
Merge branch 'main' into storageblob_under
l0lawrence Jan 30, 2026
10ed89a
regen with xml deserialization
l0lawrence Jan 30, 2026
b719ed9
temp remove & x-msmm-paths to get operations to work
l0lawrence Jan 30, 2026
9160a0a
more options
l0lawrence Jan 30, 2026
132e6f5
signedIdentifiers and more {} splatting
l0lawrence Jan 30, 2026
e0025ed
mising kwarg
l0lawrence Jan 30, 2026
447e247
enum xml deserialize
l0lawrence Jan 30, 2026
8b278e3
surprised this didnt fail before?
l0lawrence Jan 30, 2026
4d6185e
more models
l0lawrence Jan 30, 2026
b7ab80a
EMITTER ISSUE
l0lawrence Jan 30, 2026
9985f8d
copilot fixin more stuff
l0lawrence Feb 2, 2026
6340d30
regen with alttype
l0lawrence Feb 2, 2026
be664c9
model init
l0lawrence Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
UserDelegationKey,
Services
)
from ._generated.models import RehydratePriority
from ._generated.azure.storage.blobs.models import RehydratePriority
from ._models import (
BlobType,
BlockState,
Expand Down
54 changes: 33 additions & 21 deletions sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
)
from ._download import StorageStreamDownloader
from ._encryption import StorageEncryptionMixin, _ERROR_UNSUPPORTED_METHOD_FOR_ENCRYPTION
from ._generated import AzureBlobStorage
from ._generated.models import CpkInfo
from ._generated.azure.storage.blobs import AzureBlobStorage
from ._generated.azure.storage.blobs.models import CpkInfo
from ._lease import BlobLeaseClient
from ._models import BlobBlock, BlobProperties, BlobQueryError, BlobType, PageRange, PageRangePaged
from ._quick_query_helper import BlobQueryReader
Expand Down Expand Up @@ -186,7 +186,7 @@ def __init__(
self._raw_credential = credential if credential else sas_token
self._query_str, credential = self._format_query_string(sas_token, credential, snapshot=self.snapshot)
super(BlobClient, self).__init__(parsed_url, service='blob', credential=credential, **kwargs)
self._client = AzureBlobStorage(self.url, get_api_version(kwargs), base_url=self.url, pipeline=self._pipeline)
self._client = AzureBlobStorage(self.url, get_api_version(kwargs), pipeline=self._pipeline)
self._configure_encryption(kwargs)

def __enter__(self) -> Self:
Expand Down Expand Up @@ -870,7 +870,7 @@ def query_blob(self, query_expression: str, **kwargs: Any) -> BlobQueryReader:
raise ValueError("Customer provided encryption key must be used over HTTPS.")
options, delimiter = _quick_query_options(self.snapshot, query_expression, **kwargs)
try:
headers, raw_response_body = self._client.blob.query(**options)
headers, raw_response_body = self._client.block_blob.query(**options)
except HttpResponseError as error:
process_storage_error(error)
return BlobQueryReader(
Expand Down Expand Up @@ -1113,6 +1113,10 @@ def get_blob_properties(self, **kwargs: Any) -> BlobProperties:
# TODO: extract this out as _get_blob_properties_options
access_conditions = get_access_conditions(kwargs.pop('lease', None))
mod_conditions = get_modify_conditions(kwargs)
if access_conditions:
kwargs.update(access_conditions)
if mod_conditions:
kwargs.update(mod_conditions)
version_id = get_version_id(self.version_id, kwargs)
cpk = kwargs.pop('cpk', None)
cpk_info = None
Expand All @@ -1121,6 +1125,7 @@ def get_blob_properties(self, **kwargs: Any) -> BlobProperties:
raise ValueError("Customer provided encryption key must be used over HTTPS.")
cpk_info = CpkInfo(encryption_key=cpk.key_value, encryption_key_sha256=cpk.key_hash,
encryption_algorithm=cpk.algorithm)
kwargs.update(cpk_info)
try:
cls_method = kwargs.pop('cls', None)
if cls_method:
Expand All @@ -1129,10 +1134,7 @@ def get_blob_properties(self, **kwargs: Any) -> BlobProperties:
timeout=kwargs.pop('timeout', None),
version_id=version_id,
snapshot=self.snapshot,
lease_access_conditions=access_conditions,
modified_access_conditions=mod_conditions,
cls=kwargs.pop('cls', None) or deserialize_blob_properties,
cpk_info=cpk_info,
**kwargs))
except HttpResponseError as error:
process_storage_error(error)
Expand Down Expand Up @@ -1258,7 +1260,7 @@ def set_blob_metadata(
raise ValueError("Customer provided encryption key must be used over HTTPS.")
options = _set_blob_metadata_options(metadata=metadata, **kwargs)
try:
return cast(Dict[str, Union[str, datetime]], self._client.blob.set_metadata(**options))
return cast(Dict[str, Union[str, datetime]], self._client.blob.set_metadata(metadata=metadata, **options))
except HttpResponseError as error:
process_storage_error(error)

Expand Down Expand Up @@ -1292,9 +1294,8 @@ def set_immutability_policy(
"""

version_id = get_version_id(self.version_id, kwargs)
kwargs['immutability_policy_expiry'] = immutability_policy.expiry_time
kwargs['immutability_policy_mode'] = immutability_policy.policy_mode
return cast(Dict[str, str], self._client.blob.set_immutability_policy(
expiry=immutability_policy.expiry_time, immutability_policy_mode=immutability_policy.policy_mode,
cls=return_response_headers, version_id=version_id, **kwargs))

@distributed_trace
Expand Down Expand Up @@ -1344,7 +1345,7 @@ def set_legal_hold(self, legal_hold: bool, **kwargs: Any) -> Dict[str, Union[str

version_id = get_version_id(self.version_id, kwargs)
return cast(Dict[str, Union[str, datetime, bool]], self._client.blob.set_legal_hold(
legal_hold, version_id=version_id, cls=return_response_headers, **kwargs))
legal_hold=legal_hold, version_id=version_id, cls=return_response_headers, **kwargs))

@distributed_trace
def create_page_blob(
Expand Down Expand Up @@ -1442,14 +1443,19 @@ def create_page_blob(
raise ValueError(_ERROR_UNSUPPORTED_METHOD_FOR_ENCRYPTION)
if kwargs.get('cpk') and self.scheme.lower() != 'https':
raise ValueError("Customer provided encryption key must be used over HTTPS.")
options = _create_page_blob_options(
options = _create_page_blob_options( # TODO: do we need this?
size=size,
content_settings=content_settings,
metadata=metadata,
premium_page_blob_tier=premium_page_blob_tier,
**kwargs)
try:
return cast(Dict[str, Any], self._client.page_blob.create(**options))
return cast(Dict[str, Any], self._client.page_blob.create(size=size,
content_settings=content_settings,
metadata=metadata,
premium_page_blob_tier=premium_page_blob_tier,
**options,
**kwargs))
except HttpResponseError as error:
process_storage_error(error)

Expand Down Expand Up @@ -1973,6 +1979,10 @@ def set_standard_blob_tier(self, standard_blob_tier: Union[str, "StandardBlobTie
"""
access_conditions = get_access_conditions(kwargs.pop('lease', None))
mod_conditions = get_modify_conditions(kwargs)
if access_conditions:
kwargs.update(access_conditions)
if mod_conditions:
kwargs.update(mod_conditions)
version_id = get_version_id(self.version_id, kwargs)
if standard_blob_tier is None:
raise ValueError("A StandardBlobTier must be specified")
Expand All @@ -1983,8 +1993,6 @@ def set_standard_blob_tier(self, standard_blob_tier: Union[str, "StandardBlobTie
tier=standard_blob_tier,
snapshot=self.snapshot,
timeout=kwargs.pop('timeout', None),
modified_access_conditions=mod_conditions,
lease_access_conditions=access_conditions,
version_id=version_id,
**kwargs)
except HttpResponseError as error:
Expand Down Expand Up @@ -2171,13 +2179,15 @@ def get_block_list(
"""
access_conditions = get_access_conditions(kwargs.pop('lease', None))
mod_conditions = get_modify_conditions(kwargs)
if access_conditions:
kwargs.update(access_conditions)
if mod_conditions:
kwargs.update(mod_conditions)
try:
blocks = self._client.block_blob.get_block_list(
list_type=block_list_type,
snapshot=self.snapshot,
timeout=kwargs.pop('timeout', None),
lease_access_conditions=access_conditions,
modified_access_conditions=mod_conditions,
**kwargs)
except HttpResponseError as error:
process_storage_error(error)
Expand Down Expand Up @@ -2325,14 +2335,16 @@ def set_premium_page_blob_tier(self, premium_page_blob_tier: "PremiumPageBlobTie
"""
access_conditions = get_access_conditions(kwargs.pop('lease', None))
mod_conditions = get_modify_conditions(kwargs)
if access_conditions:
kwargs.update(access_conditions)
if mod_conditions:
kwargs.update(mod_conditions)
if premium_page_blob_tier is None:
raise ValueError("A PremiumPageBlobTier must be specified")
try:
self._client.blob.set_tier(
tier=premium_page_blob_tier,
timeout=kwargs.pop('timeout', None),
lease_access_conditions=access_conditions,
modified_access_conditions=mod_conditions,
**kwargs)
except HttpResponseError as error:
process_storage_error(error)
Expand Down Expand Up @@ -2817,9 +2829,9 @@ def resize_blob(self, size: int, **kwargs: Any) -> Dict[str, Union[str, datetime
"""
if kwargs.get('cpk') and self.scheme.lower() != 'https':
raise ValueError("Customer provided encryption key must be used over HTTPS.")
options = _resize_blob_options(size=size, **kwargs)
# options = _resize_blob_options(size=size, **kwargs) TODO: is this needed?
try:
return cast(Dict[str, Any], self._client.page_blob.resize(**options))
return cast(Dict[str, Any], self._client.page_blob.resize(size=size, **kwargs))
except HttpResponseError as error:
process_storage_error(error)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from azure.core.tracing.decorator import distributed_trace
from ._container_client import ContainerClient
from ._download import StorageStreamDownloader
from ._encryption import StorageEncryptionMixin
from ._generated.models import RehydratePriority
from ._generated.azure.storage.blobs.models import RehydratePriority
from ._lease import BlobLeaseClient
from ._models import (
ArrowDialect,
Expand Down
Loading