Skip to content

Conversation

@wonner
Copy link
Contributor

@wonner wonner commented Sep 25, 2020

Description

Add some new commands to manage pipeline, linked service, trigger, notebook, data flow and dataset in synapse workspace.

  • az synapse linked-service create/set/list/show/delete
  • az synapse dataset create/set/list/show/delete
  • az synapse pipeline create/set/list/show/delete/create-run
  • az synapse pipeline-run show/cancel/query-by-workspace
  • az synapse activity-run query-by-pipeline-run
  • az synapse trigger create/set/list/show/delete/subscribe-to-event/get-event-subscription-status/unsubscribe-from-event/start/stop
  • az synapse trigger-run query-by-workspace/rerun
  • az synapse data-flow create/set/list/show/delete
  • az synapse notebook create/set/list/show/delete/import/export

Testing Guide

az synapse linked-service -h
az synapse dataset -h
az synapse pipeline -h
az synapse pipeline-run -h
az synapse activity-run -h
az synapse trigger -h
az synapse trigger-run -h
az synapse data-flow -h
az synapse notebook -h

History Notes


This checklist is used to make sure that common guidelines for a pull request are followed.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 25, 2020

Synapse

@yonzhan yonzhan added this to the S177 milestone Sep 25, 2020
@idear1203
Copy link
Contributor

@haroldrandom could you please help merge the PR?

with self.command_group('synapse linked-service', synapse_linked_service_sdk,
custom_command_type=get_custom_sdk('artifacts', None)) as g:
g.custom_command('create', 'create_or_update_linked_service', supports_no_wait=True)
g.custom_command('set', 'create_or_update_linked_service', supports_no_wait=True)
Copy link
Member

@jsntcy jsntcy Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set [](start = 26, length = 3)

Usually we use "update" which is a patch like operation. Rarely to use "set". Please refer to
https://github.com/Azure/azure-cli/blob/dev/doc/command_guidelines.md#standard-command-types for more details.
please also update other "set" commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The things these commands do are more like "set", will replace all properties of a resource without preserving existing values. Because there have the cmdlets Set-AzSynapsexxx in powershell which alias is New-AzSynapsexxx. So I use "set" here. Maybe I can delete the "set" command directly, because it has the same function with "create". What do you think about?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually CLI doesn't have 'set' command


In reply to: 506164081 [](ancestors = 506164081)

# Data Plane Commands --Artifacts pipeline run operations
with self.command_group('synapse pipeline-run', synapse_pipeline_run_sdk,
custom_command_type=get_custom_sdk('artifacts', None)) as g:
g.custom_command('query-by-workspace', 'query_pipeline_runs_by_workspace')
Copy link
Member

@jsntcy jsntcy Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For simplicity, using "query" as command is enough?
Please also take care of other "query-xxx-xxx" commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It keep align with ADF. In ADF, it is "datafactory pipeline-run query-by-factory".

client = cf_synapse_trigger(cmd.cli_ctx, workspace_name)
properties = Trigger.from_dict(definition_file['properties'])
return sdk_no_wait(no_wait, client.begin_create_or_update_trigger,
trigger_name, properties, polling=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "polling=True" as sdk_no_wait() has such logic.
Please update other places.

Copy link
Contributor Author

@wonner wonner Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If remove "polling=True", it can't poll the result. Just return the result with "state": "Creating". Maybe it causes by track 2 sdk?

Copy link
Member

@jsntcy jsntcy Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If users don't provide --no-wait, the default value of polling is True. No need to add it here. @


In reply to: 506169871 [](ancestors = 506169871)

g.custom_command('list', 'list_triggers')
g.custom_show_command('show', 'get_trigger')
g.custom_command('delete', 'delete_trigger', confirmation=True, supports_no_wait=True)
g.custom_command('subscribe-to-event', 'subscribe_trigger_to_events', supports_no_wait=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For simplicity, using "subscribe" as command is enough? also for "unsubscribe".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It keeps align with ADF too.

@jsntcy
Copy link
Member

jsntcy commented Oct 16, 2020

@wonner, I added some comments, please take a look.

Copy link
Member

@jsntcy jsntcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jsntcy jsntcy merged commit 7c03a5d into Azure:dev Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants