Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 17, 2025

Implements a new command to list paths within a specific directory in Azure Data Lake Storage Gen2, complementing the existing file-system level path listing.

Changes Made

Core Implementation

  • New Command: azmcp storage datalake directory list-paths
  • Parameters:
    • --account-name (required): Storage account name
    • --file-system-name (required): Data Lake file system name
    • --directory-name (required): Directory within the file system
    • --subscription (required): Azure subscription
    • --tenant (optional): Azure tenant ID

Technical Details

  • Added StorageOptionDefinitions.Directory option definition
  • Created BaseDirectoryOptions extending BaseFileSystemOptions
  • Implemented DirectoryListPathsCommand using DataLakeDirectoryClient.GetPathsAsync()
  • Added ListDataLakeDirectoryPaths() method to IStorageService and StorageService
  • Registered new command group directory under storage datalake

Key Difference from Existing Command

The existing azmcp storage datalake file-system list-paths lists all paths at the file system root level using DataLakeFileSystemClient. This new command uses DataLakeDirectoryClient to list paths within a specific directory, enabling more granular exploration of Data Lake hierarchies.

# Existing: List all paths in file system
azmcp storage datalake file-system list-paths --account-name myaccount --file-system-name myfs --subscription mysub

# New: List paths in specific directory  
azmcp storage datalake directory list-paths --account-name myaccount --file-system-name myfs --directory-name mydirectory --subscription mysub

Testing & Documentation

  • ✅ Comprehensive unit tests with parameter validation and error handling
  • ✅ Integration test added to existing Storage live test suite
  • ✅ Updated azmcp-commands.md with command syntax and examples
  • ✅ Added example prompts to README.md and e2eTestPrompts.md
  • ✅ Updated CHANGELOG.md with feature description

Result Format

Returns the same DataLakePathInfo structure as the file-system command:

{
  "paths": [
    {
      "name": "subdirectory1",
      "type": "directory", 
      "size": null,
      "lastModified": "2024-01-01T00:00:00Z",
      "etag": "\"0x8D123456789ABCD\""
    },
    {
      "name": "file1.txt",
      "type": "file",
      "size": 1024,
      "lastModified": "2024-01-01T00:00:00Z", 
      "etag": "\"0x8D123456789ABCE\""
    }
  ]
}

Fixes #638.

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
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • 1p7vsblobprodcus324.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • 4zjvsblobprodcus390.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • 7tjvsblobprodcus341.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • d0svsblobprodcus381.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • fdpvsblobprodcus345.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • gbsvsblobprodcus365.vsblob.vsassets.io
    • Triggering command: dotnet restore --no-cache (dns block)
  • gervsblobprodcus329.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • h6tvsblobprodcus346.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
  • imzvsblobprodcus368.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • jrqvsblobprodcus343.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • k0ivsblobprodcus356.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
  • k4kvsblobprodcus344.vsblob.vsassets.io
    • Triggering command: dotnet restore --no-cache (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • kh4vsblobprodcus325.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • kxqvsblobprodcus376.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • l7avsblobprodcus319.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • ljcvsblobprodcus317.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
  • m16vsblobprodcus374.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • pdfvsblobprodcus380.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • pe3vsblobprodcus354.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • pe4vsblobprodcus351.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
  • rcxvsblobprodcus328.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • sqdvsblobprodcus333.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • st8vsblobprodcus339.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • u3hvsblobprodcus371.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • ukkvsblobprodcus352.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)
  • x3yvsblobprodcus370.vsblob.vsassets.io
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet restore --no-cache (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Add azmcp storage datalake directory list-paths command Add azmcp storage datalake directory list-paths command Jul 17, 2025
@Copilot Copilot AI requested a review from xiangyan99 July 17, 2025 19:41
Copilot finished work on behalf of xiangyan99 July 17, 2025 19:41
ValidateRequiredParameters(accountName, fileSystemName, directoryName, subscriptionId);

var dataLakeServiceClient = await CreateDataLakeServiceClient(accountName, tenant, retryPolicy);
var fileSystemClient = dataLakeServiceClient.GetFileSystemClient(fileSystemName);
Copy link
Member

Choose a reason for hiding this comment

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

This should be using GetDirectoryClient(directoryName)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6ca4341. Updated the StorageService to use dataLakeServiceClient.GetDirectoryClient(fileSystemName, directoryName) directly instead of going through the file system client.


public async Task<List<DataLakePathInfo>> ListDataLakeDirectoryPaths(
string accountName,
string fileSystemName,
Copy link
Member

Choose a reason for hiding this comment

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

ListDataLakeDirectoryPaths does not need the input fileSystemName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 00c8399. Removed the fileSystemName parameter and updated the method to accept a directoryPath that includes the file system (e.g., "filesystem/directory"). The method now parses this path internally to extract the file system and directory components.

# List paths in a Data Lake directory
azmcp storage datalake directory list-paths --subscription <subscription> \
--account-name <account-name> \
--file-system-name <file-system-name> \
Copy link
Member

Choose a reason for hiding this comment

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

file-system-name is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 00c8399. Removed the --file-system-name parameter from the command. The directory-name parameter now accepts a full path including the file system (e.g., "filesystem/directory").

@Copilot Copilot AI requested a review from xiangyan99 July 17, 2025 19:49
Copilot finished work on behalf of xiangyan99 July 17, 2025 19:49
RetryPolicyOptions? retryPolicy = null);
Task<List<DataLakePathInfo>> ListDataLakeDirectoryPaths(
string accountName,
string fileSystemName,
Copy link
Member

Choose a reason for hiding this comment

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

fileSystemName is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've already removed the fileSystemName parameter from the interface in commit 00c8399. The method now takes a directoryPath parameter that includes both filesystem and directory (e.g., "filesystem/directory"). Internally, we parse this to get the fileSystemName and directoryName for the Azure SDK's GetDirectoryClient method. Could you clarify what specific fileSystemName reference should be removed?

@Copilot Copilot AI requested a review from xiangyan99 July 17, 2025 19:59
Copilot finished work on behalf of xiangyan99 July 17, 2025 19:59
Copilot finished work on behalf of xiangyan99 July 17, 2025 20:12
@xiangyan99 xiangyan99 closed this Jul 17, 2025
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Azure MCP Server (OLD) Jul 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add azmcp storage datalake directory list-paths command
2 participants