Skip to main content
Glama

Azure MCP Server

Official
MIT License
1,161
  • Linux
  • Apple
DatadogService.cs1.64 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Azure.Core; using Azure.ResourceManager.Datadog; using AzureMcp.Core.Services.Azure; using AzureMcp.Core.Services.Azure.Tenant; namespace AzureMcp.AzureIsv.Services.Datadog; public partial class DatadogService : BaseAzureService, IDatadogService { public DatadogService(ITenantService? tenantService = null) : base(tenantService) { } public async Task<List<string>> ListMonitoredResources(string resourceGroup, string subscription, string datadogResource) { try { var tenantId = await ResolveTenantIdAsync(null); var armClient = await CreateArmClientAsync(tenant: tenantId, retryPolicy: null); var resourceId = $"/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Datadog/monitors/{datadogResource}"; ResourceIdentifier id = new ResourceIdentifier(resourceId); var datadogMonitorResource = armClient.GetDatadogMonitorResource(id); var monitoredResources = datadogMonitorResource.GetMonitoredResources(); var resourceList = new List<string>(); foreach (var resource in monitoredResources) { var resourceIdSegments = resource.Id.ToString().Split('/'); var lastSegment = resourceIdSegments[^1]; resourceList.Add(lastSegment); } return resourceList; } catch (Exception ex) { throw new Exception($"Error listing monitored resources: {ex.Message}", ex); } } }

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