AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

azure-mgmt-apimanagement-dotnet

Azure Resource Manager SDK for API Management in .NET. Use for MANAGEMENT PLANE operations: creating/managing APIM services, APIs, products, subscriptions, policies, users, groups, gateways, and backends via Azure Resource Manager. Triggers: "API Management", "APIM service", "create APIM", "manage APIs", "ApiManagementServiceResource", "API policies", "APIM products", "APIM subscriptions".

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read microsoft--azure-mgmt-apimanagement-dotnet at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 4

references/service-management.md

Service Management

Detailed patterns for managing API Management service instances.

Get Existing Service

// By resource group
var service = await resourceGroup.Value
    .GetApiManagementServiceAsync("my-apim-service");

// By resource ID
var serviceId = ApiManagementServiceResource.CreateResourceIdentifier(
    subscriptionId, "my-resource-group", "my-apim-service");
var service = armClient.GetApiManagementServiceResource(serviceId);
service = await service.GetAsync();

List Services

// In resource group
await foreach (var service in resourceGroup.Value.GetApiManagementServices())
{
    Console.WriteLine($"{service.Data.Name}: {service.Data.Location}");
}

// In subscription
await foreach (var service in subscription.GetApiManagementServicesAsync())
{
    Console.WriteLine($"{service.Data.Name}: {service.Data.ResourceGroupName}");
}

Update Service

var patch = new ApiManagementServicePatch
{
    PublisherName = "Updated Publisher",
    Tags = { ["environment"] = "production" }
};

var operation = await service.UpdateAsync(WaitUntil.Completed, patch);

Delete Service

await service.DeleteAsync(WaitUntil.Completed);

SKU Configuration

// Developer (for testing)
var devSku = new ApiManagementServiceSkuProperties(
    ApiManagementServiceSkuType.Developer, capacity: 1);

// Standard with multiple units
var standardSku = new ApiManagementServiceSkuProperties(
    ApiManagementServiceSkuType.Standard, capacity: 2);

// Premium with availability zones
var premiumData = new ApiManagementServiceData(
    location: AzureLocation.EastUS,
    sku: new ApiManagementServiceSkuProperties(
        ApiManagementServiceSkuType.Premium, capacity: 3),
    publisherEmail: "[email protected]",
    publisherName: "Contoso")
{
    Zones = { "1", "2", "3" }
};

Virtual Network Integration

var serviceData = new ApiManagementServiceData(
    location: AzureLocation.EastUS,
    sku: new ApiManagementServiceSkuProperties(
        ApiManagementServiceSkuType.Premium, capacity: 1),
    publisherEmail: "[email protected]",
    publisherName: "Contoso")
{
    VirtualNetworkType = VirtualNetworkType.External,
    VirtualNetworkConfiguration = new VirtualNetworkConfiguration
    {
        SubnetResourceId = new ResourceIdentifier(
            "/subscriptions/.../subnets/apim-subnet")
    }
};

Custom Domains

var serviceData = new ApiManagementServiceData(...)
{
    HostnameConfigurations =
    {
        new HostnameConfiguration(HostnameType.Proxy)
        {
            HostName = "api.contoso.com",
            CertificateSource = CertificateSource.KeyVault,
            KeyVaultSecretUri = new Uri("https://myvault.vault.azure.net/secrets/api-cert")
        },
        new HostnameConfiguration(HostnameType.DeveloperPortal)
        {
            HostName = "developer.contoso.com",
            CertificateSource = CertificateSource.KeyVault,
            KeyVaultSecretUri = new Uri("https://myvault.vault.azure.net/secrets/portal-cert")
        }
    }
};

Managed Identity

var serviceData = new ApiManagementServiceData(...)
{
    Identity = new ManagedServiceIdentity(ManagedServiceIdentityType.SystemAssigned)
};

// Or user-assigned
var serviceData = new ApiManagementServiceData(...)
{
    Identity = new ManagedServiceIdentity(ManagedServiceIdentityType.UserAssigned)
    {
        UserAssignedIdentities =
        {
            [new ResourceIdentifier("/subscriptions/.../userAssignedIdentities/my-identity")] = 
                new UserAssignedIdentity()
        }
    }
};

Get Service Information

// Get gateway URL
Console.WriteLine($"Gateway: {service.Data.GatewayUri}");

// Get portal URL
Console.WriteLine($"Portal: {service.Data.DeveloperPortalUri}");

// Get management API URL
Console.WriteLine($"Management: {service.Data.ManagementApiUri}");

// Get provisioning state
Console.WriteLine($"State: {service.Data.ProvisioningState}");