-
Notifications
You must be signed in to change notification settings - Fork 61
feat: Add query parameter support to ls and acl ls commands #35
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
aviatco
merged 37 commits into
microsoft:main
from
aviatco:dev/aviatcohen/support-quering-ls-command
Dec 1, 2025
Merged
Changes from 6 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
47e7bb7
support -q flag for ls command
f17cff4
return error in case all fieled are invalid
123fb49
fix ws acl ls test
8b5bae2
support -q in ls test helper
36df125
Fix type check
3e45e7c
ls support - filter with Jm Jjmespath
dba7f6b
fix docs
13c1be3
update docs & examples
2b0c04f
add changie row
676f240
support -q in config ls
f7376c5
update doces
faac3e8
revert -q support for config ls and remove nargs
dfd02d3
fix type check
4908174
fix
e42ffd7
revert nargs change
6318ce9
Merge branch 'main' into dev/aviatcohen/support-quering-ls-command
aviatco ce86ad3
Merge branch 'main' into dev/aviatcohen/support-quering-ls-command
aviatco 0787e2a
use shlex to split the command into parts
201c488
Fix create connection with onpre gateway values param to use quotes
176dd69
align tests with shlex
c015675
Merge branch 'main' into dev/aviatcohen/support-quering-ls-command
aviatco 39888f7
revert sample_items files, fix run-run tests
82f5f39
fix tests
3b67305
record test test_cd_workspace_with_special_characters_success
929aca2
record test_cd_workspace_with_special_characters_success
fe3ade1
revert recording of test_cd_workspace_with_special_characters_success
a0c1650
revert
84d4a57
skip test_cd_workspace_with_special_characters_success[\']
1e0c973
fix acl docs typo
d694053
delete test_cd_workspace_with_special_characters_success[\'] recording
d19a5e9
Revert the specified assertion change for \.
58bb555
update changie
acb6e5f
skip \' test in cd
b8fe96c
resolve PR comments
be31ec7
Merge branch 'main' into dev/aviatcohen/support-quering-ls-command
aviatco 9f1bbe9
merge with main
bd23d87
remove nargs from set - sync with main
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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,122 +1,149 @@ | ||
| # Access Control List (ACL) Commands | ||
| # ACL Commands | ||
|
|
||
| The access control list (`acl`) commands let you manage permissions and security settings for workspaces, items, and OneLake resources. | ||
|
|
||
| **Supported Types:** | ||
|
|
||
| - `.Workspace` (workspace-level ACLs) | ||
| - All workspace item types (item-level ACLs) | ||
| - OneLake storage sections (RBAC) | ||
| The `acl` commands manage access control lists (ACLs) for Fabric resources. Use these commands to view, set, and manage access permissions. | ||
|
|
||
| ## Available Commands | ||
|
|
||
| | Command | Description | Usage | | ||
| |-----------------|------------------------|----------------------------------------------------| | ||
| | `acl ls` (dir) | List ACLs | `acl ls <path> [-l]` | | ||
| | `acl set` | Set access controls | `acl set <path> [-I <identity>] [-R <role>] [-f]` | | ||
| | `acl rm` (del) | Remove an ACL | `acl rm <path> [-I <identity>] [-f]` | | ||
| | `acl get` | Get ACL details | `acl get <path> [-q <query>] [-o <output_path>]` | | ||
| | Command | Description | Usage | | ||
| |------------|--------------------------------|---------------------------------------------------| | ||
| | `acl get` | Get ACL entries for a resource | `acl get <path> [-q QUERY]` | | ||
| | `acl ls` | List ACL entries | `acl ls <path> [-l] [-q QUERY]` | | ||
| | `acl set` | Set ACL entry | `acl set <path> --identity ID --role ROLE [-f]` | | ||
| | `acl rm` | Remove ACL entry | `acl rm <path> --identity ID [-f]` | | ||
|
|
||
| --- | ||
|
|
||
| ### ls (dir) | ||
|
|
||
| List access control entries for a workspace, item, or OneLake resource. | ||
| List ACL entries for a resource. | ||
|
|
||
| !!! info "Listing ACLs for a workspace or item requires tenant-level Fabric Administrator" | ||
|
|
||
| **Usage:** | ||
|
|
||
| ``` | ||
| fab acl ls <path> [-l] | ||
| fab acl ls <path> [-l] [-q QUERY] | ||
| ``` | ||
|
|
||
| **Parameters:** | ||
|
|
||
| - `<path>`: Path to the resource. | ||
| - `-l, --long`: Show detailed output. Optional. | ||
| - `<path>`: Resource path | ||
| - `-l, --long`: Show detailed output including object IDs and names. Optional. | ||
| - `-q, --query`: JMESPath query to filter and project fields. Optional. | ||
|
|
||
| **Examples:** | ||
|
|
||
| ```bash | ||
| # List basic ACL entries | ||
| fab acl ls ws1.Workspace | ||
|
|
||
| # List detailed ACL information | ||
| fab acl ls ws1.Workspace -l | ||
|
|
||
| # Project single field using array projection | ||
| fab acl ls ws1.Workspace -q "[*].identity" | ||
|
|
||
| # Project multiple fields using array syntax | ||
| fab acl ls ws1.Workspace -q "[identity, type]" | ||
|
|
||
| # Project and rename fields using object syntax | ||
| fab acl ls ws1.Workspace -q "{principalInfo: identity, accessLevel: role}" | ||
|
|
||
| # Filter specific roles and project fields | ||
| fab acl ls ws1.Workspace -q "[?role=='Member'].{id: identity, role: role}" | ||
| ``` | ||
| fab acl ls workspace1.workspace | ||
| fab acl ls lh1.lakehouse -l | ||
| fab acl ls /Files/data -l | ||
| ``` | ||
|
|
||
| **Notes:** | ||
|
|
||
| - The `-q` parameter accepts JMESPath query expressions (https://jmespath.org) | ||
| - Array projection `[*].field` returns an array of values | ||
| - Array syntax `[field1, field2]` selects multiple fields | ||
| - Object syntax `{newName: field}` renames fields in output | ||
| - Filter expressions `[?field=='value']` filter results | ||
| - Query projection takes precedence over `-l` flag field selection | ||
|
|
||
| --- | ||
|
|
||
| ### set | ||
| ### get | ||
|
|
||
| Set access control permissions for a resource. | ||
| Get ACL entries for a resource. | ||
|
|
||
| **Usage:** | ||
|
|
||
| ``` | ||
| fab acl set <path> [-I <identity>] [-R <role>] [-f] | ||
| fab acl get <path> [-q QUERY] | ||
| ``` | ||
|
|
||
| **Parameters:** | ||
|
|
||
| - `<path>`: Path to the resource. | ||
| - `-I, --identity`: Object ID of the Microsoft Entra identity to set or update. | ||
| - `-R, --role`: ACL role (admin, member, contributor, viewer). | ||
| - `-f, --force`: Skip confirmation prompt. Optional. | ||
| - `<path>`: Resource path | ||
| - `-q, --query`: JMESPath query to filter and project fields. Optional. | ||
|
|
||
| **Examples:** | ||
|
|
||
| ``` | ||
| fab acl set ws1.Workspace/lh1.Lakehouse -I 11111111-2222-3333-4444-555555555555 -R viewer | ||
| ```bash | ||
| # Get all ACL entries | ||
| fab acl get ws1.Workspace | ||
|
|
||
| # Query specific roles | ||
| fab acl get ws1.Workspace -q "[?role=='Admin']" | ||
|
|
||
| # Project role information | ||
| fab acl get ws1.Workspace -q "[].role" | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### rm (del) | ||
| ### set | ||
|
|
||
| Remove access permissions for an identity. | ||
| Set an ACL entry for a resource. | ||
|
|
||
| **Usage:** | ||
|
|
||
| ``` | ||
| fab acl rm <path> [-I <identity>] [-f] | ||
| fab acl set <path> --identity ID --role ROLE [-f] | ||
| ``` | ||
|
|
||
| **Parameters:** | ||
|
|
||
| - `<path>`: Path to the resource. | ||
| - `-I, --identity`: Object ID of the Microsoft Entra identity to remove. | ||
| - `<path>`: Resource path | ||
| - `--identity`: Principal ID (user ID, service principal ID, or security group ID) | ||
| - `--role`: Role to assign (e.g., Admin, Member, Viewer) | ||
| - `-f, --force`: Skip confirmation prompt. Optional. | ||
|
|
||
| **Examples:** | ||
|
|
||
| ``` | ||
| fab acl rm ws1.Workspace/lh1.Lakehouse -I 11111111-2222-3333-4444-555555555555 | ||
| ```bash | ||
| # Set member role for a user | ||
| fab acl set ws1.Workspace --identity "user@contoso.com" --role Member | ||
|
|
||
| # Set admin role for a service principal (force) | ||
| fab acl set ws1.Workspace --identity "00000000-0000-0000-0000-000000000000" --role Admin -f | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### get | ||
| ### rm | ||
|
|
||
| Get detailed ACL information with optional filtering. | ||
| Remove an ACL entry from a resource. | ||
|
|
||
| **Usage:** | ||
|
|
||
| ``` | ||
| fab acl get <path> [-q <query>] [-o <output_path>] | ||
| fab acl rm <path> --identity ID [-f] | ||
| ``` | ||
|
|
||
| **Parameters:** | ||
|
|
||
| - `<path>`: Path to the resource. | ||
| - `-q, --query`: JMESPath query to filter results. Optional. | ||
| - `-o, --output`: Output path for results. Optional. | ||
| - `<path>`: Resource path | ||
| - `--identity`: Principal ID to remove | ||
| - `-f, --force`: Skip confirmation prompt. Optional. | ||
|
|
||
| **Examples:** | ||
|
|
||
| ``` | ||
| fab acl get ws1.Workspace | ||
| ``` | ||
|
|
||
| --- | ||
| ```bash | ||
| # Remove ACL entry for a user | ||
| fab acl rm ws1.Workspace --identity "user@contoso.com" | ||
|
|
||
| For more examples and detailed scenarios, see [ACLs Examples](../../examples/acl_examples.md). | ||
| # Force remove ACL entry | ||
| fab acl rm ws1.Workspace --identity "00000000-0000-0000-0000-000000000000" -f | ||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.