Skip to main content
Glama

Azure MCP Server

Official
MIT License
1,161
  • Linux
  • Apple
ComputeUsageChecker.cs1.46 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Compute; using Azure.ResourceManager.Compute.Models; using Microsoft.Extensions.Logging; namespace AzureMcp.Quota.Services.Util; public class ComputeUsageChecker(TokenCredential credential, string subscriptionId, ILogger<ComputeUsageChecker> logger) : AzureUsageChecker(credential, subscriptionId, logger) { public override async Task<List<UsageInfo>> GetUsageForLocationAsync(string location) { try { var subscription = ResourceClient.GetSubscriptionResource(new ResourceIdentifier($"/subscriptions/{SubscriptionId}")); var usages = subscription.GetUsagesAsync(location); var result = new List<UsageInfo>(); await foreach (ComputeUsage item in usages) { result.Add(new UsageInfo( Name: item.Name?.LocalizedValue ?? item.Name?.Value ?? string.Empty, Limit: (int)item.Limit, Used: (int)item.CurrentValue, Unit: item.Unit.ToString() )); } return result; } catch (Exception error) { throw new InvalidOperationException("Failed to fetch Compute quotas. Please check your subscription permissions and service availability.", error); } } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Azure/azure-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server