From caacd7d99b11142e65ffd0c8cdb0fc04f504829a Mon Sep 17 00:00:00 2001 From: kevinzz6 <632604666@qq.com> Date: Thu, 30 Jun 2022 14:44:29 +0800 Subject: [PATCH 1/6] add aadonly cmdlets --- .../synapse/manual/_client_factory.py | 4 ++++ .../cli/command_modules/synapse/manual/_params.py | 8 ++++++++ .../command_modules/synapse/manual/commands.py | 10 ++++++++++ .../manual/operations/adonlyauthentications.py | 15 +++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py index 9f267047591..0e4b4014dca 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py @@ -254,3 +254,7 @@ def cf_kusto_scripts(cli_ctx, workspace_name): def cf_synapse_sql_script(cli_ctx, workspace_name): return cf_synapse_client_artifacts_factory(cli_ctx, workspace_name).sql_script + + +def cf_synapse_client_azure_ad_only_authentications_factory(cli_ctx, *_): + return cf_synapse(cli_ctx).azure_ad_only_authentications \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py index ceeddc57318..c771dc5bd2a 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py @@ -1100,3 +1100,11 @@ def load_arguments(self, _): c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') c.argument('output_folder', type=str, help='The name of the output folder') c.argument('script_name', arg_type=name_type, help='The name of the KQL script.') + + for scope in ['create', 'update']: + with self.argument_context('synapse ad-only-authentications ') as c: + c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') + c.argument('resource_group_name', resource_group_name_type) + c.argument('azure_ad_only_authentication_name', arg_type=name_type, help='The name of the azure ad only authentication.') + c.argument('azure_ad_only_authentication_name', arg_type=get_three_state_flag(), + help='A boolean value that indicates if Azure Active Directory (Azure AD) only authentication are enabled.') \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py index 5fad886c042..4ca70caa117 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py @@ -32,6 +32,7 @@ def load_command_table(self, _): from ._client_factory import cf_kusto_pool from ._client_factory import cf_kusto_script from ._client_factory import cf_kusto_scripts + from ._client_factory import cf_synapse_client_azure_ad_only_authentications_factory def get_custom_sdk(custom_module, client_factory): return CliCommandType( @@ -577,3 +578,12 @@ def get_custom_sdk(custom_module, client_factory): g.custom_command('list', 'synapse_kusto_script_list', client_factory=cf_kusto_scripts) g.custom_command('export', 'synapse_kusto_script_export') g.custom_wait_command('wait', 'synapse_kusto_script_show') + + with self.command_group('synapse ad-only-authentications', command_type=synapse_sqlpool_sdk, + custom_command_type=get_custom_sdk('adonlyauthentications', cf_synapse_client_azure_ad_only_authentications_factory), + client_factory=cf_synapse_client_azure_ad_only_authentications_factory) as g: + g.custom_command('create', 'synapse_create_adonly_auth', supports_no_wait=True) + g.custom_command('update', 'synapse_create_adonly_auth', supports_no_wait=True) + g.command('list', 'list') + g.show_command('show','get') + g.wait_command('wait') diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py new file mode 100644 index 00000000000..529298197bd --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=unused-argument +from azure.cli.core.util import sdk_no_wait +from azure.mgmt.synapse.models import AzureADOnlyAuthentication + + +def synapse_create_adonly_auth(cmd, client, resource_group_name, workspace_name, azure_ad_only_authentication_name, + enable_azure_ad_only_authentication, no_wait=False): + azure_ad_only_authentication_info = AzureADOnlyAuthentication(azure_ad_only_authentication=enable_azure_ad_only_authentication) + + return sdk_no_wait(no_wait, client.begin_create, resource_group_name, workspace_name, + azure_ad_only_authentication_name, azure_ad_only_authentication_info) \ No newline at end of file From 7d8935e8dbfe5c319d0ffa15ae348a1f0d75d092 Mon Sep 17 00:00:00 2001 From: kevinzz6 <632604666@qq.com> Date: Fri, 1 Jul 2022 18:03:57 +0800 Subject: [PATCH 2/6] add ad-only-auth cmdlets --- .../command_modules/synapse/manual/_help.py | 40 ++ .../command_modules/synapse/manual/_params.py | 7 +- .../synapse/manual/commands.py | 15 +- .../operations/adonlyauthentications.py | 16 +- .../latest/recordings/test_ad_only_auth.yaml | 676 ++++++++++++++++++ .../tests/latest/test_synapse_scenario.py | 38 + 6 files changed, 777 insertions(+), 15 deletions(-) create mode 100644 src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py index cb2384b3026..6ab9754e028 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py @@ -2272,3 +2272,43 @@ --name testsqlscriptname \\ --file 'path/test.sql' """ + +helps['synapse ad-only-auth'] = """ +type: group +short-summary: Manage Azure Active Directly only Authentication settings for this Synapse workspace. +""" + +helps['synapse ad-only-auth get'] = """ +type: command +short-summary: Get a specific Azure Active Directly only Authentication property. +examples: + - name: Get a specific Azure Active Directly only Authentication property. + text: |- + az synapse ad-only-auth get --workspace-name testsynapseworkspace \\ + -g testrg +""" + +helps['synapse ad-only-auth enable'] = """ +type: command +short-summary: Enable Azure Active Directly only Authentication for this Synapse workspace. +examples: + - name: Enable Azure Active Directly only Authentication for this Synapse workspace. + text: |- + az synapse ad-only-auth enable --workspace-name testsynapseworkspace \\ + -g testresourcegroup +""" + +helps['synapse ad-only-auth disable'] = """ +type: command +short-summary: Disable Azure Active Directly only Authentication for this Synapse workspace. +examples: + - name: Disable Azure Active Directly only Authentication for this Synapse workspace. + text: |- + az synapse ad-only-auth disable --workspace-name testsynapseworkspace \\ + -g testresourcegroup +""" + +helps['synapse ad-only-auth wait'] = """ +type: command +short-summary: Place the CLI in a waiting state until a condition of a Azure ad-only-auth is met. +""" \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py index c771dc5bd2a..78df3824475 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py @@ -1101,10 +1101,7 @@ def load_arguments(self, _): c.argument('output_folder', type=str, help='The name of the output folder') c.argument('script_name', arg_type=name_type, help='The name of the KQL script.') - for scope in ['create', 'update']: - with self.argument_context('synapse ad-only-authentications ') as c: + for scope in ['enable', 'disable']: + with self.argument_context('synapse ad-only-auth ') as c: c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') c.argument('resource_group_name', resource_group_name_type) - c.argument('azure_ad_only_authentication_name', arg_type=name_type, help='The name of the azure ad only authentication.') - c.argument('azure_ad_only_authentication_name', arg_type=get_three_state_flag(), - help='A boolean value that indicates if Azure Active Directory (Azure AD) only authentication are enabled.') \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py index 4ca70caa117..9bf393fbfb4 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py @@ -208,6 +208,10 @@ def get_custom_sdk(custom_module, client_factory): client_factory=cf_kusto_script, ) + synapse_adonlyauthentications_sdk = CliCommandType( + operations_tmpl='azure.mgmt.synapse.operations#AzureADOnlyAuthenticationsOperations.{}', + client_factory=cf_synapse_client_azure_ad_only_authentications_factory, + ) # Management Plane Commands --Workspace with self.command_group('synapse workspace', command_type=synapse_workspace_sdk, custom_command_type=get_custom_sdk('workspace', cf_synapse_client_workspace_factory), @@ -579,11 +583,10 @@ def get_custom_sdk(custom_module, client_factory): g.custom_command('export', 'synapse_kusto_script_export') g.custom_wait_command('wait', 'synapse_kusto_script_show') - with self.command_group('synapse ad-only-authentications', command_type=synapse_sqlpool_sdk, + with self.command_group('synapse ad-only-auth', command_type=synapse_adonlyauthentications_sdk, custom_command_type=get_custom_sdk('adonlyauthentications', cf_synapse_client_azure_ad_only_authentications_factory), client_factory=cf_synapse_client_azure_ad_only_authentications_factory) as g: - g.custom_command('create', 'synapse_create_adonly_auth', supports_no_wait=True) - g.custom_command('update', 'synapse_create_adonly_auth', supports_no_wait=True) - g.command('list', 'list') - g.show_command('show','get') - g.wait_command('wait') + g.custom_command('enable', 'synapse_enable_adonly_auth', supports_no_wait=True) + g.custom_command('disable', 'synapse_disable_adonly_auth', supports_no_wait=True) + g.command('get', 'list') + g.wait_command('wait', 'list') diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py index 529298197bd..848094bf127 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py @@ -2,14 +2,22 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument +from email.policy import default from azure.cli.core.util import sdk_no_wait from azure.mgmt.synapse.models import AzureADOnlyAuthentication -def synapse_create_adonly_auth(cmd, client, resource_group_name, workspace_name, azure_ad_only_authentication_name, - enable_azure_ad_only_authentication, no_wait=False): - azure_ad_only_authentication_info = AzureADOnlyAuthentication(azure_ad_only_authentication=enable_azure_ad_only_authentication) +def synapse_enable_adonly_auth(cmd, client, resource_group_name, workspace_name, no_wait=False): + azure_ad_only_authentication_name = "default" + azure_ad_only_authentication_info = AzureADOnlyAuthentication(azure_ad_only_authentication=True) + + return sdk_no_wait(no_wait, client.begin_create, resource_group_name, workspace_name, + azure_ad_only_authentication_name, azure_ad_only_authentication_info) + + +def synapse_disable_adonly_auth(cmd, client, resource_group_name, workspace_name, no_wait=False): + azure_ad_only_authentication_name = "default" + azure_ad_only_authentication_info = AzureADOnlyAuthentication(azure_ad_only_authentication=False) return sdk_no_wait(no_wait, client.begin_create, resource_group_name, workspace_name, azure_ad_only_authentication_name, azure_ad_only_authentication_info) \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml new file mode 100644 index 00000000000..701b24fde36 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml @@ -0,0 +1,676 @@ +interactions: +- request: + body: '{"location": "eastus", "identity": {"type": "SystemAssigned"}, "properties": + {"defaultDataLakeStorage": {"accountUrl": "https://adlsgen2000002.dfs.core.windows.net", + "filesystem": "testfilesystem"}, "sqlAdministratorLoginPassword": "Pswd1000004", + "sqlAdministratorLogin": "cliuser1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse workspace create + Connection: + - keep-alive + Content-Length: + - '284' + Content-Type: + - application/json + ParameterSetName: + - --name --resource-group --storage-account --file-system --sql-admin-login-user + --sql-admin-login-password --location + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003?api-version=2021-06-01 + response: + body: + string: '{"properties":{"defaultDataLakeStorage":{"createManagedPrivateEndpoint":false,"accountUrl":"https://adlsgen2000002.dfs.core.windows.net","filesystem":"testfilesystem"},"encryption":{"doubleEncryptionEnabled":false},"provisioningState":"Provisioning","connectivityEndpoints":{"web":"https://web.azuresynapse.net?workspace=%2fsubscriptions%2f051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3%2fresourceGroups%2fsynapse-cli000001%2fproviders%2fMicrosoft.Synapse%2fworkspaces%2fclitest000003","dev":"https://clitest000003.dev.azuresynapse.net","sqlOnDemand":"clitest000003-ondemand.sql.azuresynapse.net","sql":"clitest000003.sql.azuresynapse.net"},"managedResourceGroupName":"synapseworkspace-managedrg-c43a4fdf-b094-46ee-9d3d-fd8d13b29ea9","privateEndpointConnections":[],"workspaceUID":"b3a4ac60-cbc0-4de0-9276-0dfc3fdf8365","extraProperties":{"WorkspaceType":"Normal"},"publicNetworkAccess":"Enabled","cspWorkspaceAdminProperties":{"initialWorkspaceAdminObjectId":"6a33200f-2b27-4fda-8567-b0c70d532441"},"trustedServiceBypassEnabled":false},"type":"Microsoft.Synapse/workspaces","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003","location":"eastus","name":"clitest000003","identity":{"type":"SystemAssigned","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","principalId":"e074534e-1b90-4578-8ee4-1ced79d6fc18"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + cache-control: + - no-cache + content-length: + - '1393' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 09:59:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse workspace create + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --storage-account --file-system --sql-admin-login-user + --sql-admin-login-password --location + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 09:59:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse workspace create + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --storage-account --file-system --sql-admin-login-user + --sql-admin-login-password --location + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:00:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse workspace create + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --storage-account --file-system --sql-admin-login-user + --sql-admin-login-password --location + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:00:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse workspace create + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --storage-account --file-system --sql-admin-login-user + --sql-admin-login-password --location + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + response: + body: + string: '{"status":"InProgress"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:01:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse workspace create + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --storage-account --file-system --sql-admin-login-user + --sql-admin-login-password --location + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:01:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse workspace create + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --storage-account --file-system --sql-admin-login-user + --sql-admin-login-password --location + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003?api-version=2021-06-01 + response: + body: + string: '{"properties":{"defaultDataLakeStorage":{"createManagedPrivateEndpoint":false,"accountUrl":"https://adlsgen2000002.dfs.core.windows.net","filesystem":"testfilesystem"},"encryption":{"doubleEncryptionEnabled":false},"provisioningState":"Succeeded","connectivityEndpoints":{"web":"https://web.azuresynapse.net?workspace=%2fsubscriptions%2f051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3%2fresourceGroups%2fsynapse-cli000001%2fproviders%2fMicrosoft.Synapse%2fworkspaces%2fclitest000003","dev":"https://clitest000003.dev.azuresynapse.net","sqlOnDemand":"clitest000003-ondemand.sql.azuresynapse.net","sql":"clitest000003.sql.azuresynapse.net"},"managedResourceGroupName":"synapseworkspace-managedrg-c43a4fdf-b094-46ee-9d3d-fd8d13b29ea9","sqlAdministratorLogin":"cliuser1","privateEndpointConnections":[],"workspaceUID":"b3a4ac60-cbc0-4de0-9276-0dfc3fdf8365","extraProperties":{"WorkspaceType":"Normal","IsScopeEnabled":false},"publicNetworkAccess":"Enabled","cspWorkspaceAdminProperties":{"initialWorkspaceAdminObjectId":"6a33200f-2b27-4fda-8567-b0c70d532441"},"trustedServiceBypassEnabled":false},"type":"Microsoft.Synapse/workspaces","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003","location":"eastus","name":"clitest000003","identity":{"type":"SystemAssigned","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","principalId":"e074534e-1b90-4578-8ee4-1ced79d6fc18"}}' + headers: + cache-control: + - no-cache + content-length: + - '1448' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:01:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - synapse ad-only-auth get + Connection: + - keep-alive + ParameterSetName: + - --resource-group --workspace-name + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications?api-version=2021-06-01 + response: + body: + string: '{"value":[{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-01T09:59:10.01Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}]}' + headers: + cache-control: + - no-cache + content-length: + - '386' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:01:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"azureADOnlyAuthentication": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse ad-only-auth disable + Connection: + - keep-alive + Content-Length: + - '52' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --workspace-name + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default?api-version=2021-06-01 + response: + body: + string: '{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-01T10:01:49.5333333Z","state":"Updating"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + headers: + access-control-allow-headers: + - Location + access-control-expose-headers: + - Location + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + cache-control: + - no-cache + content-length: + - '377' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:01:49 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse ad-only-auth disable + Connection: + - keep-alive + ParameterSetName: + - --resource-group --workspace-name + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:02:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse ad-only-auth disable + Connection: + - keep-alive + ParameterSetName: + - --resource-group --workspace-name + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + response: + body: + string: '{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-01T10:02:01.4466667Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:02:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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": {"azureADOnlyAuthentication": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse ad-only-auth enable + Connection: + - keep-alive + Content-Length: + - '51' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --workspace-name + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default?api-version=2021-06-01 + response: + body: + string: '{"properties":{"azureADOnlyAuthentication":true,"creationDate":"2022-07-01T10:02:23.23Z","state":"Updating"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + headers: + access-control-allow-headers: + - Location + access-control-expose-headers: + - Location + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + cache-control: + - no-cache + content-length: + - '371' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:02:22 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse ad-only-auth enable + Connection: + - keep-alive + ParameterSetName: + - --resource-group --workspace-name + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - synapse ad-only-auth enable + Connection: + - keep-alive + ParameterSetName: + - --resource-group --workspace-name + User-Agent: + - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + response: + body: + string: '{"properties":{"azureADOnlyAuthentication":true,"creationDate":"2022-07-01T10:02:36.81Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + headers: + cache-control: + - no-cache + content-length: + - '373' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 01 Jul 2022 10:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - 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/synapse/tests/latest/test_synapse_scenario.py b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py index 6113dd67791..8f5aba89247 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py @@ -2987,3 +2987,41 @@ def test_sqlscript(self): 'az synapse sql-script show --workspace-name {workspace} --name {name}', expect_failure=True) + @ResourceGroupPreparer(name_prefix='synapse-cli', random_name_length=16) + @StorageAccountPreparer(name_prefix='adlsgen2', length=16, location=location, key='storage-account') + def test_ad_only_auth(self): + self.kwargs.update({ + }) + + + # create a workspace + self._create_workspace() + + # create firewall rule + # self.cmd( + # 'az synapse workspace firewall-rule create --resource-group {rg} --name allowAll --workspace-name {workspace} ' + # '--start-ip-address 0.0.0.0 --end-ip-address 255.255.255.255', checks=[ + # self.check('provisioningState', 'Succeeded') + # ] + # ) + + self.cmd( + 'az synapse ad-only-auth get --resource-group {rg} --workspace-name {workspace}', + checks=[ + self.check('[0].type', 'Microsoft.Synapse/workspaces/azureADOnlyAuthentications') + ] + ) + + self.cmd( + 'az synapse ad-only-auth disable --resource-group {rg} --workspace-name {workspace}', + checks=[ + self.check('azureAdOnlyAuthentication', False) + ] + ) + + self.cmd( + 'az synapse ad-only-auth enable --resource-group {rg} --workspace-name {workspace}', + checks=[ + self.check('azureAdOnlyAuthentication', True) + ] + ) \ No newline at end of file From 300011f74533ca8a78281e6206ee86b757449bec Mon Sep 17 00:00:00 2001 From: kevinzz6 <632604666@qq.com> Date: Wed, 13 Jul 2022 15:20:29 +0800 Subject: [PATCH 3/6] remove wait --- .../synapse/manual/_client_factory.py | 2 +- .../command_modules/synapse/manual/_help.py | 5 -- .../command_modules/synapse/manual/_params.py | 2 +- .../synapse/manual/commands.py | 5 +- .../operations/adonlyauthentications.py | 14 ++- .../latest/recordings/test_ad_only_auth.yaml | 88 +++++++++---------- .../tests/latest/test_synapse_scenario.py | 9 -- 7 files changed, 50 insertions(+), 75 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py index 0e4b4014dca..5361a345ebf 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py @@ -257,4 +257,4 @@ def cf_synapse_sql_script(cli_ctx, workspace_name): def cf_synapse_client_azure_ad_only_authentications_factory(cli_ctx, *_): - return cf_synapse(cli_ctx).azure_ad_only_authentications \ No newline at end of file + return cf_synapse(cli_ctx).azure_ad_only_authentications diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py index 6ab9754e028..d566148d143 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_help.py @@ -2307,8 +2307,3 @@ az synapse ad-only-auth disable --workspace-name testsynapseworkspace \\ -g testresourcegroup """ - -helps['synapse ad-only-auth wait'] = """ -type: command -short-summary: Place the CLI in a waiting state until a condition of a Azure ad-only-auth is met. -""" \ No newline at end of file diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py index 78df3824475..9b2354cbe16 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py @@ -1087,7 +1087,7 @@ def load_arguments(self, _): c.argument('definition_file', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='The KQL query file path') - for scope in ['show', 'wait', 'delete']: + for scope in ['show', 'delete']: with self.argument_context('synapse kql-script ' + scope) as c: c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') c.argument('script_name', arg_type=name_type, diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py index 9bf393fbfb4..0dd77780837 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/commands.py @@ -586,7 +586,6 @@ def get_custom_sdk(custom_module, client_factory): with self.command_group('synapse ad-only-auth', command_type=synapse_adonlyauthentications_sdk, custom_command_type=get_custom_sdk('adonlyauthentications', cf_synapse_client_azure_ad_only_authentications_factory), client_factory=cf_synapse_client_azure_ad_only_authentications_factory) as g: - g.custom_command('enable', 'synapse_enable_adonly_auth', supports_no_wait=True) - g.custom_command('disable', 'synapse_disable_adonly_auth', supports_no_wait=True) + g.custom_command('enable', 'synapse_enable_adonly_auth') + g.custom_command('disable', 'synapse_disable_adonly_auth') g.command('get', 'list') - g.wait_command('wait', 'list') diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py index 848094bf127..6ca08b91c99 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/operations/adonlyauthentications.py @@ -2,22 +2,20 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from email.policy import default -from azure.cli.core.util import sdk_no_wait from azure.mgmt.synapse.models import AzureADOnlyAuthentication -def synapse_enable_adonly_auth(cmd, client, resource_group_name, workspace_name, no_wait=False): +def synapse_enable_adonly_auth(client, resource_group_name, workspace_name): azure_ad_only_authentication_name = "default" azure_ad_only_authentication_info = AzureADOnlyAuthentication(azure_ad_only_authentication=True) - return sdk_no_wait(no_wait, client.begin_create, resource_group_name, workspace_name, - azure_ad_only_authentication_name, azure_ad_only_authentication_info) + return client.begin_create(resource_group_name, workspace_name, + azure_ad_only_authentication_name, azure_ad_only_authentication_info) -def synapse_disable_adonly_auth(cmd, client, resource_group_name, workspace_name, no_wait=False): +def synapse_disable_adonly_auth(client, resource_group_name, workspace_name): azure_ad_only_authentication_name = "default" azure_ad_only_authentication_info = AzureADOnlyAuthentication(azure_ad_only_authentication=False) - return sdk_no_wait(no_wait, client.begin_create, resource_group_name, workspace_name, - azure_ad_only_authentication_name, azure_ad_only_authentication_info) \ No newline at end of file + return client.begin_create(resource_group_name, workspace_name, + azure_ad_only_authentication_name, azure_ad_only_authentication_info) diff --git a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml index 701b24fde36..24362eafc65 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml +++ b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_ad_only_auth.yaml @@ -26,10 +26,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003?api-version=2021-06-01 response: body: - string: '{"properties":{"defaultDataLakeStorage":{"createManagedPrivateEndpoint":false,"accountUrl":"https://adlsgen2000002.dfs.core.windows.net","filesystem":"testfilesystem"},"encryption":{"doubleEncryptionEnabled":false},"provisioningState":"Provisioning","connectivityEndpoints":{"web":"https://web.azuresynapse.net?workspace=%2fsubscriptions%2f051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3%2fresourceGroups%2fsynapse-cli000001%2fproviders%2fMicrosoft.Synapse%2fworkspaces%2fclitest000003","dev":"https://clitest000003.dev.azuresynapse.net","sqlOnDemand":"clitest000003-ondemand.sql.azuresynapse.net","sql":"clitest000003.sql.azuresynapse.net"},"managedResourceGroupName":"synapseworkspace-managedrg-c43a4fdf-b094-46ee-9d3d-fd8d13b29ea9","privateEndpointConnections":[],"workspaceUID":"b3a4ac60-cbc0-4de0-9276-0dfc3fdf8365","extraProperties":{"WorkspaceType":"Normal"},"publicNetworkAccess":"Enabled","cspWorkspaceAdminProperties":{"initialWorkspaceAdminObjectId":"6a33200f-2b27-4fda-8567-b0c70d532441"},"trustedServiceBypassEnabled":false},"type":"Microsoft.Synapse/workspaces","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003","location":"eastus","name":"clitest000003","identity":{"type":"SystemAssigned","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","principalId":"e074534e-1b90-4578-8ee4-1ced79d6fc18"}}' + string: '{"properties":{"defaultDataLakeStorage":{"createManagedPrivateEndpoint":false,"accountUrl":"https://adlsgen2000002.dfs.core.windows.net","filesystem":"testfilesystem"},"encryption":{"doubleEncryptionEnabled":false},"provisioningState":"Provisioning","connectivityEndpoints":{"web":"https://web.azuresynapse.net?workspace=%2fsubscriptions%2f051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3%2fresourceGroups%2fsynapse-cli000001%2fproviders%2fMicrosoft.Synapse%2fworkspaces%2fclitest000003","dev":"https://clitest000003.dev.azuresynapse.net","sqlOnDemand":"clitest000003-ondemand.sql.azuresynapse.net","sql":"clitest000003.sql.azuresynapse.net"},"managedResourceGroupName":"synapseworkspace-managedrg-5da050b3-8cfd-4522-9867-dd28c67017ca","privateEndpointConnections":[],"workspaceUID":"9c658053-3fbd-4c83-901a-0bacd4fed030","extraProperties":{"WorkspaceType":"Normal"},"publicNetworkAccess":"Enabled","cspWorkspaceAdminProperties":{"initialWorkspaceAdminObjectId":"6a33200f-2b27-4fda-8567-b0c70d532441"},"trustedServiceBypassEnabled":false},"type":"Microsoft.Synapse/workspaces","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003","location":"eastus","name":"clitest000003","identity":{"type":"SystemAssigned","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","principalId":"111e6cda-ab18-438a-bce4-ce612b0d6756"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/ae57c513-2fd5-4b25-a31e-847cc2ce1eec?api-version=2021-06-01 cache-control: - no-cache content-length: @@ -37,7 +37,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 09:59:10 GMT + - Wed, 13 Jul 2022 07:07:16 GMT expires: - '-1' pragma: @@ -70,7 +70,7 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/ae57c513-2fd5-4b25-a31e-847cc2ce1eec?api-version=2021-06-01 response: body: string: '{"status":"InProgress"}' @@ -82,7 +82,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 09:59:41 GMT + - Wed, 13 Jul 2022 07:07:47 GMT expires: - '-1' pragma: @@ -117,7 +117,7 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/ae57c513-2fd5-4b25-a31e-847cc2ce1eec?api-version=2021-06-01 response: body: string: '{"status":"InProgress"}' @@ -129,7 +129,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:00:12 GMT + - Wed, 13 Jul 2022 07:08:18 GMT expires: - '-1' pragma: @@ -164,7 +164,7 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/ae57c513-2fd5-4b25-a31e-847cc2ce1eec?api-version=2021-06-01 response: body: string: '{"status":"InProgress"}' @@ -176,7 +176,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:00:42 GMT + - Wed, 13 Jul 2022 07:08:49 GMT expires: - '-1' pragma: @@ -211,7 +211,7 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/ae57c513-2fd5-4b25-a31e-847cc2ce1eec?api-version=2021-06-01 response: body: string: '{"status":"InProgress"}' @@ -223,7 +223,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:01:13 GMT + - Wed, 13 Jul 2022 07:09:19 GMT expires: - '-1' pragma: @@ -258,7 +258,7 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/238d4798-4cfa-4054-b380-269fdbca9d84?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/ae57c513-2fd5-4b25-a31e-847cc2ce1eec?api-version=2021-06-01 response: body: string: '{"status":"Succeeded"}' @@ -270,7 +270,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:01:43 GMT + - Wed, 13 Jul 2022 07:09:50 GMT expires: - '-1' pragma: @@ -308,7 +308,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003?api-version=2021-06-01 response: body: - string: '{"properties":{"defaultDataLakeStorage":{"createManagedPrivateEndpoint":false,"accountUrl":"https://adlsgen2000002.dfs.core.windows.net","filesystem":"testfilesystem"},"encryption":{"doubleEncryptionEnabled":false},"provisioningState":"Succeeded","connectivityEndpoints":{"web":"https://web.azuresynapse.net?workspace=%2fsubscriptions%2f051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3%2fresourceGroups%2fsynapse-cli000001%2fproviders%2fMicrosoft.Synapse%2fworkspaces%2fclitest000003","dev":"https://clitest000003.dev.azuresynapse.net","sqlOnDemand":"clitest000003-ondemand.sql.azuresynapse.net","sql":"clitest000003.sql.azuresynapse.net"},"managedResourceGroupName":"synapseworkspace-managedrg-c43a4fdf-b094-46ee-9d3d-fd8d13b29ea9","sqlAdministratorLogin":"cliuser1","privateEndpointConnections":[],"workspaceUID":"b3a4ac60-cbc0-4de0-9276-0dfc3fdf8365","extraProperties":{"WorkspaceType":"Normal","IsScopeEnabled":false},"publicNetworkAccess":"Enabled","cspWorkspaceAdminProperties":{"initialWorkspaceAdminObjectId":"6a33200f-2b27-4fda-8567-b0c70d532441"},"trustedServiceBypassEnabled":false},"type":"Microsoft.Synapse/workspaces","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003","location":"eastus","name":"clitest000003","identity":{"type":"SystemAssigned","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","principalId":"e074534e-1b90-4578-8ee4-1ced79d6fc18"}}' + string: '{"properties":{"defaultDataLakeStorage":{"createManagedPrivateEndpoint":false,"accountUrl":"https://adlsgen2000002.dfs.core.windows.net","filesystem":"testfilesystem"},"encryption":{"doubleEncryptionEnabled":false},"provisioningState":"Succeeded","connectivityEndpoints":{"web":"https://web.azuresynapse.net?workspace=%2fsubscriptions%2f051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3%2fresourceGroups%2fsynapse-cli000001%2fproviders%2fMicrosoft.Synapse%2fworkspaces%2fclitest000003","dev":"https://clitest000003.dev.azuresynapse.net","sqlOnDemand":"clitest000003-ondemand.sql.azuresynapse.net","sql":"clitest000003.sql.azuresynapse.net"},"managedResourceGroupName":"synapseworkspace-managedrg-5da050b3-8cfd-4522-9867-dd28c67017ca","sqlAdministratorLogin":"cliuser1","privateEndpointConnections":[],"workspaceUID":"9c658053-3fbd-4c83-901a-0bacd4fed030","extraProperties":{"WorkspaceType":"Normal","IsScopeEnabled":false},"publicNetworkAccess":"Enabled","cspWorkspaceAdminProperties":{"initialWorkspaceAdminObjectId":"6a33200f-2b27-4fda-8567-b0c70d532441"},"trustedServiceBypassEnabled":false},"type":"Microsoft.Synapse/workspaces","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003","location":"eastus","name":"clitest000003","identity":{"type":"SystemAssigned","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","principalId":"111e6cda-ab18-438a-bce4-ce612b0d6756"}}' headers: cache-control: - no-cache @@ -317,7 +317,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:01:44 GMT + - Wed, 13 Jul 2022 07:09:51 GMT expires: - '-1' pragma: @@ -354,16 +354,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications?api-version=2021-06-01 response: body: - string: '{"value":[{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-01T09:59:10.01Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}]}' + string: '{"value":[{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-13T07:07:16.3133333Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}]}' headers: cache-control: - no-cache content-length: - - '386' + - '391' content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:01:46 GMT + - Wed, 13 Jul 2022 07:09:53 GMT expires: - '-1' pragma: @@ -400,26 +400,26 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default?api-version=2021-06-01 response: body: - string: '{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-01T10:01:49.5333333Z","state":"Updating"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + string: '{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-13T07:09:58.1Z","state":"Updating"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' headers: access-control-allow-headers: - Location access-control-expose-headers: - Location azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/e54ded64-935b-47d9-a08d-ab5d99fe2e5d?api-version=2021-06-01 cache-control: - no-cache content-length: - - '377' + - '371' content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:01:49 GMT + - Wed, 13 Jul 2022 07:09:57 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/e54ded64-935b-47d9-a08d-ab5d99fe2e5d?api-version=2021-06-01 pragma: - no-cache server: @@ -429,7 +429,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -449,7 +449,7 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/e54ded64-935b-47d9-a08d-ab5d99fe2e5d?api-version=2021-06-01 response: body: string: '{"status":"Succeeded"}' @@ -461,7 +461,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:02:19 GMT + - Wed, 13 Jul 2022 07:10:29 GMT expires: - '-1' pragma: @@ -470,10 +470,6 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff status: @@ -495,10 +491,10 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/5fa015fa-92e8-4cdb-a90e-67e3b0b5d02b?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/e54ded64-935b-47d9-a08d-ab5d99fe2e5d?api-version=2021-06-01 response: body: - string: '{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-01T10:02:01.4466667Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + string: '{"properties":{"azureADOnlyAuthentication":false,"creationDate":"2022-07-13T07:10:12.6733333Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' headers: cache-control: - no-cache @@ -507,7 +503,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:02:20 GMT + - Wed, 13 Jul 2022 07:10:30 GMT expires: - '-1' pragma: @@ -516,10 +512,6 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff status: @@ -548,26 +540,26 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default?api-version=2021-06-01 response: body: - string: '{"properties":{"azureADOnlyAuthentication":true,"creationDate":"2022-07-01T10:02:23.23Z","state":"Updating"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + string: '{"properties":{"azureADOnlyAuthentication":true,"creationDate":"2022-07-13T07:10:32.3866667Z","state":"Updating"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' headers: access-control-allow-headers: - Location access-control-expose-headers: - Location azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/7fe6d354-bfb3-4ca0-9d6b-08ad192d7b25?api-version=2021-06-01 cache-control: - no-cache content-length: - - '371' + - '376' content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:02:22 GMT + - Wed, 13 Jul 2022 07:10:32 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/7fe6d354-bfb3-4ca0-9d6b-08ad192d7b25?api-version=2021-06-01 pragma: - no-cache server: @@ -577,7 +569,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 201 message: Created @@ -597,7 +589,7 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationStatuses/7fe6d354-bfb3-4ca0-9d6b-08ad192d7b25?api-version=2021-06-01 response: body: string: '{"status":"Succeeded"}' @@ -609,7 +601,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:02:53 GMT + - Wed, 13 Jul 2022 07:11:02 GMT expires: - '-1' pragma: @@ -643,10 +635,10 @@ interactions: User-Agent: - AZURECLI/2.37.0 azsdk-python-mgmt-synapse/2.1.0b2 Python/3.8.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/e73d3e00-7fba-4d85-a2ab-d2655c19fbd2?api-version=2021-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/operationResults/7fe6d354-bfb3-4ca0-9d6b-08ad192d7b25?api-version=2021-06-01 response: body: - string: '{"properties":{"azureADOnlyAuthentication":true,"creationDate":"2022-07-01T10:02:36.81Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' + string: '{"properties":{"azureADOnlyAuthentication":true,"creationDate":"2022-07-13T07:10:46.26Z","state":"Consistent"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/synapse-cli000001/providers/Microsoft.Synapse/workspaces/clitest000003/azureADOnlyAuthentications/default","name":"default","type":"Microsoft.Synapse/workspaces/azureADOnlyAuthentications"}' headers: cache-control: - no-cache @@ -655,7 +647,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 01 Jul 2022 10:02:53 GMT + - Wed, 13 Jul 2022 07:11:02 GMT expires: - '-1' pragma: diff --git a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py index 8f5aba89247..ccfcc1c4e48 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py @@ -2993,18 +2993,9 @@ def test_ad_only_auth(self): self.kwargs.update({ }) - # create a workspace self._create_workspace() - # create firewall rule - # self.cmd( - # 'az synapse workspace firewall-rule create --resource-group {rg} --name allowAll --workspace-name {workspace} ' - # '--start-ip-address 0.0.0.0 --end-ip-address 255.255.255.255', checks=[ - # self.check('provisioningState', 'Succeeded') - # ] - # ) - self.cmd( 'az synapse ad-only-auth get --resource-group {rg} --workspace-name {workspace}', checks=[ From df4e8f7da34207a2599837028013668aa6ad9427 Mon Sep 17 00:00:00 2001 From: kevinzz6 <632604666@qq.com> Date: Wed, 13 Jul 2022 15:37:52 +0800 Subject: [PATCH 4/6] fix linter error --- .../azure/cli/command_modules/synapse/manual/_params.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py index 4508d96ded6..6b7f2c75ebd 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py @@ -1087,7 +1087,7 @@ def load_arguments(self, _): c.argument('definition_file', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='The KQL query file path') - for scope in ['show', 'delete']: + for scope in ['show', 'delete', 'wait']: with self.argument_context('synapse kql-script ' + scope) as c: c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') c.argument('script_name', arg_type=name_type, @@ -1102,9 +1102,10 @@ def load_arguments(self, _): c.argument('script_name', arg_type=name_type, help='The name of the KQL script.') for scope in ['enable', 'disable']: - with self.argument_context('synapse ad-only-auth ') as c: + with self.argument_context('synapse ad-only-auth '+ scope) as c: c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') c.argument('resource_group_name', resource_group_name_type) + # synapse link connections with self.argument_context('synapse link-connection list') as c: c.argument('workspace_name', arg_type=workspace_name_arg_type) From 9041af9a5829982f708a4ce8e306808f0b3abdef Mon Sep 17 00:00:00 2001 From: kevinzz6 <632604666@qq.com> Date: Fri, 15 Jul 2022 15:19:14 +0800 Subject: [PATCH 5/6] remove useless change --- .../azure/cli/command_modules/synapse/manual/_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py index 6b7f2c75ebd..48e8cdd75d1 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py @@ -1087,7 +1087,7 @@ def load_arguments(self, _): c.argument('definition_file', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='The KQL query file path') - for scope in ['show', 'delete', 'wait']: + for scope in ['show', 'wait', 'delete']: with self.argument_context('synapse kql-script ' + scope) as c: c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') c.argument('script_name', arg_type=name_type, From c84ad2edcf315b8f286b59099da92d9a69978f67 Mon Sep 17 00:00:00 2001 From: kevinzz6 <632604666@qq.com> Date: Mon, 18 Jul 2022 13:42:42 +0800 Subject: [PATCH 6/6] fix style issue --- .../azure/cli/command_modules/synapse/manual/_client_factory.py | 1 + .../azure/cli/command_modules/synapse/manual/_params.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py index cbdede8877b..e862ac32eb5 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py @@ -259,5 +259,6 @@ def cf_synapse_sql_script(cli_ctx, workspace_name): def cf_synapse_client_azure_ad_only_authentications_factory(cli_ctx, *_): return cf_synapse(cli_ctx).azure_ad_only_authentications + def cf_synapse_link_connection(cli_ctx, workspace_name): return cf_synapse_client_artifacts_factory(cli_ctx, workspace_name).link_connection diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py index 48e8cdd75d1..bf777adc6b1 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/_params.py @@ -1102,7 +1102,7 @@ def load_arguments(self, _): c.argument('script_name', arg_type=name_type, help='The name of the KQL script.') for scope in ['enable', 'disable']: - with self.argument_context('synapse ad-only-auth '+ scope) as c: + with self.argument_context('synapse ad-only-auth ' + scope) as c: c.argument('workspace_name', arg_type=workspace_name_arg_type, help='The name of the workspace') c.argument('resource_group_name', resource_group_name_type)