Skip to content

Feature: Replace all ARM resource write operations with the Azure.ResourceManager library to reduce tool size #281

@alzimmermsft

Description

@alzimmermsft

Proposal

This is a proposal to reduce the size of the AzureMCP server.
The GenericResource class in the Azure.ResourceManager library supports Create, Update, and Delete operations for any ARM resource type, making it a flexible alternative to using specific Azure.ResourceManager.XXX libraries in individual tools.

Details

Current Approach

Each tool currently relies on its corresponding .NET management library to Create, Update, or Delete Azure resource data. For example, the azmcp_foundry_models_deploy tool uses the Azure.ResourceManager.CognitiveServices library. If we introduce a new tool, such as one to create Starage Disk, we would need to add a dependency on Azure.ResourceManager.Storage.

As more tools are added, the number of Azure management .NET SDKs integrated into the project will grow, leading to a continuous increase in the size of the AzureMCP server.

Proposed Optimization

The GenericResource class in the Azure.ResourceManager library supports Create, Update, and Delete operations for any ARM resource. It can be used to replace the write operations currently handled by individual service-specific libraries. For instance, the azmcp_foundry_models_deploy tool can be refactored to use a GenericResource CreateOrUpdate instead of relying on the CognitiveServices SDK:

var createResult = await armClient.GetGenericResources().CreateOrUpdateAsync(WaitUntil.Completed, id, data);

Libraries to be removed

  • Azure.ResourceManager.CognitiveServices : 1.26 MB
  • Azure.ResourceManager.LoadTesting : 298 KB
  • Azure.ResourceManager.PostgreSql : 1.57 MB
  • Azure.ResourceManager.Storage : 1.67 MB
  • Azure.ResourceManager.ApplicationInsights : 852 KB

Pros & Cons

Pros

Reduced Server Size: Significantly decreases the overall size of the AzureMCP server by minimizing dependencies.

⚠️ Cons

Extra Input Model Required: No strongly typed models, additional code is needed to define input models.

Metadata

Metadata

Assignees

Labels

Engineering ExcellenceItems required to be resolved before onboarding the "third wave" of azure RPsserver-Azure.McpAzure.Mcp.Servertools-ARMARM Resource Management Group

Projects

Status

In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions