Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The Azure MCP Server updates automatically by default whenever a new release com

### Breaking Changes

- Renamed the following Storage tool option names: [[#1015](https://github.com/Azure/azure-mcp/pull/1015)]
- Renamed `azmcp-storage-account-create` `account-name` to `account`.
- Renamed `azmcp-storage-blob-batch-set-tier` `blob-names` to `blobs`.

### Bugs Fixed

- Fixed SQL service test assertions to use case-insensitive string comparisons for resource type validation. [[#938](https://github.com/Azure/azure-mcp/pull/938)]
Expand All @@ -21,6 +25,7 @@ The Azure MCP Server updates automatically by default whenever a new release com
- Removed dependency on `Azure.ResourceManager.Sql` package by migrating to Azure Resource Graph queries, reducing package size and improving startup performance.
- Enhanced `BaseAzureService` with `EscapeKqlString` method for safe KQL query construction across all Azure services. [[#938](https://github.com/Azure/azure-mcp/pull/938)]
- Fixed KQL string escaping in Workbooks service queries.
- Standardized Azure Storage command descriptions, option names, and parameter names for consistency across all storage commands. Updated JSON serialization context to remove unused model types and improve organization. [[#1015](https://github.com/Azure/azure-mcp/pull/1015)]

## 0.5.7 (2025-08-19)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using AzureMcp.Core.Commands;
using AzureMcp.Core.Commands.Subscription;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Models;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Account;
Expand All @@ -18,7 +17,7 @@ public sealed class AccountCreateCommand(ILogger<AccountCreateCommand> logger) :
private readonly ILogger<AccountCreateCommand> _logger = logger;

// Define options from OptionDefinitions
private readonly Option<string> _accountNameOption = StorageOptionDefinitions.AccountNameForCreate;
private readonly Option<string> _accountCreateOption = StorageOptionDefinitions.AccountCreate;
private readonly Option<string> _locationOption = StorageOptionDefinitions.Location;
private readonly Option<string> _skuOption = StorageOptionDefinitions.Sku;
private readonly Option<string> _kindOption = StorageOptionDefinitions.Kind;
Expand All @@ -34,17 +33,6 @@ public sealed class AccountCreateCommand(ILogger<AccountCreateCommand> logger) :
Create a new Azure Storage account in the specified resource group and location.
Creates a storage account with the specified configuration options. Returns the
created storage account information including name, location, SKU, and other properties.
Required options:
- account-name: The globally unique name for the storage account
- resource-group: The resource group where the account will be created
- location: The Azure region for the storage account
Optional options:
- sku: Storage account SKU (default: Standard_LRS)
- kind: Storage account kind (default: StorageV2)
- access-tier: Default access tier for blobs (default: Hot)
- enable-https-traffic-only: Require HTTPS (default: true)
- allow-blob-public-access: Allow public blob access (default: false)
- enable-hierarchical-namespace: Enable Data Lake Storage Gen2 (default: false)
""";

public override string Title => CommandTitle;
Expand All @@ -58,7 +46,7 @@ Creates a storage account with the specified configuration options. Returns the
protected override void RegisterOptions(Command command)
{
base.RegisterOptions(command);
command.AddOption(_accountNameOption);
command.AddOption(_accountCreateOption);
RequireResourceGroup();
command.AddOption(_locationOption);
command.AddOption(_skuOption);
Expand All @@ -72,7 +60,7 @@ protected override void RegisterOptions(Command command)
protected override AccountCreateOptions BindOptions(ParseResult parseResult)
{
var options = base.BindOptions(parseResult);
options.AccountName = parseResult.GetValueForOption(_accountNameOption);
options.Account = parseResult.GetValueForOption(_accountCreateOption);
options.Location = parseResult.GetValueForOption(_locationOption);
options.Sku = parseResult.GetValueForOption(_skuOption);
options.Kind = parseResult.GetValueForOption(_kindOption);
Expand Down Expand Up @@ -100,7 +88,7 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,

// Call service to create storage account
var account = await storageService.CreateStorageAccount(
options.AccountName!,
options.Account!,
options.ResourceGroup!,
options.Location!,
options.Subscription!,
Expand All @@ -122,8 +110,8 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,
{
// Log error with all relevant context
_logger.LogError(ex,
"Error creating storage account. Account: {AccountName}, ResourceGroup: {ResourceGroup}, Location: {Location}, Options: {@Options}",
options.AccountName, options.ResourceGroup, options.Location, options);
"Error creating storage account. Account: {Account}, ResourceGroup: {ResourceGroup}, Location: {Location}, Options: {@Options}",
options.Account, options.ResourceGroup, options.Location, options);
HandleException(context, ex);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Text.Json.Serialization;
using AzureMcp.Core.Commands;
using AzureMcp.Core.Commands.Subscription;
using AzureMcp.Core.Models.Option;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Commands;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Account;
using AzureMcp.Storage.Services;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -89,5 +83,5 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,
};

// Strongly-typed result record
internal record AccountDetailsCommandResult(Storage.Models.StorageAccountInfo Account);
internal record AccountDetailsCommandResult(Models.StorageAccountInfo Account);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

using AzureMcp.Core.Commands;
using AzureMcp.Core.Commands.Subscription;
using AzureMcp.Core.Models.Option;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Options.Account;
using AzureMcp.Storage.Services;
using Microsoft.Extensions.Logging;
Expand All @@ -21,9 +19,8 @@ public sealed class AccountListCommand(ILogger<AccountListCommand> logger) : Sub
public override string Description =>
$"""
List all Storage accounts in a subscription. This command retrieves all Storage accounts available
in the specified {OptionDefinitions.Common.SubscriptionName}. Results are returned as a JSON array of
objects including common metadata (name, location, kind, skuName, skuTier, hnsEnabled, allowBlobPublicAccess,
enableHttpsTrafficOnly).
in the specified subscription. Results are returned as a JSON array of objects including common
metadata (name, location, kind, skuName, skuTier, hnsEnabled, allowBlobPublicAccess, enableHttpsTrafficOnly).
""";

public override string Title => CommandTitle;
Expand All @@ -48,7 +45,7 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,
options.RetryPolicy);

context.Response.Results = accounts?.Count > 0
? ResponseResult.Create<AccountListCommandResult>(new AccountListCommandResult(accounts), StorageJsonContext.Default.AccountListCommandResult)
? ResponseResult.Create(new AccountListCommandResult(accounts), StorageJsonContext.Default.AccountListCommandResult)
: null;
}
catch (Exception ex)
Expand All @@ -60,5 +57,5 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,
return context.Response;
}

internal record AccountListCommandResult(List<Storage.Models.StorageAccountInfo> Accounts);
internal record AccountListCommandResult(List<Models.StorageAccountInfo> Accounts);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Commands.Blob.Container;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Blob.Batch;
Expand All @@ -17,16 +16,15 @@ public sealed class BatchSetTierCommand(ILogger<BatchSetTierCommand> logger) : B
private readonly ILogger<BatchSetTierCommand> _logger = logger;

private readonly Option<string> _tierOption = StorageOptionDefinitions.Tier;
private readonly Option<string[]> _blobNamesOption = StorageOptionDefinitions.BlobNames;
private readonly Option<string[]> _blobsOption = StorageOptionDefinitions.Blobs;

public override string Name => "set-tier";

public override string Description =>
$"""
Set access tier for multiple blobs in a single batch operation. This tool efficiently changes the
storage tier for multiple blobs simultaneously in a single request. Different tiers offer different
trade-offs between storage costs, access costs, and retrieval latency. Requires {StorageOptionDefinitions.AccountName},
{StorageOptionDefinitions.ContainerName}, {StorageOptionDefinitions.TierName}, and {StorageOptionDefinitions.BlobNames}.
trade-offs between storage costs, access costs, and retrieval latency.
""";

public override string Title => CommandTitle;
Expand All @@ -37,14 +35,14 @@ protected override void RegisterOptions(Command command)
{
base.RegisterOptions(command);
command.AddOption(_tierOption);
command.AddOption(_blobNamesOption);
command.AddOption(_blobsOption);
}

protected override BatchSetTierOptions BindOptions(ParseResult parseResult)
{
var options = base.BindOptions(parseResult);
options.Tier = parseResult.GetValueForOption(_tierOption);
options.BlobNames = parseResult.GetValueForOption(_blobNamesOption);
options.BlobNames = parseResult.GetValueForOption(_blobsOption);
return options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using Azure.Storage.Blobs.Models;
using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Blob;
using AzureMcp.Storage.Services;
Expand All @@ -21,8 +20,7 @@ public sealed class BlobDetailsCommand(ILogger<BlobDetailsCommand> logger) : Bas
public override string Description =>
$"""
Get blob properties, metadata, and general information. This tool retrieves blob configuration including metadata properties,
approximate size, and last modification time information. Returns blob properties as JSON. Requires {StorageOptionDefinitions.AccountName},
{StorageOptionDefinitions.ContainerName}, and {StorageOptionDefinitions.BlobName}.
approximate size, and last modification time information. Returns blob properties as JSON.
""";

public override string Title => CommandTitle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Licensed under the MIT License.

using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Commands.Blob.Container;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Blob;
using AzureMcp.Storage.Services;
using Microsoft.Extensions.Logging;
Expand All @@ -22,8 +20,7 @@ public sealed class BlobListCommand(ILogger<BlobListCommand> logger) : BaseConta
$"""
List all blobs in a Storage container. This command retrieves and displays all blobs available
in the specified container and Storage account. Results include blob names, sizes, and content types,
returned as a JSON array. Requires {StorageOptionDefinitions.AccountName} and
{StorageOptionDefinitions.ContainerName}.
returned as a JSON array.
""";

public override string Title => CommandTitle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using Azure.Storage.Blobs.Models;
using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Blob.Container;
using AzureMcp.Storage.Services;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Text.Json.Serialization;
using Azure.Storage.Blobs.Models;
using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Blob.Container;
using AzureMcp.Storage.Services;
Expand All @@ -22,7 +21,6 @@ public sealed class ContainerDetailsCommand(ILogger<ContainerDetailsCommand> log
public override string Description =>
$"""
Get detailed properties of a storage container including metadata, lease status, and access level.
Requires {StorageOptionDefinitions.AccountName} and {StorageOptionDefinitions.ContainerName}.
""";

public override string Title => CommandTitle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Blob.Container;
using AzureMcp.Storage.Services;
Expand All @@ -21,7 +20,6 @@ public sealed class ContainerListCommand(ILogger<ContainerListCommand> logger) :
$"""
List all containers in a Storage account. This command retrieves and displays all containers available
in the specified account. Results include container names and are returned as a JSON array.
Requires {StorageOptionDefinitions.AccountName}.
""";

public override string Title => CommandTitle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Models;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.DataLake.Directory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Models;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.DataLake.FileSystem;
Expand All @@ -22,8 +21,7 @@ public sealed class FileSystemListPathsCommand(ILogger<FileSystemListPathsComman
"""
List paths in a Data Lake file system. This command retrieves and displays paths (files and directories)
available in the specified Data Lake file system within the storage account. Results include path names,
types (file or directory), and metadata, returned as a JSON array. Requires account and file-system.
Optional filter-path can be used to filter results and recursive to include all subdirectories.
types (file or directory), and metadata, returned as a JSON array.
""";

public override string Title => CommandTitle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Models;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Queue.Message;
Expand All @@ -18,16 +17,17 @@ public sealed class QueueMessageSendCommand(ILogger<QueueMessageSendCommand> log
private readonly ILogger<QueueMessageSendCommand> _logger = logger;

// Define options from OptionDefinitions
private readonly Option<string> _messageContentOption = StorageOptionDefinitions.MessageContentOption;
private readonly Option<int?> _timeToLiveOption = StorageOptionDefinitions.TimeToLiveInSecondsOption;
private readonly Option<int?> _visibilityTimeoutOption = StorageOptionDefinitions.VisibilityTimeoutInSecondsOption;
private readonly Option<string> _messageOption = StorageOptionDefinitions.Message;
private readonly Option<int?> _timeToLiveOption = StorageOptionDefinitions.TimeToLiveInSeconds;
private readonly Option<int?> _visibilityTimeoutOption = StorageOptionDefinitions.VisibilityTimeoutInSeconds;

public override string Name => "send";

public override string Description =>
"""
Send messages to an Azure Storage queue for asynchronous processing. This tool sends a message to a specified queue with optional time-to-live and visibility delay settings.
Messages are returned with receipt handles for tracking. Returns a QueueMessageSendResult object containing message ID, insertion time, expiration time, pop receipt,
Send messages to an Azure Storage queue for asynchronous processing. This tool sends a message to a specified queue
with optional time-to-live and visibility delay settings. Messages are returned with receipt handles for tracking.
Returns a QueueMessageSendResult object containing message ID, insertion time, expiration time, pop receipt,
next visible time, and message content.
""";

Expand All @@ -42,15 +42,15 @@ public sealed class QueueMessageSendCommand(ILogger<QueueMessageSendCommand> log
protected override void RegisterOptions(Command command)
{
base.RegisterOptions(command);
command.AddOption(_messageContentOption);
command.AddOption(_messageOption);
command.AddOption(_timeToLiveOption);
command.AddOption(_visibilityTimeoutOption);
}

protected override QueueMessageSendOptions BindOptions(ParseResult parseResult)
{
var options = base.BindOptions(parseResult);
options.MessageContent = parseResult.GetValueForOption(_messageContentOption);
options.Message = parseResult.GetValueForOption(_messageOption);
options.TimeToLiveInSeconds = parseResult.GetValueForOption(_timeToLiveOption);
options.VisibilityTimeoutInSeconds = parseResult.GetValueForOption(_visibilityTimeoutOption);
return options;
Expand All @@ -75,7 +75,7 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,
var result = await service.SendQueueMessage(
options.Account!,
options.Queue!,
options.MessageContent!,
options.Message!,
options.TimeToLiveInSeconds,
options.VisibilityTimeoutInSeconds,
options.Subscription!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using AzureMcp.Core.Commands;
using AzureMcp.Core.Services.Telemetry;
using AzureMcp.Storage.Models;
using AzureMcp.Storage.Options;
using AzureMcp.Storage.Options.Share.File;
Expand All @@ -20,8 +19,9 @@ public sealed class FileListCommand(ILogger<FileListCommand> logger) : BaseFileC

public override string Description =>
$"""
Lists files and directories within a file share directory. This tool recursively lists all items in a specified file share directory,
including files, subdirectories, and their properties. Files and directories may be filtered by a prefix. Returns file listing as JSON.
Lists files and directories within a file share directory. This tool recursively lists all items in a specified
file share directory, including files, subdirectories, and their properties. Files and directories may be filtered
by a prefix. Returns file listing as JSON.
""";

public override string Title => CommandTitle;
Expand Down
Loading
Loading