-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Synapse] Update role assignment/definition related cmdlets #17476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
38d6c61
update 'az synapse role' commands
sunsw1994 10f3a22
update recording file
sunsw1994 c401ddb
revert launch.json
sunsw1994 b5774e9
address comments
sunsw1994 a3c5667
fix pylint error
sunsw1994 4dc2a9b
1. address comments 2. remove scope parameter of az role definition d…
sunsw1994 6c3eb78
Update help text for argument
sunsw1994 bdf53ca
Update help text for argument
sunsw1994 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,8 +139,12 @@ def get_custom_sdk(custom_module, client_factory): | |
| operations_tmpl='azure.synapse.spark.operations#SparkBatchOperations.{}', | ||
| client_factory=None) | ||
|
|
||
| synapse_accesscontrol_sdk = CliCommandType( | ||
| operations_tmpl='azure.synapse.accesscontrol.operations#AccessControlClientOperationsMixin.{}', | ||
| synapse_role_assignment_sdk = CliCommandType( | ||
| operations_tmpl='azure.synapse.accesscontrol.operations#RoleAssignmentsOperations.{}', | ||
| client_factory=None) | ||
Juliehzl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| synapse_role_definitions_sdk = CliCommandType( | ||
| operations_tmpl='azure.synapse.accesscontrol.operations#RoleDefinitionsOperations.{}', | ||
| client_factory=None) | ||
|
|
||
| synapse_linked_service_sdk = CliCommandType( | ||
|
|
@@ -375,18 +379,22 @@ def get_custom_sdk(custom_module, client_factory): | |
| g.custom_command('cancel', 'cancel_spark_session_statement', confirmation=True) | ||
|
|
||
| # Data Plane Commands --Access control operations | ||
| with self.command_group('synapse role assignment', synapse_accesscontrol_sdk, | ||
| with self.command_group('synapse role assignment', synapse_role_assignment_sdk, | ||
| custom_command_type=get_custom_sdk('accesscontrol', None)) as g: | ||
| g.custom_command('create', 'create_role_assignment') | ||
| g.custom_command('list', 'list_role_assignments') | ||
| g.custom_show_command('show', 'get_role_assignment_by_id') | ||
| g.custom_command('delete', 'delete_role_assignment', confirmation=True) | ||
|
|
||
| with self.command_group('synapse role definition', synapse_accesscontrol_sdk, | ||
| with self.command_group('synapse role definition', synapse_role_definitions_sdk, | ||
| custom_command_type=get_custom_sdk('accesscontrol', None)) as g: | ||
| g.custom_command('list', 'list_role_definitions') | ||
| g.custom_show_command('show', 'get_role_definition') | ||
|
|
||
| with self.command_group('synapse role scope', synapse_role_definitions_sdk, | ||
| custom_command_type=get_custom_sdk('accesscontrol', None)) as g: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could declare your client factory here and don't need to define in every fuction. |
||
| g.custom_command('list', 'list_scopes') | ||
|
|
||
| # Data Plane Commands --Artifacts Linked service operations | ||
| with self.command_group('synapse linked-service', synapse_linked_service_sdk, | ||
| custom_command_type=get_custom_sdk('artifacts', None)) as g: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does
Sql Adminstill work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, now Synapse is using new role name.
Synapse SQL Administrator
Synapse Apache Spark Administrator
...
https://docs.microsoft.com/en-us/azure/synapse-analytics/security/synapse-workspace-synapse-rbac-roles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this way, it is breaking change to existing customers and we should try to avoid such breaking.
To not break customers, you should try to make previous definition work and add deprecation info to redirect to new definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just allow this breaking change considering that the module is still in preview? Now Synapse moves to new names, we don't want to allow the old names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding breaking change description at History Notes
[Synapse] BREAKING CHANGE: az synapse role assignment create: Role names at old version are not allowed, Sql Admin, Apache Spark Admin, Workspace Admin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. According to the telemetry, there is no much usage for this command as it is in preview. So we could accept the breaking change this time. Please note that we need to avoid breaking change as possible as we can in future design.