diff --git a/src/azure-cli/azure/cli/command_modules/storage/commands.py b/src/azure-cli/azure/cli/command_modules/storage/commands.py index c8708737d4e..5153558a8e0 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/commands.py +++ b/src/azure-cli/azure/cli/command_modules/storage/commands.py @@ -515,7 +515,8 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT g.storage_command_oauth('restore', 'undelete_container', min_api='2020-02-10') with self.command_group('storage container policy', resource_type=ResourceType.DATA_STORAGE_BLOB, - custom_command_type=get_custom_sdk('access_policy', client_factory=cf_container_client, + custom_command_type=get_custom_sdk('container_access_policy', + client_factory=cf_container_client, resource_type=ResourceType.DATA_STORAGE_BLOB)) as g: from ._transformers import transform_acl_list_output, transform_acl_edit, transform_acl_datetime g.storage_custom_command_oauth('create', 'create_acl_policy', transform=transform_acl_edit) diff --git a/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py b/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py index 2d1033c307d..9386a8c07d6 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py +++ b/src/azure-cli/azure/cli/command_modules/storage/operations/blob.py @@ -163,7 +163,10 @@ def delete_container(client, container_name, fail_not_exist=False, lease_id=None def set_container_permission(client, public_access=None, **kwargs): acl_response = client.get_container_access_policy() - signed_identifiers = {} if not acl_response.get('signed_identifiers', None) else acl_response['signed_identifiers'] + signed_identifiers = {} + if acl_response.get('signed_identifiers'): + for identifier in acl_response["signed_identifiers"]: + signed_identifiers[identifier.id] = identifier.access_policy return client.set_container_access_policy(signed_identifiers=signed_identifiers, public_access=public_access, **kwargs) diff --git a/src/azure-cli/azure/cli/command_modules/storage/operations/container_access_policy.py b/src/azure-cli/azure/cli/command_modules/storage/operations/container_access_policy.py new file mode 100644 index 00000000000..7d9e3e1db4b --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/storage/operations/container_access_policy.py @@ -0,0 +1,113 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.profiles import ResourceType + + +def create_acl_policy(cmd, client, policy_name, start=None, expiry=None, permission=None, **kwargs): + """Create a stored access policy on the containing object""" + t_access_policy = cmd.get_models('_models#AccessPolicy', resource_type=ResourceType.DATA_STORAGE_BLOB) + acl = _get_acl(cmd, client, **kwargs) + acl['signed_identifiers'][policy_name] = t_access_policy(permission, expiry, start) + if 'public_access' in acl: + kwargs['public_access'] = acl['public_access'] + + return _set_acl(cmd, client, acl['signed_identifiers'], **kwargs) + + +def get_acl_policy(cmd, client, policy_name, **kwargs): + """Show a stored access policy on a containing object""" + acl = _get_acl(cmd, client, **kwargs) + return acl['signed_identifiers'].get(policy_name) + + +def list_acl_policies(cmd, client, **kwargs): + """List stored access policies on a containing object""" + return _get_acl(cmd, client, **kwargs)['signed_identifiers'] + + +def set_acl_policy(cmd, client, policy_name, start=None, expiry=None, permission=None, **kwargs): + """Set a stored access policy on a containing object""" + if not (start or expiry or permission): + from knack.util import CLIError + raise CLIError('Must specify at least one property when updating an access policy.') + + acl = _get_acl(cmd, client, **kwargs) + + try: + policy = acl['signed_identifiers'][policy_name] + if policy is None: + t_access_policy = cmd.get_models('_models#AccessPolicy', resource_type=ResourceType.DATA_STORAGE_BLOB) + acl['signed_identifiers'][policy_name] = t_access_policy(permission, expiry, start) + else: + policy.start = start if start else policy.start + policy.expiry = expiry if expiry else policy.expiry + policy.permission = permission or policy.permission + if 'public_access' in acl: + kwargs['public_access'] = acl['public_access'] + + except KeyError: + from knack.util import CLIError + raise CLIError('ACL does not contain {}'.format(policy_name)) + return _set_acl(cmd, client, acl['signed_identifiers'], **kwargs) + + +def delete_acl_policy(cmd, client, policy_name, **kwargs): + """ Delete a stored access policy on a containing object """ + acl = _get_acl(cmd, client, **kwargs) + + try: + del acl['signed_identifiers'][policy_name] + except KeyError: + from knack.util import CLIError + raise CLIError('ACL does not contain {}'.format(policy_name)) + if 'public_access' in acl: + kwargs['public_access'] = acl['public_access'] + + return _set_acl(cmd, client, acl['signed_identifiers'], **kwargs) + + +def _get_service_container_type(cmd, client): + t_blob_svc = cmd.get_models('_container_client#ContainerClient', resource_type=ResourceType.DATA_STORAGE_BLOB) + if isinstance(client, t_blob_svc): + return "container" + + raise ValueError('Unsupported service {}'.format(type(client))) + + +def _get_acl(cmd, client, **kwargs): + container = _get_service_container_type(cmd, client) + get_acl_fn = getattr(client, 'get_{}_access_policy'.format(container)) + # When setting acl, sdk will validate that AccessPolicy.permission cannot be None, but '' is OK. + # So we convert every permission=None to permission='' here. + # This can be removed after sdk deprecate the validation. + return convert_acl_permissions(get_acl_fn(**kwargs)) + + +def convert_acl_permissions(result): + if result is None: + return None + if 'signed_identifiers' in result: + signed_identifiers = {} + for identifier in result["signed_identifiers"]: + if getattr(identifier.access_policy, 'permission') is None: + setattr(identifier.access_policy, 'permission', '') + signed_identifiers[identifier.id] = identifier.access_policy + result['signed_identifiers'] = signed_identifiers + return result + + +def _set_acl(cmd, client, acl, **kwargs): + from knack.util import CLIError + method_name = 'set_{}_access_policy'.format(_get_service_container_type(cmd, client)) + try: + method = getattr(client, method_name) + return method(acl, **kwargs) + except TypeError: + raise CLIError("Failed to invoke SDK method {}. The installed azure SDK may not be" + "compatible to this version of Azure CLI.".format(method_name)) + except AttributeError: + raise CLIError("Failed to get function {} from {}. The installed azure SDK may not be " + "compatible to this version of Azure CLI.".format(client.__class__.__name__, method_name)) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_container_operations.yaml b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_container_operations.yaml index 13fd2dc079a..09da24bdfcb 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_container_operations.yaml +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_container_operations.yaml @@ -15,13 +15,13 @@ interactions: ParameterSetName: - -n -g --query -o User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-azure-mgmt-storage/21.0.0 Python/3.7.9 - (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-azure-mgmt-storage/21.1.0 Python/3.9.13 + (Windows-10-10.0.19045-SP0) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2023-01-01&$expand=kerb response: body: - string: '{"keys":[{"creationTime":"2022-11-23T02:06:31.0935847Z","keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"creationTime":"2022-11-23T02:06:31.0935847Z","keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + string: '{"keys":[{"creationTime":"2024-01-18T03:11:38.1959983Z","keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"creationTime":"2024-01-18T03:11:38.1959983Z","keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' headers: cache-control: - no-cache @@ -30,7 +30,7 @@ interactions: content-type: - application/json date: - - Wed, 23 Nov 2022 02:06:58 GMT + - Thu, 18 Jan 2024 03:12:04 GMT expires: - '-1' pragma: @@ -39,12 +39,10 @@ interactions: - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff + x-ms-operation-identifier: + - tenantId=54826b22-38d6-4fb2-bad9-b7b93a3e9c5a,objectId=a7250e3a-0e5e-48e2-9a34-45f1f5e1a91e/eastus2euap/dca76edb-c69e-4342-b5cd-609b5122495d x-ms-ratelimit-remaining-subscription-resource-requests: - '11999' status: @@ -66,11 +64,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:06:58 GMT + - Thu, 18 Jan 2024 03:12:05 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -80,15 +78,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:06:59 GMT + - Thu, 18 Jan 2024 03:12:05 GMT etag: - - '"0x8DACCF767C61DFF"' + - '"0x8DC17D34030F584"' last-modified: - - Wed, 23 Nov 2022 02:06:59 GMT + - Thu, 18 Jan 2024 03:12:06 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 201 message: Created @@ -106,11 +104,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:06:59 GMT + - Thu, 18 Jan 2024 03:12:06 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -120,11 +118,11 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:00 GMT + - Thu, 18 Jan 2024 03:12:06 GMT etag: - - '"0x8DACCF767C61DFF"' + - '"0x8DC17D34030F584"' last-modified: - - Wed, 23 Nov 2022 02:06:59 GMT + - Thu, 18 Jan 2024 03:12:06 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-default-encryption-scope: @@ -142,7 +140,7 @@ interactions: x-ms-lease-status: - unlocked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -160,11 +158,11 @@ interactions: ParameterSetName: - -n --public-access --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:00 GMT + - Thu, 18 Jan 2024 03:12:07 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: @@ -175,17 +173,17 @@ interactions: content-type: - application/xml date: - - Wed, 23 Nov 2022 02:07:01 GMT + - Thu, 18 Jan 2024 03:12:07 GMT etag: - - '"0x8DACCF767C61DFF"' + - '"0x8DC17D34030F584"' last-modified: - - Wed, 23 Nov 2022 02:06:59 GMT + - Thu, 18 Jan 2024 03:12:06 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -207,13 +205,13 @@ interactions: ParameterSetName: - -n --public-access --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-blob-public-access: - blob x-ms-date: - - Wed, 23 Nov 2022 02:07:01 GMT + - Thu, 18 Jan 2024 03:12:08 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: @@ -223,15 +221,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:01 GMT + - Thu, 18 Jan 2024 03:12:08 GMT etag: - - '"0x8DACCF76935CB2A"' + - '"0x8DC17D341C23D5D"' last-modified: - - Wed, 23 Nov 2022 02:07:02 GMT + - Thu, 18 Jan 2024 03:12:08 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -249,11 +247,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:02 GMT + - Thu, 18 Jan 2024 03:12:09 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: @@ -264,11 +262,11 @@ interactions: content-type: - application/xml date: - - Wed, 23 Nov 2022 02:07:02 GMT + - Thu, 18 Jan 2024 03:12:09 GMT etag: - - '"0x8DACCF76935CB2A"' + - '"0x8DC17D341C23D5D"' last-modified: - - Wed, 23 Nov 2022 02:07:02 GMT + - Thu, 18 Jan 2024 03:12:08 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -276,7 +274,7 @@ interactions: x-ms-blob-public-access: - blob x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -294,11 +292,11 @@ interactions: ParameterSetName: - -n --public-access --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:03 GMT + - Thu, 18 Jan 2024 03:12:10 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: @@ -309,11 +307,11 @@ interactions: content-type: - application/xml date: - - Wed, 23 Nov 2022 02:07:03 GMT + - Thu, 18 Jan 2024 03:12:11 GMT etag: - - '"0x8DACCF76935CB2A"' + - '"0x8DC17D341C23D5D"' last-modified: - - Wed, 23 Nov 2022 02:07:02 GMT + - Thu, 18 Jan 2024 03:12:08 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -321,7 +319,7 @@ interactions: x-ms-blob-public-access: - blob x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -343,11 +341,11 @@ interactions: ParameterSetName: - -n --public-access --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:04 GMT + - Thu, 18 Jan 2024 03:12:11 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: @@ -357,15 +355,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:03 GMT + - Thu, 18 Jan 2024 03:12:11 GMT etag: - - '"0x8DACCF76A9D6341"' + - '"0x8DC17D3434D5F6E"' last-modified: - - Wed, 23 Nov 2022 02:07:04 GMT + - Thu, 18 Jan 2024 03:12:11 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -383,11 +381,54 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-date: + - Thu, 18 Jan 2024 03:12:11 GMT + x-ms-version: + - '2022-11-02' + method: GET + uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl + response: + body: + string: "\uFEFF" + headers: + content-type: + - application/xml + date: + - Thu, 18 Jan 2024 03:12:11 GMT + etag: + - '"0x8DC17D3434D5F6E"' + last-modified: + - Thu, 18 Jan 2024 03:12:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container policy create + Connection: + - keep-alive + ParameterSetName: + - -c -n --expiry --permissions --account-name --account-key + User-Agent: + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:04 GMT + - Thu, 18 Jan 2024 03:12:12 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: @@ -398,17 +439,241 @@ interactions: content-type: - application/xml date: - - Wed, 23 Nov 2022 02:07:04 GMT + - Thu, 18 Jan 2024 03:12:13 GMT + etag: + - '"0x8DC17D3434D5F6E"' + last-modified: + - Thu, 18 Jan 2024 03:12:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: ' + + policy0000042024-01-18T04:12:00Zracwdxyltfmei' + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container policy create + Connection: + - keep-alive + Content-Length: + - '240' + Content-Type: + - application/xml + ParameterSetName: + - -c -n --expiry --permissions --account-name --account-key + User-Agent: + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-date: + - Thu, 18 Jan 2024 03:12:13 GMT + x-ms-version: + - '2022-11-02' + method: PUT + uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 18 Jan 2024 03:12:13 GMT + etag: + - '"0x8DC17D344CC9C65"' + last-modified: + - Thu, 18 Jan 2024 03:12:13 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container set-permission + Connection: + - keep-alive + ParameterSetName: + - -n --public-access --account-name --account-key + User-Agent: + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-date: + - Thu, 18 Jan 2024 03:12:14 GMT + x-ms-version: + - '2022-11-02' + method: GET + uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl + response: + body: + string: "\uFEFFpolicy0000042024-01-18T04:12:00.0000000Zracwdxyltfmei" + headers: + content-type: + - application/xml + date: + - Thu, 18 Jan 2024 03:12:14 GMT + etag: + - '"0x8DC17D344CC9C65"' + last-modified: + - Thu, 18 Jan 2024 03:12:13 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: ' + + policy0000042024-01-18T04:12:00Zracwdxyltfmei' + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container set-permission + Connection: + - keep-alive + Content-Length: + - '240' + Content-Type: + - application/xml + ParameterSetName: + - -n --public-access --account-name --account-key + User-Agent: + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-blob-public-access: + - blob + x-ms-date: + - Thu, 18 Jan 2024 03:12:15 GMT + x-ms-version: + - '2022-11-02' + method: PUT + uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 18 Jan 2024 03:12:15 GMT + etag: + - '"0x8DC17D345A3CAA5"' + last-modified: + - Thu, 18 Jan 2024 03:12:15 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container show-permission + Connection: + - keep-alive + ParameterSetName: + - -n --account-name --account-key + User-Agent: + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-date: + - Thu, 18 Jan 2024 03:12:15 GMT + x-ms-version: + - '2022-11-02' + method: GET + uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl + response: + body: + string: "\uFEFFpolicy0000042024-01-18T04:12:00.0000000Zracwdxyltfmei" + headers: + content-type: + - application/xml + date: + - Thu, 18 Jan 2024 03:12:15 GMT + etag: + - '"0x8DC17D345A3CAA5"' + last-modified: + - Thu, 18 Jan 2024 03:12:15 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-ms-blob-public-access: + - blob + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container policy list + Connection: + - keep-alive + ParameterSetName: + - -c --account-name --account-key + User-Agent: + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-date: + - Thu, 18 Jan 2024 03:12:16 GMT + x-ms-version: + - '2022-11-02' + method: GET + uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl + response: + body: + string: "\uFEFFpolicy0000042024-01-18T04:12:00.0000000Zracwdxyltfmei" + headers: + content-type: + - application/xml + date: + - Thu, 18 Jan 2024 03:12:17 GMT etag: - - '"0x8DACCF76A9D6341"' + - '"0x8DC17D345A3CAA5"' last-modified: - - Wed, 23 Nov 2022 02:07:04 GMT + - Thu, 18 Jan 2024 03:12:15 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -426,11 +691,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:05 GMT + - Thu, 18 Jan 2024 03:12:18 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -440,13 +705,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:05 GMT + - Thu, 18 Jan 2024 03:12:18 GMT etag: - - '"0x8DACCF76A9D6341"' + - '"0x8DC17D345A3CAA5"' last-modified: - - Wed, 23 Nov 2022 02:07:04 GMT + - Thu, 18 Jan 2024 03:12:15 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob x-ms-default-encryption-scope: - $account-encryption-key x-ms-deny-encryption-scope-override: @@ -462,7 +729,7 @@ interactions: x-ms-lease-status: - unlocked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -480,30 +747,30 @@ interactions: ParameterSetName: - --query --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:06 GMT + - Thu, 18 Jan 2024 03:12:19 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/?comp=list&maxresults=5000&include= response: body: string: "\uFEFF5000cont000003Wed, - 23 Nov 2022 02:07:04 GMT\"0x8DACCF76A9D6341\"unlockedavailable$account-encryption-keyfalsefalsefalsefalse5000cont000003Thu, + 18 Jan 2024 03:12:15 GMT\"0x8DC17D345A3CAA5\"unlockedavailableblob$account-encryption-keyfalsefalsefalsefalse" headers: content-type: - application/xml date: - - Wed, 23 Nov 2022 02:07:07 GMT + - Thu, 18 Jan 2024 03:12:19 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -523,15 +790,15 @@ interactions: ParameterSetName: - -n --metadata --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:07 GMT + - Thu, 18 Jan 2024 03:12:20 GMT x-ms-meta-foo: - bar x-ms-meta-moo: - bak x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=metadata response: @@ -541,15 +808,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:07 GMT + - Thu, 18 Jan 2024 03:12:20 GMT etag: - - '"0x8DACCF76D1DBBC1"' + - '"0x8DC17D3490F277A"' last-modified: - - Wed, 23 Nov 2022 02:07:08 GMT + - Thu, 18 Jan 2024 03:12:21 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -567,11 +834,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:08 GMT + - Thu, 18 Jan 2024 03:12:21 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -581,13 +848,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:08 GMT + - Thu, 18 Jan 2024 03:12:22 GMT etag: - - '"0x8DACCF76D1DBBC1"' + - '"0x8DC17D3490F277A"' last-modified: - - Wed, 23 Nov 2022 02:07:08 GMT + - Thu, 18 Jan 2024 03:12:21 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob x-ms-default-encryption-scope: - $account-encryption-key x-ms-deny-encryption-scope-override: @@ -607,7 +876,7 @@ interactions: x-ms-meta-moo: - bak x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -627,11 +896,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:09 GMT + - Thu, 18 Jan 2024 03:12:22 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=metadata response: @@ -641,15 +910,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:22 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -667,11 +936,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -681,13 +950,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:11 GMT + - Thu, 18 Jan 2024 03:12:23 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob x-ms-default-encryption-scope: - $account-encryption-key x-ms-deny-encryption-scope-override: @@ -703,7 +974,7 @@ interactions: x-ms-lease-status: - unlocked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -726,9 +997,9 @@ interactions: - --lease-duration -c --if-modified-since --proposed-lease-id --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:12 GMT + - Thu, 18 Jan 2024 03:12:25 GMT x-ms-lease-action: - acquire x-ms-lease-duration: @@ -736,7 +1007,7 @@ interactions: x-ms-proposed-lease-id: - abcdabcd-abcd-abcd-abcd-abcdabcdabcd x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?comp=lease&restype=container response: @@ -746,17 +1017,17 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:13 GMT + - Thu, 18 Jan 2024 03:12:25 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-lease-id: - abcdabcd-abcd-abcd-abcd-abcdabcdabcd x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 201 message: Created @@ -774,11 +1045,11 @@ interactions: ParameterSetName: - --name --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:13 GMT + - Thu, 18 Jan 2024 03:12:26 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -788,13 +1059,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:13 GMT + - Thu, 18 Jan 2024 03:12:26 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob x-ms-default-encryption-scope: - $account-encryption-key x-ms-deny-encryption-scope-override: @@ -812,7 +1085,7 @@ interactions: x-ms-lease-status: - locked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -832,9 +1105,9 @@ interactions: ParameterSetName: - -c --lease-id --proposed-lease-id --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:14 GMT + - Thu, 18 Jan 2024 03:12:27 GMT x-ms-lease-action: - change x-ms-lease-id: @@ -842,7 +1115,7 @@ interactions: x-ms-proposed-lease-id: - dcbadcba-dcba-dcba-dcba-dcbadcbadcba x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?comp=lease&restype=container response: @@ -852,17 +1125,17 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:15 GMT + - Thu, 18 Jan 2024 03:12:27 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-lease-id: - dcbadcba-dcba-dcba-dcba-dcbadcbadcba x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -882,15 +1155,15 @@ interactions: ParameterSetName: - -c --lease-id --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:15 GMT + - Thu, 18 Jan 2024 03:12:28 GMT x-ms-lease-action: - renew x-ms-lease-id: - dcbadcba-dcba-dcba-dcba-dcbadcbadcba x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?comp=lease&restype=container response: @@ -900,17 +1173,17 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:16 GMT + - Thu, 18 Jan 2024 03:12:28 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-lease-id: - dcbadcba-dcba-dcba-dcba-dcbadcbadcba x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -928,11 +1201,11 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:16 GMT + - Thu, 18 Jan 2024 03:12:29 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -942,13 +1215,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:17 GMT + - Thu, 18 Jan 2024 03:12:30 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob x-ms-default-encryption-scope: - $account-encryption-key x-ms-deny-encryption-scope-override: @@ -966,7 +1241,7 @@ interactions: x-ms-lease-status: - locked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -986,15 +1261,15 @@ interactions: ParameterSetName: - -c --lease-break-period --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:17 GMT + - Thu, 18 Jan 2024 03:12:30 GMT x-ms-lease-action: - break x-ms-lease-break-period: - '30' x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?comp=lease&restype=container response: @@ -1004,17 +1279,17 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:18 GMT + - Thu, 18 Jan 2024 03:12:31 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-lease-time: - '30' x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 202 message: Accepted @@ -1032,11 +1307,11 @@ interactions: ParameterSetName: - --name --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:19 GMT + - Thu, 18 Jan 2024 03:12:31 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -1046,13 +1321,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:19 GMT + - Thu, 18 Jan 2024 03:12:32 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob x-ms-default-encryption-scope: - $account-encryption-key x-ms-deny-encryption-scope-override: @@ -1068,7 +1345,7 @@ interactions: x-ms-lease-status: - locked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -1088,15 +1365,15 @@ interactions: ParameterSetName: - -c --lease-id --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:20 GMT + - Thu, 18 Jan 2024 03:12:33 GMT x-ms-lease-action: - release x-ms-lease-id: - dcbadcba-dcba-dcba-dcba-dcbadcbadcba x-ms-version: - - '2021-06-08' + - '2022-11-02' method: PUT uri: https://clitest000002.blob.core.windows.net/cont000003?comp=lease&restype=container response: @@ -1106,15 +1383,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:20 GMT + - Thu, 18 Jan 2024 03:12:33 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -1132,11 +1409,11 @@ interactions: ParameterSetName: - --name --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:21 GMT + - Thu, 18 Jan 2024 03:12:34 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -1146,13 +1423,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:21 GMT + - Thu, 18 Jan 2024 03:12:34 GMT etag: - - '"0x8DACCF76E648A3C"' + - '"0x8DC17D34A79CDF1"' last-modified: - - Wed, 23 Nov 2022 02:07:10 GMT + - Thu, 18 Jan 2024 03:12:23 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob x-ms-default-encryption-scope: - $account-encryption-key x-ms-deny-encryption-scope-override: @@ -1168,7 +1447,7 @@ interactions: x-ms-lease-status: - unlocked x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 200 message: OK @@ -1188,11 +1467,11 @@ interactions: ParameterSetName: - --name --fail-not-exist --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:22 GMT + - Thu, 18 Jan 2024 03:12:35 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: DELETE uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: @@ -1202,11 +1481,11 @@ interactions: content-length: - '0' date: - - Wed, 23 Nov 2022 02:07:23 GMT + - Thu, 18 Jan 2024 03:12:35 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 202 message: Accepted @@ -1224,30 +1503,30 @@ interactions: ParameterSetName: - -n --account-name --account-key User-Agent: - - AZURECLI/2.42.0 (PIP) azsdk-python-storage-blob/12.12.0 Python/3.7.9 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Wed, 23 Nov 2022 02:07:23 GMT + - Thu, 18 Jan 2024 03:12:36 GMT x-ms-version: - - '2021-06-08' + - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container response: body: string: "\uFEFFContainerNotFoundThe - specified container does not exist.\nRequestId:b99371f1-601e-0047-2ee0-fe67cb000000\nTime:2022-11-23T02:07:24.5217262Z" + specified container does not exist.\nRequestId:a4d4dce2-901e-0048-27bc-492aad000000\nTime:2024-01-18T03:12:37.5898768Z" headers: content-length: - '223' content-type: - application/xml date: - - Wed, 23 Nov 2022 02:07:24 GMT + - Thu, 18 Jan 2024 03:12:37 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-error-code: - ContainerNotFound x-ms-version: - - '2021-06-08' + - '2022-11-02' status: code: 404 message: The specified container does not exist. diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_container_access_policy_scenario.yaml b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_container_access_policy_scenario.yaml index 54e2afc801b..020e6ee113e 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_container_access_policy_scenario.yaml +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_container_access_policy_scenario.yaml @@ -15,13 +15,13 @@ interactions: ParameterSetName: - -n -g --query -o User-Agent: - - AZURECLI/2.53.0 azsdk-python-azure-mgmt-storage/21.1.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-azure-mgmt-storage/21.1.0 Python/3.9.13 + (Windows-10-10.0.19045-SP0) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2023-01-01&$expand=kerb response: body: - string: '{"keys":[{"creationTime":"2023-10-19T09:35:50.5392635Z","keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"creationTime":"2023-10-19T09:35:50.5392635Z","keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + string: '{"keys":[{"creationTime":"2024-01-18T02:31:32.4148201Z","keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"creationTime":"2024-01-18T02:31:32.4148201Z","keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' headers: cache-control: - no-cache @@ -30,7 +30,7 @@ interactions: content-type: - application/json date: - - Thu, 19 Oct 2023 09:36:11 GMT + - Thu, 18 Jan 2024 02:31:58 GMT expires: - '-1' pragma: @@ -39,14 +39,12 @@ interactions: - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff + x-ms-operation-identifier: + - tenantId=54826b22-38d6-4fb2-bad9-b7b93a3e9c5a,objectId=a7250e3a-0e5e-48e2-9a34-45f1f5e1a91e/eastus2euap/58d942c8-9be3-4dc7-9d72-527a6a48e3cb x-ms-ratelimit-remaining-subscription-resource-requests: - - '11989' + - '11998' status: code: 200 message: OK @@ -64,12 +62,13 @@ interactions: Content-Length: - '0' ParameterSetName: - - -n --account-name --account-key + - -n --public-access --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-blob-public-access: + - blob x-ms-date: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:00 GMT x-ms-version: - '2022-11-02' method: PUT @@ -81,11 +80,11 @@ interactions: content-length: - '0' date: - - Thu, 19 Oct 2023 09:36:11 GMT + - Thu, 18 Jan 2024 02:32:01 GMT etag: - - '"0x8DBD086D52A144A"' + - '"0x8DC17CDA6AD8A02"' last-modified: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:01 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: @@ -107,10 +106,9 @@ interactions: ParameterSetName: - -c -n --expiry --permissions --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:01 GMT x-ms-version: - '2022-11-02' method: GET @@ -123,15 +121,17 @@ interactions: content-type: - application/xml date: - - Thu, 19 Oct 2023 09:36:11 GMT + - Thu, 18 Jan 2024 02:32:02 GMT etag: - - '"0x8DBD086D52A144A"' + - '"0x8DC17CDA6AD8A02"' last-modified: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:01 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - '2022-11-02' status: @@ -140,7 +140,7 @@ interactions: - request: body: ' - policy0000052023-10-19T10:36:00Zracwdxyltfmei' + policy0000052024-01-18T03:31:00Zracwdxyltfmei' headers: Accept: - application/xml @@ -157,10 +157,11 @@ interactions: ParameterSetName: - -c -n --expiry --permissions --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-blob-public-access: + - blob x-ms-date: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:02 GMT x-ms-version: - '2022-11-02' method: PUT @@ -172,11 +173,11 @@ interactions: content-length: - '0' date: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:02 GMT etag: - - '"0x8DBD086D57AD4DE"' + - '"0x8DC17CDA77FDDBE"' last-modified: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:02 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: @@ -198,30 +199,31 @@ interactions: ParameterSetName: - -c --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:03 GMT x-ms-version: - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: body: - string: "\uFEFFpolicy0000052023-10-19T10:36:00.0000000Zracwdxyltfmei" + string: "\uFEFFpolicy0000052024-01-18T03:31:00.0000000Zracwdxyltfmei" headers: content-type: - application/xml date: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:03 GMT etag: - - '"0x8DBD086D57AD4DE"' + - '"0x8DC17CDA77FDDBE"' last-modified: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:02 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - '2022-11-02' status: @@ -241,30 +243,31 @@ interactions: ParameterSetName: - -c -n --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Thu, 19 Oct 2023 09:36:13 GMT + - Thu, 18 Jan 2024 02:32:04 GMT x-ms-version: - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: body: - string: "\uFEFFpolicy0000052023-10-19T10:36:00.0000000Zracwdxyltfmei" + string: "\uFEFFpolicy0000052024-01-18T03:31:00.0000000Zracwdxyltfmei" headers: content-type: - application/xml date: - - Thu, 19 Oct 2023 09:36:13 GMT + - Thu, 18 Jan 2024 02:32:04 GMT etag: - - '"0x8DBD086D57AD4DE"' + - '"0x8DC17CDA77FDDBE"' last-modified: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:02 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - '2022-11-02' status: @@ -290,12 +293,11 @@ interactions: ParameterSetName: - -n -c -f --sas-token --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-blob-type: - BlockBlob x-ms-date: - - Thu, 19 Oct 2023 09:36:13 GMT + - Thu, 18 Jan 2024 02:32:05 GMT x-ms-version: - '2022-11-02' method: PUT @@ -309,11 +311,11 @@ interactions: content-md5: - DfvoqkwgtS4bi/PLbL3xkw== date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:06 GMT etag: - - '"0x8DBD086D64A9BC4"' + - '"0x8DC17CDAA35CE18"' last-modified: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:07 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-content-crc64: @@ -339,30 +341,31 @@ interactions: ParameterSetName: - -c -n --permissions --start --expiry --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:07 GMT x-ms-version: - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: body: - string: "\uFEFFpolicy0000052023-10-19T10:36:00.0000000Zracwdxyltfmei" + string: "\uFEFFpolicy0000052024-01-18T03:31:00.0000000Zracwdxyltfmei" headers: content-type: - application/xml date: - - Thu, 19 Oct 2023 09:36:13 GMT + - Thu, 18 Jan 2024 02:32:07 GMT etag: - - '"0x8DBD086D57AD4DE"' + - '"0x8DC17CDA77FDDBE"' last-modified: - - Thu, 19 Oct 2023 09:36:12 GMT + - Thu, 18 Jan 2024 02:32:02 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - '2022-11-02' status: @@ -371,7 +374,7 @@ interactions: - request: body: ' - policy0000052023-10-19T08:36:00Z2023-10-19T10:36:00Zrwdxl' + policy0000052024-01-18T01:32:00Z2024-01-18T03:32:00Zrwdxl' headers: Accept: - application/xml @@ -388,10 +391,11 @@ interactions: ParameterSetName: - -c -n --permissions --start --expiry --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-blob-public-access: + - blob x-ms-date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:08 GMT x-ms-version: - '2022-11-02' method: PUT @@ -403,11 +407,11 @@ interactions: content-length: - '0' date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:08 GMT etag: - - '"0x8DBD086D68BCEE8"' + - '"0x8DC17CDAB08A8FB"' last-modified: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:08 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-version: @@ -429,30 +433,31 @@ interactions: ParameterSetName: - -c -n --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:08 GMT x-ms-version: - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: body: - string: "\uFEFFpolicy0000052023-10-19T08:36:00.0000000Z2023-10-19T10:36:00.0000000Zrwdxl" + string: "\uFEFFpolicy0000052024-01-18T01:32:00.0000000Z2024-01-18T03:32:00.0000000Zrwdxl" headers: content-type: - application/xml date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:08 GMT etag: - - '"0x8DBD086D68BCEE8"' + - '"0x8DC17CDAB08A8FB"' last-modified: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:08 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - '2022-11-02' status: @@ -472,30 +477,31 @@ interactions: ParameterSetName: - -c -n --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Thu, 19 Oct 2023 09:36:15 GMT + - Thu, 18 Jan 2024 02:32:10 GMT x-ms-version: - '2022-11-02' method: GET uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container&comp=acl response: body: - string: "\uFEFFpolicy0000052023-10-19T08:36:00.0000000Z2023-10-19T10:36:00.0000000Zrwdxl" + string: "\uFEFFpolicy0000052024-01-18T01:32:00.0000000Z2024-01-18T03:32:00.0000000Zrwdxl" headers: content-type: - application/xml date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:10 GMT etag: - - '"0x8DBD086D68BCEE8"' + - '"0x8DC17CDAB08A8FB"' last-modified: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:08 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - '2022-11-02' status: @@ -519,10 +525,11 @@ interactions: ParameterSetName: - -c -n --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-blob-public-access: + - blob x-ms-date: - - Thu, 19 Oct 2023 09:36:15 GMT + - Thu, 18 Jan 2024 02:32:11 GMT x-ms-version: - '2022-11-02' method: PUT @@ -534,13 +541,69 @@ interactions: content-length: - '0' date: - - Thu, 19 Oct 2023 09:36:14 GMT + - Thu, 18 Jan 2024 02:32:10 GMT + etag: + - '"0x8DC17CDAC932EBE"' + last-modified: + - Thu, 18 Jan 2024 02:32:11 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container show + Connection: + - keep-alive + ParameterSetName: + - -n --account-name --account-key + User-Agent: + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) + x-ms-date: + - Thu, 18 Jan 2024 02:32:11 GMT + x-ms-version: + - '2022-11-02' + method: GET + uri: https://clitest000002.blob.core.windows.net/cont000003?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 18 Jan 2024 02:32:11 GMT etag: - - '"0x8DBD086D715F956"' + - '"0x8DC17CDAC932EBE"' last-modified: - - Thu, 19 Oct 2023 09:36:15 GMT + - Thu, 18 Jan 2024 02:32:11 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-public-access: + - blob + x-ms-default-encryption-scope: + - $account-encryption-key + x-ms-deny-encryption-scope-override: + - 'false' + x-ms-has-immutability-policy: + - 'false' + x-ms-has-legal-hold: + - 'false' + x-ms-immutable-storage-with-versioning-enabled: + - 'false' + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked x-ms-version: - '2022-11-02' status: @@ -560,10 +623,9 @@ interactions: ParameterSetName: - -c --account-name --account-key User-Agent: - - AZURECLI/2.53.0 azsdk-python-storage-blob/12.16.0 Python/3.10.13 (Linux-5.15.0-1047-azure-x86_64-with-glibc2.31) - VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_220_0 + - AZURECLI/2.56.0 (PIP) azsdk-python-storage-blob/12.16.0 Python/3.9.13 (Windows-10-10.0.19045-SP0) x-ms-date: - - Thu, 19 Oct 2023 09:36:15 GMT + - Thu, 18 Jan 2024 02:32:12 GMT x-ms-version: - '2022-11-02' method: GET @@ -576,15 +638,17 @@ interactions: content-type: - application/xml date: - - Thu, 19 Oct 2023 09:36:15 GMT + - Thu, 18 Jan 2024 02:32:13 GMT etag: - - '"0x8DBD086D715F956"' + - '"0x8DC17CDAC932EBE"' last-modified: - - Thu, 19 Oct 2023 09:36:15 GMT + - Thu, 18 Jan 2024 02:32:11 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: - chunked + x-ms-blob-public-access: + - blob x-ms-version: - '2022-11-02' status: diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py index 0365e2a65f7..4d759e337fa 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py @@ -274,6 +274,20 @@ def test_storage_blob_container_operations(self, resource_group, storage_account self.storage_cmd('storage container show-permission -n {}', account_info, c) \ .assert_with_checks(JMESPathCheck('publicAccess', 'off')) + # test case with access policy set + from datetime import datetime, timedelta + expiry = (datetime.utcnow() + timedelta(hours=1)).strftime('%Y-%m-%dT%H:%MZ') + policy = self.create_random_name('policy', 16) + self.storage_cmd('storage container policy create -c {} -n {} --expiry {} --permissions racwdxyltfmei', + account_info, c, policy, expiry) + self.storage_cmd('storage container set-permission -n {} --public-access blob', + account_info, c) + self.storage_cmd('storage container show-permission -n {}', account_info, c) \ + .assert_with_checks(JMESPathCheck('publicAccess', 'blob')) + self.storage_cmd('storage container policy list -c {} ', account_info, c) \ + .assert_with_checks(JMESPathCheckExists('{}.expiry'.format(policy)), + JMESPathCheck('{}.permission'.format(policy), 'racwdxyltfmei')) + self.storage_cmd('storage container show -n {}', account_info, c) \ .assert_with_checks(JMESPathCheck('name', c)) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_access_policy.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_access_policy.py index a9387eb5eb0..6d2d657020c 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_access_policy.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_access_policy.py @@ -12,12 +12,13 @@ class StorageSASScenario(StorageScenarioMixin, ScenarioTest): @ResourceGroupPreparer() - @StorageAccountPreparer() + @StorageAccountPreparer(allow_blob_public_access=True) def test_storage_container_access_policy_scenario(self, resource_group, storage_account): expiry = (datetime.utcnow() + timedelta(hours=1)).strftime('%Y-%m-%dT%H:%MZ') account_info = self.get_account_info(resource_group, storage_account) - container = self.create_container(account_info) + container = self.create_random_name(prefix='cont', length=24) + self.storage_cmd('storage container create -n {} --public-access blob', account_info, container) local_file = self.create_temp_file(128, full_random=False) blob_name = self.create_random_name('blob', 16) policy = self.create_random_name('policy', 16) @@ -48,6 +49,8 @@ def test_storage_container_access_policy_scenario(self, resource_group, storage_ .assert_with_checks(JMESPathCheckExists('expiry'), JMESPathCheck('permission', 'rwdxl')) self.storage_cmd('storage container policy delete -c {} -n {} ', account_info, container, policy) + self.storage_cmd('storage container show -n {}', account_info, container)\ + .assert_with_checks(JMESPathCheck('properties.publicAccess', 'blob')) self.storage_cmd('storage container policy list -c {} ', account_info, container) \ .assert_with_checks(NoneCheck())