diff --git a/src/azure-cli/azure/cli/command_modules/storage/_client_factory.py b/src/azure-cli/azure/cli/command_modules/storage/_client_factory.py index 7c4e30cb7ae..9a2f918389d 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/storage/_client_factory.py @@ -165,3 +165,11 @@ def cf_mgmt_file_shares(cli_ctx, _): def cf_blob_data_gen_update(cli_ctx, kwargs): return blob_data_service_factory(cli_ctx, kwargs.copy()) + + +def cf_private_link(cli_ctx, _): + return storage_client_factory(cli_ctx).private_link_resources + + +def cf_private_endpoint(cli_ctx, _): + return storage_client_factory(cli_ctx).private_endpoint_connections diff --git a/src/azure-cli/azure/cli/command_modules/storage/_help.py b/src/azure-cli/azure/cli/command_modules/storage/_help.py index 39b5f1377e2..d4d1c76fd99 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/_help.py +++ b/src/azure-cli/azure/cli/command_modules/storage/_help.py @@ -206,6 +206,105 @@ crafted: true """ +helps['storage account private-endpoint-connection'] = """ +type: group +short-summary: Manage storage account private endpoint connection. +""" + +helps['storage account private-endpoint-connection approve'] = """ +type: command +short-summary: Approve a private endpoint connection request for storage account. +examples: + - name: Approve a private endpoint connection request for storage account by ID. + text: | + az storage account private-endpoint-connection approve --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c" + - name: Approve a private endpoint connection request for storage account by ID. + text: | + id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id") + az storage account private-endpoint-connection approve --id $id + - name: Approve a private endpoint connection request for storage account using account name and connection name. + text: | + az storage account private-endpoint-connection approve -g myRg --account-name mystorageaccount --name myconnection + - name: Approve a private endpoint connection request for storage account using account name and connection name. + text: | + name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name") + az storage account private-endpoint-connection approve -g myRg --account-name mystorageaccount --name $name +""" + +helps['storage account private-endpoint-connection delete'] = """ +type: command +short-summary: Delete a private endpoint connection request for storage account. +examples: + - name: Delete a private endpoint connection request for storage account by ID. + text: | + az storage account private-endpoint-connection delete --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c" + - name: Delete a private endpoint connection request for storage account by ID. + text: | + id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id") + az storage account private-endpoint-connection delete --id $id + - name: Delete a private endpoint connection request for storage account using account name and connection name. + text: | + az storage account private-endpoint-connection delete -g myRg --account-name mystorageaccount --name myconnection + - name: Delete a private endpoint connection request for storage account using account name and connection name. + text: | + name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name") + az storage account private-endpoint-connection delete -g myRg --account-name mystorageaccount --name $name +""" + +helps['storage account private-endpoint-connection reject'] = """ +type: command +short-summary: Reject a private endpoint connection request for storage account. +examples: + - name: Reject a private endpoint connection request for storage account by ID. + text: | + az storage account private-endpoint-connection reject --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c" + - name: Reject a private endpoint connection request for storage account by ID. + text: | + id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id") + az storage account private-endpoint-connection reject --id $id + - name: Reject a private endpoint connection request for storage account using account name and connection name. + text: | + az storage account private-endpoint-connection reject -g myRg --account-name mystorageaccount --name myconnection + - name: Reject a private endpoint connection request for storage account using account name and connection name. + text: | + name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name") + az storage account private-endpoint-connection reject -g myRg --account-name mystorageaccount --name $name +""" + +helps['storage account private-endpoint-connection show'] = """ +type: command +short-summary: Show details of a private endpoint connection request for storage account. +examples: + - name: Show details of a private endpoint connection request for storage account by ID. + text: | + az storage account private-endpoint-connection show --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c" + - name: Show details of a private endpoint connection request for storage account by ID. + text: | + id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id") + az storage account private-endpoint-connection show --id $id + - name: Show details of a private endpoint connection request for storage account using account name and connection name. + text: | + az storage account private-endpoint-connection show -g myRg --account-name mystorageaccount --name myconnection + - name: Show details of a private endpoint connection request for storage account using account name and connection name. + text: | + name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name") + az storage account private-endpoint-connection show -g myRg --account-name mystorageaccount --name $name +""" + +helps['storage account private-link-resource'] = """ +type: group +short-summary: Manage storage account private link resources. +""" + +helps['storage account private-link-resource list'] = """ +type: command +short-summary: Get the private link resources that need to be created for a storage account. +examples: + - name: Get the private link resources that need to be created for a storage account. + text: | + az storage account private-link-resource list --account-name mystorageaccount -g MyResourceGroup +""" + helps['storage account revoke-delegation-keys'] = """ type: command short-summary: Revoke all user delegation keys for a storage account. diff --git a/src/azure-cli/azure/cli/command_modules/storage/_params.py b/src/azure-cli/azure/cli/command_modules/storage/_params.py index 85b9046119f..c821ceefe5c 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/_params.py +++ b/src/azure-cli/azure/cli/command_modules/storage/_params.py @@ -18,7 +18,7 @@ validate_azcopy_remove_arguments, as_user_validator, parse_storage_account) -def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statements +def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statements, too-many-lines from argcomplete.completers import FilesCompleter from six import u as unicode_string @@ -204,6 +204,23 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem c.argument('publish_microsoft_endpoints', publish_microsoft_endpoints_type) c.argument('publish_internet_endpoints', publish_internet_endpoints_type) + with self.argument_context('storage account private-endpoint-connection', + resource_type=ResourceType.MGMT_STORAGE) as c: + c.argument('private_endpoint_connection_name', options_list=['--name', '-n'], + help='The name of the private endpoint connection associated with the Storage Account.') + for item in ['approve', 'reject', 'show', 'delete']: + with self.argument_context('storage account private-endpoint-connection {}'.format(item), + resource_type=ResourceType.MGMT_STORAGE) as c: + c.argument('private_endpoint_connection_name', options_list=['--name', '-n'], required=False, + help='The name of the private endpoint connection associated with the Storage Account.') + c.extra('connection_id', options_list=['--id'], + help='The ID of the private endpoint connection associated with the Storage Account. You can get ' + 'it using `az storage account show`.') + c.argument('account_name', help='The storage account name.', required=False) + c.argument('resource_group_name', help='The resource group name of specified storage account.', + required=False) + c.argument('description', help='Comments for {} operation.'.format(item)) + with self.argument_context('storage account update', resource_type=ResourceType.MGMT_STORAGE) as c: c.register_common_storage_account_options() c.argument('custom_domain', diff --git a/src/azure-cli/azure/cli/command_modules/storage/_validators.py b/src/azure-cli/azure/cli/command_modules/storage/_validators.py index 1ea16360db7..deac9150ebd 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/_validators.py +++ b/src/azure-cli/azure/cli/command_modules/storage/_validators.py @@ -5,6 +5,9 @@ # pylint: disable=protected-access +from knack.util import CLIError +from knack.log import get_logger + from azure.cli.core.commands.validators import validate_key_value_pairs from azure.cli.core.profiles import ResourceType, get_sdk @@ -16,7 +19,6 @@ from azure.cli.command_modules.storage.sdkutil import get_table_data_type from azure.cli.command_modules.storage.url_quote_util import encode_for_url from azure.cli.command_modules.storage.oauth_token_util import TokenUpdater -from knack.log import get_logger storage_account_key_options = {'primary': 'key1', 'secondary': 'key2'} logger = get_logger(__name__) @@ -792,7 +794,6 @@ def process_blob_upload_batch_parameters(cmd, namespace): namespace.blob_type = 'page' elif any(vhd_files): # source files contain vhd files but not all of them - from knack.util import CLIError raise CLIError("""Fail to guess the required blob type. Type of the files to be uploaded are not consistent. Default blob type for .vhd files is "page", while others are "block". You can solve this problem by either explicitly set the blob @@ -939,7 +940,6 @@ def validate_subnet(cmd, namespace): child_type_1='subnets', child_name_1=subnet) else: - from knack.util import CLIError raise CLIError('incorrect usage: [--subnet ID | --subnet NAME --vnet-name NAME]') @@ -1159,3 +1159,20 @@ def validator_delete_retention_days(namespace): if namespace.delete_retention_days > 365: raise ValueError( "incorrect usage: '--delete-retention-days' must be less than or equal to 365") + + +def validate_private_endpoint_connection_id(cmd, namespace): + if namespace.connection_id: + from azure.cli.core.util import parse_proxy_resource_id + result = parse_proxy_resource_id(namespace.connection_id) + namespace.resource_group_name = result['resource_group'] + namespace.account_name = result['name'] + namespace.private_endpoint_connection_name = result['child_name_1'] + + if namespace.account_name and not namespace.resource_group_name: + namespace.resource_group_name = _query_account_rg(cmd.cli_ctx, namespace.account_name)[0] + + if not all([namespace.account_name, namespace.resource_group_name, namespace.private_endpoint_connection_name]): + raise CLIError('incorrect usage: [--id ID | --name NAME --account-name NAME]') + + del namespace.connection_id 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 023ebb62669..22da8dfdaba 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/commands.py +++ b/src/azure-cli/azure/cli/command_modules/storage/commands.py @@ -10,7 +10,8 @@ multi_service_properties_factory, cf_mgmt_policy, cf_blob_data_gen_update, cf_sa_for_keys, - cf_mgmt_blob_services, cf_mgmt_file_shares) + cf_mgmt_blob_services, cf_mgmt_file_shares, + cf_private_link, cf_private_endpoint) from azure.cli.command_modules.storage.sdkutil import cosmosdb_table_exists from azure.cli.command_modules.storage._format import transform_immutability_policy from azure.cli.core.commands import CliCommandType @@ -43,6 +44,23 @@ def load_command_table(self, _): # pylint: disable=too-many-locals, too-many-st resource_type=ResourceType.MGMT_STORAGE ) + private_link_resource_sdk = CliCommandType( + operations_tmpl='azure.mgmt.storage.operations#PrivateLinkResourcesOperations.{}', + client_factory=cf_private_link, + resource_type=ResourceType.MGMT_STORAGE + ) + + private_endpoint_sdk = CliCommandType( + operations_tmpl='azure.mgmt.storage.operations#PrivateEndpointConnectionsOperations.{}', + client_factory=cf_private_endpoint, + resource_type=ResourceType.MGMT_STORAGE + ) + + private_endpoint_custom_type = CliCommandType( + operations_tmpl='azure.cli.command_modules.storage.operations.account#{}', + client_factory=cf_private_endpoint, + resource_type=ResourceType.MGMT_STORAGE) + storage_account_custom_type = CliCommandType( operations_tmpl='azure.cli.command_modules.storage.operations.account#{}', client_factory=cf_sa) @@ -129,6 +147,23 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT g.custom_command('list', 'list_network_rules') g.custom_command('remove', 'remove_network_rule') + with self.command_group('storage account private-endpoint-connection', private_endpoint_sdk, + custom_command_type=private_endpoint_custom_type, is_preview=True, + resource_type=ResourceType.MGMT_STORAGE, min_api='2019-06-01') as g: + from ._validators import validate_private_endpoint_connection_id + g.command('delete', 'delete', confirmation=True, validator=validate_private_endpoint_connection_id) + g.command('show', 'get', validator=validate_private_endpoint_connection_id) + g.custom_command('approve', 'approve_private_endpoint_connection', + validator=validate_private_endpoint_connection_id) + g.custom_command('reject', 'reject_private_endpoint_connection', + validator=validate_private_endpoint_connection_id) + + with self.command_group('storage account private-link-resource', private_link_resource_sdk, + resource_type=ResourceType.MGMT_STORAGE) as g: + from azure.cli.core.commands.transform import gen_dict_to_list_transform + g.command('list', 'list_by_storage_account', is_preview=True, min_api='2019-06-01', + transform=gen_dict_to_list_transform(key="value")) + with self.command_group('storage account blob-service-properties', blob_service_mgmt_sdk, custom_command_type=storage_account_custom_type, resource_type=ResourceType.MGMT_STORAGE, min_api='2018-07-01', is_preview=True) as g: diff --git a/src/azure-cli/azure/cli/command_modules/storage/operations/account.py b/src/azure-cli/azure/cli/command_modules/storage/operations/account.py index d3675aab086..7254abf7e26 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/operations/account.py +++ b/src/azure-cli/azure/cli/command_modules/storage/operations/account.py @@ -366,6 +366,51 @@ def remove_network_rule(cmd, client, resource_group_name, account_name, ip_addre return client.update(resource_group_name, account_name, params) +def _update_private_endpoint_connection_status(cmd, client, resource_group_name, account_name, + private_endpoint_connection_name, is_approved=True, description=None): + + PrivateEndpointServiceConnectionStatus, ErrorResponseException = \ + cmd.get_models('PrivateEndpointServiceConnectionStatus', 'ErrorResponseException') + + private_endpoint_connection = client.get(resource_group_name=resource_group_name, account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name) + + old_status = private_endpoint_connection.private_link_service_connection_state.status + new_status = PrivateEndpointServiceConnectionStatus.approved \ + if is_approved else PrivateEndpointServiceConnectionStatus.rejected + private_endpoint_connection.private_link_service_connection_state.status = new_status + private_endpoint_connection.private_link_service_connection_state.description = description + try: + return client.put(resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=private_endpoint_connection) + except ErrorResponseException as ex: + if ex.response.status_code == 400: + from msrestazure.azure_exceptions import CloudError + if new_status == "Approved" and old_status == "Rejected": + raise CloudError(ex.response, "You cannot approve the connection request after rejection. " + "Please create a new connection for approval.") + raise ex + + +def approve_private_endpoint_connection(cmd, client, resource_group_name, account_name, + private_endpoint_connection_name, description=None): + + return _update_private_endpoint_connection_status( + cmd, client, resource_group_name=resource_group_name, account_name=account_name, is_approved=True, + private_endpoint_connection_name=private_endpoint_connection_name, description=description + ) + + +def reject_private_endpoint_connection(cmd, client, resource_group_name, account_name, private_endpoint_connection_name, + description=None): + return _update_private_endpoint_connection_status( + cmd, client, resource_group_name=resource_group_name, account_name=account_name, is_approved=False, + private_endpoint_connection_name=private_endpoint_connection_name, description=description + ) + + def create_management_policies(client, resource_group_name, account_name, policy=None): if policy: if os.path.exists(policy): diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_account_private_endpoint.yaml b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_account_private_endpoint.yaml new file mode 100644 index 00000000000..965a27a9d35 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_account_private_endpoint.yaml @@ -0,0 +1,1436 @@ +interactions: +- request: + body: '{"location": "centraluseuap", "tags": {}, "properties": {"addressSpace": + {"addressPrefixes": ["10.0.0.0/16"]}, "dhcpOptions": {}, "subnets": [{"properties": + {"addressPrefix": "10.0.0.0/24"}, "name": "cli-subnet-000004"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + Content-Length: + - '229' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003?api-version=2019-11-01 + response: + body: + string: "{\r\n \"name\": \"cli-vnet-000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003\",\r\n + \ \"etag\": \"W/\\\"85176d2c-9767-4222-b483-fcc0074dd45e\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"centraluseuap\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"a26c84ff-1b04-4532-81cb-190480ed231b\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"cli-subnet-000004\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004\",\r\n + \ \"etag\": \"W/\\\"85176d2c-9767-4222-b483-fcc0074dd45e\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false,\r\n \"enableVmProtection\": false\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/8acf5952-044e-4fcb-bd3c-8e743b61cb3e?api-version=2019-11-01 + cache-control: + - no-cache + content-length: + - '1535' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:08:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 2a14eb56-656f-47fd-ae2c-66520885c0a5 + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/8acf5952-044e-4fcb-bd3c-8e743b61cb3e?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:08:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 2e046084-94a5-4b30-9a35-03e5d7c0a44e + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l --subnet-name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003?api-version=2019-11-01 + response: + body: + string: "{\r\n \"name\": \"cli-vnet-000003\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003\",\r\n + \ \"etag\": \"W/\\\"9cdd74fb-887a-400c-92f0-ce1cd3eb9e1e\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"centraluseuap\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"a26c84ff-1b04-4532-81cb-190480ed231b\",\r\n \"addressSpace\": + {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n + \ },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": []\r\n },\r\n + \ \"subnets\": [\r\n {\r\n \"name\": \"cli-subnet-000004\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004\",\r\n + \ \"etag\": \"W/\\\"9cdd74fb-887a-400c-92f0-ce1cd3eb9e1e\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": + [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": + \"Enabled\"\r\n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n + \ }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": + false,\r\n \"enableVmProtection\": false\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1537' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:08:46 GMT + etag: + - W/"9cdd74fb-887a-400c-92f0-ce1cd3eb9e1e" + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 09e6f9ce-1b07-49e9-aec9-3faa8870aa3d + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004?api-version=2019-11-01 + response: + body: + string: "{\r\n \"name\": \"cli-subnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004\",\r\n + \ \"etag\": \"W/\\\"9cdd74fb-887a-400c-92f0-ce1cd3eb9e1e\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:08:48 GMT + etag: + - W/"9cdd74fb-887a-400c-92f0-ce1cd3eb9e1e" + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 2db0606d-6edc-40a1-bc2f-0e94b20d22d5 + status: + code: 200 + message: OK +- request: + body: 'b''{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004", + "properties": {"addressPrefix": "10.0.0.0/24", "delegations": [], "privateEndpointNetworkPolicies": + "Disabled", "privateLinkServiceNetworkPolicies": "Enabled"}, "name": "cli-subnet-000004"}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + Content-Length: + - '451' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004?api-version=2019-11-01 + response: + body: + string: "{\r\n \"name\": \"cli-subnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004\",\r\n + \ \"etag\": \"W/\\\"e784f086-6dd7-4a24-a7bf-5d05c82932dc\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/00599a78-e32d-4839-a77f-bd6ed4b1e0dd?api-version=2019-11-01 + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:08:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - b642c2bf-0803-46d8-bae3-86e765092c04 + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/00599a78-e32d-4839-a77f-bd6ed4b1e0dd?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:08:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 24f8cdbb-12f0-4711-ae4c-a1a5b604dcab + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network vnet subnet update + Connection: + - keep-alive + ParameterSetName: + - -n --vnet-name -g --disable-private-endpoint-network-policies + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004?api-version=2019-11-01 + response: + body: + string: "{\r\n \"name\": \"cli-subnet-000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004\",\r\n + \ \"etag\": \"W/\\\"0c91cf45-e8be-4edc-92bb-fb510cef7a86\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '640' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:08:52 GMT + etag: + - W/"0c91cf45-e8be-4edc-92bb-fb510cef7a86" + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 035d8bdd-39e0-4c08-9b6b-4b2845740f56 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-link-resource list + Connection: + - keep-alive + ParameterSetName: + - --account-name -g + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources?api-version=2019-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/blob","name":"blob","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"blob","requiredMembers":["blob"],"requiredZoneNames":["privatelink.blob.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/table","name":"table","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"table","requiredMembers":["table"],"requiredZoneNames":["privatelink.table.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/queue","name":"queue","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"queue","requiredMembers":["queue"],"requiredZoneNames":["privatelink.queue.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/file","name":"file","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"file","requiredMembers":["file"],"requiredZoneNames":["privatelink.file.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/web","name":"web","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"web","requiredMembers":["web"],"requiredZoneNames":["privatelink.web.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/dfs","name":"dfs","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"dfs","requiredMembers":["dfs"],"requiredZoneNames":["privatelink.dfs.core.windows.net"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '2663' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:08:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002","name":"saplr000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T10:08:15.6448370Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T10:08:15.6448370Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-02T10:08:15.5667069Z","primaryEndpoints":{"dfs":"https://saplr000002.dfs.core.windows.net/","web":"https://saplr000002.z22.web.core.windows.net/","blob":"https://saplr000002.blob.core.windows.net/","queue":"https://saplr000002.queue.core.windows.net/","table":"https://saplr000002.table.core.windows.net/","file":"https://saplr000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}' + headers: + cache-control: + - no-cache + content-length: + - '1391' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:08:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"location": "centraluseuap", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004"}, + "privateLinkServiceConnections": [{"properties": {"privateLinkServiceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002", + "groupIds": ["blob"]}, "name": "cli-pec-000006"}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + Content-Length: + - '661' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005?api-version=2019-11-01 + response: + body: + string: "{\r\n \"name\": \"cli-pe-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005\",\r\n + \ \"etag\": \"W/\\\"8bcb162b-a036-4b3a-8bf1-bce4236adf30\\\"\",\r\n \"type\": + \"Microsoft.Network/privateEndpoints\",\r\n \"location\": \"centraluseuap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": + \"3484f1e7-fd69-4d53-bb1b-47195c8aea6a\",\r\n \"privateLinkServiceConnections\": + [\r\n {\r\n \"name\": \"cli-pec-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005/privateLinkServiceConnections/cli-pec-000006\",\r\n + \ \"etag\": \"W/\\\"8bcb162b-a036-4b3a-8bf1-bce4236adf30\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateLinkServiceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002\",\r\n + \ \"groupIds\": [\r\n \"blob\"\r\n ],\r\n \"privateLinkServiceConnectionState\": + {\r\n \"status\": \"Approved\",\r\n \"description\": + \"\",\r\n \"actionsRequired\": \"None\"\r\n }\r\n },\r\n + \ \"type\": \"Microsoft.Network/privateEndpoints/privateLinkServiceConnections\"\r\n + \ }\r\n ],\r\n \"manualPrivateLinkServiceConnections\": [],\r\n + \ \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004\"\r\n + \ },\r\n \"networkInterfaces\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/networkInterfaces/cli-pe-000005.nic.ccc8b180-c973-4b5e-ba05-d6538417e36d\"\r\n + \ }\r\n ]\r\n }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/d56a06aa-24a4-47b6-b846-1598d167a958?api-version=2019-11-01 + cache-control: + - no-cache + content-length: + - '2291' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:09:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 1bf2c35c-f185-4ee1-866c-34f06f155b8e + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/d56a06aa-24a4-47b6-b846-1598d167a958?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:09:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 3a51f61a-2a9f-4438-a9b8-19a1e330ce74 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/d56a06aa-24a4-47b6-b846-1598d167a958?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:09:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 8ff89836-1bbe-4b90-8311-ae03f61e06d2 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/d56a06aa-24a4-47b6-b846-1598d167a958?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:09:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 61d3a40f-0a9a-4ce1-965a-9ef5948abb22 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/d56a06aa-24a4-47b6-b846-1598d167a958?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:09:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - debb60f6-5c11-4270-841e-b7d8fae526e9 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/d56a06aa-24a4-47b6-b846-1598d167a958?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"InProgress\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '30' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:09:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - d6a80926-4202-4855-97fb-cad16d543900 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/centraluseuap/operations/d56a06aa-24a4-47b6-b846-1598d167a958?api-version=2019-11-01 + response: + body: + string: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '29' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:10:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 0abc5e66-5143-4adc-a002-01c65517496c + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network private-endpoint create + Connection: + - keep-alive + ParameterSetName: + - -g -n --vnet-name --subnet -l --connection-name --private-connection-resource-id + --group-ids + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005?api-version=2019-11-01 + response: + body: + string: "{\r\n \"name\": \"cli-pe-000005\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005\",\r\n + \ \"etag\": \"W/\\\"569ba2bb-5bb8-4ca1-9b27-38c55a0862b0\\\"\",\r\n \"type\": + \"Microsoft.Network/privateEndpoints\",\r\n \"location\": \"centraluseuap\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": + \"3484f1e7-fd69-4d53-bb1b-47195c8aea6a\",\r\n \"privateLinkServiceConnections\": + [\r\n {\r\n \"name\": \"cli-pec-000006\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005/privateLinkServiceConnections/cli-pec-000006\",\r\n + \ \"etag\": \"W/\\\"569ba2bb-5bb8-4ca1-9b27-38c55a0862b0\\\"\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateLinkServiceId\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002\",\r\n + \ \"groupIds\": [\r\n \"blob\"\r\n ],\r\n \"privateLinkServiceConnectionState\": + {\r\n \"status\": \"Approved\",\r\n \"description\": + \"Auto-Approved\",\r\n \"actionsRequired\": \"None\"\r\n }\r\n + \ },\r\n \"type\": \"Microsoft.Network/privateEndpoints/privateLinkServiceConnections\"\r\n + \ }\r\n ],\r\n \"manualPrivateLinkServiceConnections\": [],\r\n + \ \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/virtualNetworks/cli-vnet-000003/subnets/cli-subnet-000004\"\r\n + \ },\r\n \"networkInterfaces\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/networkInterfaces/cli-pe-000005.nic.ccc8b180-c973-4b5e-ba05-d6538417e36d\"\r\n + \ }\r\n ]\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2305' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:10:08 GMT + etag: + - W/"569ba2bb-5bb8-4ca1-9b27-38c55a0862b0" + expires: + - '-1' + pragma: + - no-cache + server: + - 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-arm-service-request-id: + - 36ff6c66-3354-43a4-8de2-277c78d00a86 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002","name":"saplr000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","name":"saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","type":"Microsoft.Storage/storageAccounts/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-Approved","actionRequired":"None"}}}],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T10:08:15.6448370Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T10:08:15.6448370Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-02T10:08:15.5667069Z","primaryEndpoints":{"dfs":"https://saplr000002.dfs.core.windows.net/","web":"https://saplr000002.z22.web.core.windows.net/","blob":"https://saplr000002.blob.core.windows.net/","queue":"https://saplr000002.queue.core.windows.net/","table":"https://saplr000002.table.core.windows.net/","file":"https://saplr000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}' + headers: + cache-control: + - no-cache + content-length: + - '2240' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection show + Connection: + - keep-alive + ParameterSetName: + - --account-name -g --name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","name":"saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","type":"Microsoft.Storage/storageAccounts/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-Approved","actionRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '849' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection approve + Connection: + - keep-alive + ParameterSetName: + - --account-name -g --name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","name":"saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","type":"Microsoft.Storage/storageAccounts/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-Approved","actionRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '849' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"privateEndpoint": {}, "privateLinkServiceConnectionState": + {"status": "Approved", "actionRequired": "None"}, "provisioningState": "Succeeded"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection approve + Connection: + - keep-alive + Content-Length: + - '160' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --account-name -g --name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","name":"saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","type":"Microsoft.Storage/storageAccounts/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-Approved","actionRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '849' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-ratelimit-remaining-subscription-writes: + - '1194' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection reject + Connection: + - keep-alive + ParameterSetName: + - --account-name -g --name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","name":"saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","type":"Microsoft.Storage/storageAccounts/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-Approved","actionRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '849' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"privateEndpoint": {}, "privateLinkServiceConnectionState": + {"status": "Rejected", "actionRequired": "None"}, "provisioningState": "Succeeded"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection reject + Connection: + - keep-alive + Content-Length: + - '160' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --account-name -g --name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","privateLinkServiceConnectionState":{"status":"Rejected","description":"","actionRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '147' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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-ratelimit-remaining-subscription-writes: + - '1194' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection approve + Connection: + - keep-alive + ParameterSetName: + - --account-name -g --name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","name":"saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69","type":"Microsoft.Storage/storageAccounts/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Network/privateEndpoints/cli-pe-000005"},"privateLinkServiceConnectionState":{"status":"Rejected","description":"","actionRequired":"None"}}}' + headers: + cache-control: + - no-cache + content-length: + - '836' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"privateEndpoint": {}, "privateLinkServiceConnectionState": + {"status": "Approved", "actionRequired": "None"}, "provisioningState": "Succeeded"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection approve + Connection: + - keep-alive + Content-Length: + - '160' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --account-name -g --name + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '{"error":{"code":"InvalidValuesForRequestParameters","message":"Values + for request parameters are invalid: privateLinkServiceConnectionState.status."}}' + headers: + cache-control: + - no-cache + content-length: + - '151' + content-type: + - application/json + date: + - Mon, 02 Mar 2020 10:10:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-endpoint-connection delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --id -y + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.2.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_pe000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateEndpointConnections/saplr000002.fb2808e3-9397-4b2b-bdd3-80b54d3cfa69?api-version=2019-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Mon, 02 Mar 2020 10:10:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_account_private_link.yaml b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_account_private_link.yaml new file mode 100644 index 00000000000..1e9cf2c38c5 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_account_private_link.yaml @@ -0,0 +1,51 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account private-link-resource list + Connection: + - keep-alive + ParameterSetName: + - --account-name -g + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/8.0.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_plr000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources?api-version=2019-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_plr000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/blob","name":"blob","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"blob","requiredMembers":["blob"],"requiredZoneNames":["privatelink.blob.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_plr000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/table","name":"table","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"table","requiredMembers":["table"],"requiredZoneNames":["privatelink.table.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_plr000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/queue","name":"queue","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"queue","requiredMembers":["queue"],"requiredZoneNames":["privatelink.queue.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_plr000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/file","name":"file","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"file","requiredMembers":["file"],"requiredZoneNames":["privatelink.file.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_plr000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/web","name":"web","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"web","requiredMembers":["web"],"requiredZoneNames":["privatelink.web.core.windows.net"]}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sa_plr000001/providers/Microsoft.Storage/storageAccounts/saplr000002/privateLinkResources/dfs","name":"dfs","type":"Microsoft.Storage/storageAccounts/privateLinkResources","properties":{"groupId":"dfs","requiredMembers":["dfs"],"requiredZoneNames":["privatelink.dfs.core.windows.net"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '2663' + content-type: + - application/json + date: + - Thu, 05 Mar 2020 05:57:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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 + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py index be474329c2a..7c258616037 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py @@ -426,7 +426,6 @@ def test_storage_account_show_exit_codes(self, resource_group, storage_account): @ResourceGroupPreparer() def test_management_policy(self, resource_group): import os - from msrestazure.azure_exceptions import CloudError curr_dir = os.path.dirname(os.path.realpath(__file__)) policy_file = os.path.join(curr_dir, 'mgmt_policy.json').replace('\\', '\\\\') @@ -773,3 +772,77 @@ def test_storage_account_update_delete_retention_policy(self, resource_group, st result = self.cmd('{cmd} --enable-delete-retention false -n {sa} -g {rg}').get_output_in_json() self.assertEqual(result['deleteRetentionPolicy']['enabled'], False) self.assertEqual(result['deleteRetentionPolicy']['days'], None) + + +class StorageAccountPrivateLinkScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_sa_plr') + @StorageAccountPreparer(name_prefix='saplr', kind='StorageV2', sku='Standard_LRS') + def test_storage_account_private_link(self, storage_account): + self.kwargs.update({ + 'sa': storage_account + }) + self.cmd('storage account private-link-resource list --account-name {sa} -g {rg}', checks=[ + self.check('length(@)', 6)]) + + +class StorageAccountPrivateEndpointScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_sa_pe') + @StorageAccountPreparer(name_prefix='saplr', kind='StorageV2') + def test_storage_account_private_endpoint(self, storage_account): + from msrestazure.azure_exceptions import CloudError + self.kwargs.update({ + 'sa': storage_account, + 'loc': 'eastus', + 'vnet': self.create_random_name('cli-vnet-', 24), + 'subnet': self.create_random_name('cli-subnet-', 24), + 'pe': self.create_random_name('cli-pe-', 24), + 'pe_connection': self.create_random_name('cli-pec-', 24), + }) + + # Prepare network + self.cmd('network vnet create -n {vnet} -g {rg} -l {loc} --subnet-name {subnet}', + checks=self.check('length(newVNet.subnets)', 1)) + self.cmd('network vnet subnet update -n {subnet} --vnet-name {vnet} -g {rg} ' + '--disable-private-endpoint-network-policies true', + checks=self.check('privateEndpointNetworkPolicies', 'Disabled')) + + # Create a private endpoint connection + pr = self.cmd('storage account private-link-resource list --account-name {sa} -g {rg}').get_output_in_json() + self.kwargs['group_id'] = pr[0]['groupId'] + + storage = self.cmd('storage account show -n {sa} -g {rg}').get_output_in_json() + self.kwargs['sa_id'] = storage['id'] + private_endpoint = self.cmd( + 'network private-endpoint create -g {rg} -n {pe} --vnet-name {vnet} --subnet {subnet} -l {loc} ' + '--connection-name {pe_connection} --private-connection-resource-id {sa_id} ' + '--group-ids blob').get_output_in_json() + self.assertEqual(private_endpoint['name'], self.kwargs['pe']) + self.assertEqual(private_endpoint['privateLinkServiceConnections'][0]['name'], self.kwargs['pe_connection']) + self.assertEqual(private_endpoint['privateLinkServiceConnections'][0]['privateLinkServiceConnectionState']['status'], 'Approved') + self.assertEqual(private_endpoint['privateLinkServiceConnections'][0]['provisioningState'], 'Succeeded') + self.assertEqual(private_endpoint['privateLinkServiceConnections'][0]['groupIds'][0], self.kwargs['group_id']) + self.kwargs['pe_id'] = private_endpoint['privateLinkServiceConnections'][0]['id'] + + # Show the connection at storage account + storage = self.cmd('storage account show -n {sa} -g {rg}').get_output_in_json() + self.assertIn('privateEndpointConnections', storage) + self.assertEqual(len(storage['privateEndpointConnections']), 1) + self.assertEqual(storage['privateEndpointConnections'][0]['privateLinkServiceConnectionState']['status'], + 'Approved') + + self.kwargs['sa_pec_id'] = storage['privateEndpointConnections'][0]['id'] + self.kwargs['sa_pec_name'] = storage['privateEndpointConnections'][0]['name'] + + self.cmd('storage account private-endpoint-connection show --account-name {sa} -g {rg} --name {sa_pec_name}', + checks=self.check('id', '{sa_pec_id}')) + + self.cmd('storage account private-endpoint-connection approve --account-name {sa} -g {rg} --name {sa_pec_name}', + checks=[self.check('privateLinkServiceConnectionState.status', 'Approved')]) + + self.cmd('storage account private-endpoint-connection reject --account-name {sa} -g {rg} --name {sa_pec_name}', + checks=[self.check('privateLinkServiceConnectionState.status', 'Rejected')]) + + with self.assertRaisesRegexp(CloudError, 'You cannot approve the connection request after rejection.'): + self.cmd('storage account private-endpoint-connection approve --account-name {sa} -g {rg} --name {sa_pec_name}') + + self.cmd('storage account private-endpoint-connection delete --id {sa_pec_id} -y')