-
Notifications
You must be signed in to change notification settings - Fork 340
Add azmcp storage datalake directory list-paths command #632
Conversation
…list-paths command Co-authored-by: xiangyan99 <[email protected]>
Co-authored-by: xiangyan99 <[email protected]>
…command Co-authored-by: xiangyan99 <[email protected]>
/mnt/vss/_work/1/s/src/Areas/Storage/Commands/DataLake/Directory/BaseDirectoryCommand.cs(30,2): error FINALNEWLINE: Fix final newline. Insert '\n'. [/mnt/vss/_work/1/s/src/AzureMcp.csproj] |
Co-authored-by: xiangyan99 <[email protected]>
Fixed the final newline formatting issues in all mentioned files. Added missing newlines to comply with .editorconfig rules. Commit e158737 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
dotnet-install.sh
Outdated
;; | ||
esac | ||
|
||
echo true |
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.
We don't need this file.
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.
Removed the dotnet-install.sh file as it's not needed. Commit d6f1538
Co-authored-by: xiangyan99 <[email protected]>
/mnt/vss/_work/1/s/src/Areas/Storage/Commands/DataLake/Directory/DirectoryListPathsCommand.cs(59,29): error CS1503: Argument 1: cannot convert from 'AzureMcp.Models.Command.CommandResponse' to 'AzureMcp.Models.Command.CommandContext' [/mnt/vss/_work/1/s/src/AzureMcp.csproj] |
Co-authored-by: xiangyan99 <[email protected]>
Fixed the compilation error by correcting the HandleException call to pass the CommandContext instead of CommandResponse. Commit 7f98c2f |
/azp run azure - mcp |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
What's the difference between using the new command and the one that uses file-system? Shouldn't the new one take --directory
instead?
You're absolutely right. The current implementation is confusing because both commands do exactly the same thing - they list all paths in the entire file system. A proper directory command should indeed take a Would you like me to modify the directory command to:
I've implemented your suggestion! The directory command now accepts an optional The commands are now meaningfully different:
Updated implementation, tests, and documentation included. Commit 9e6106b |
|
Don't do it. |
Co-authored-by: vcolin7 <[email protected]>
context.Activity?.WithSubscriptionTag(options); | ||
|
||
var storageService = context.GetService<IStorageService>(); | ||
var paths = await storageService.ListDataLakePaths( |
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.
We need a new method in storageService to list datalake directly paths.
It calls dataLakeServiceClient.GetDirectoryClient instead of dataLakeServiceClient.GetFileSystemClient.
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've reviewed the Azure Data Lake Storage Gen2 SDK, and DataLakeDirectoryClient
doesn't have a GetPathsAsync()
method. This method is only available on DataLakeFileSystemClient
.
The current implementation already uses the correct approach - fileSystemClient.GetPathsAsync(path: directoryPath)
to list paths within a specific directory.
Could you clarify what specific functionality you'd like the directory client to provide? The DataLakeDirectoryClient
is primarily for directory operations (create, delete, properties) rather than listing contents.
Understood. I've reverted the directory parameter changes. The commands now maintain their original behavior where both provide the same functionality - they are different command hierarchies for the same underlying Data Lake operation. Commit in progress.
Reverted as requested. The directory command now maintains the original implementation without the directory parameter, providing the same functionality as the file-system command. Commit in progress. |
This PR implements the
azmcp storage datalake directory list-paths
command as requested in issue #631, providing an alternative command hierarchy for Data Lake Storage Gen2 operations.Changes Made
New Command Implementation
azmcp storage datalake directory list-paths
--subscription
(required): Azure subscription ID or name--account-name
(required): Storage account name--file-system-name
(required): Data Lake file system nameFiles Added
src/Areas/Storage/Commands/DataLake/Directory/BaseDirectoryCommand.cs
- Base command class for directory operationssrc/Areas/Storage/Commands/DataLake/Directory/DirectoryListPathsCommand.cs
- Main command implementationsrc/Areas/Storage/Options/DataLake/BaseDirectoryOptions.cs
- Base options class for directory commandssrc/Areas/Storage/Options/DataLake/Directory/DirectoryListPathsOptions.cs
- Specific options for the list-paths commandtests/Areas/Storage/UnitTests/DataLake/Directory/DirectoryListPathsCommandTests.cs
- Comprehensive unit testsFiles Modified
src/Areas/Storage/StorageSetup.cs
- Added directory command group registrationsrc/Areas/Storage/Commands/StorageJsonContext.cs
- Added JSON serialization supporttests/Areas/Storage/LiveTests/StorageCommandTests.cs
- Added integration testCHANGELOG.md
- Added feature entryREADME.md
- Added example promptsdocs/azmcp-commands.md
- Added command documentatione2eTests/e2eTestPrompts.md
- Added test promptsCommand Comparison
Both commands provide identical functionality but offer different command hierarchies to better align with user expectations and Data Lake Storage Gen2 terminology.
Testing
Fixes #631.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
1oavsblobprodcus350.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)1p7vsblobprodcus324.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)2kmvsblobprodcus39.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)4zjvsblobprodcus390.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)7tjvsblobprodcus341.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)d0svsblobprodcus381.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)fdpvsblobprodcus345.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)gervsblobprodcus329.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)h6tvsblobprodcus346.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)ibzvsblobprodcus369.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)imzvsblobprodcus368.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)jrqvsblobprodcus343.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)k0ivsblobprodcus356.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)kh4vsblobprodcus325.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)kxqvsblobprodcus376.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)l7avsblobprodcus319.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)ljcvsblobprodcus317.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)m16vsblobprodcus374.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)pdfvsblobprodcus380.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)pe3vsblobprodcus354.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)pe4vsblobprodcus351.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)rcxvsblobprodcus328.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)sqdvsblobprodcus333.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)st8vsblobprodcus339.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)u3hvsblobprodcus371.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)ukkvsblobprodcus352.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)x3yvsblobprodcus370.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)xupvsblobprodcus332.vsblob.vsassets.io
dotnet build --verbosity minimal
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.