Skill

Manage Azure API Center Resources Programmatically

.NET management SDK for Azure API Center - a centralized API inventory with workspaces, versions, and governance metadata.

Works with azure

91
Spark score
out of 100
Updated 21 days ago
Version 14.1.0

Add to Favorites

Why it matters

Automate the management of your organization's API inventory and governance using the Azure API Center SDK for .NET. Define, deploy, and govern your APIs programmatically.

Outcomes

What it gets done

01

Create and manage API Center services, workspaces, and APIs.

02

Define API versions, specifications, and deployments.

03

Configure environments and upload API specifications.

04

Programmatically manage API metadata and lifecycle stages.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-azure-mgmt-apicenter-dotnet | bash

Overview

Azure.ResourceManager.ApiCenter (.NET)

.NET management SDK for Azure API Center, covering the full resource hierarchy (service, workspace, API, version, definition, environment, deployment, metadata schema), OpenAPI spec import/export, and lifecycle-stage governance for a centralized API inventory. Use when building or automating a centralized, governed API catalog tracking APIs, versions, specifications, and deployments across an organization.

What it does

This skill provisions and manages Azure API Center resources - a centralized API inventory and governance service - via Azure Resource Manager using Azure.ResourceManager.ApiCenter (v1.0.0 GA, API version 2024-03-01) plus Azure.Identity for DefaultAzureCredential auth through an ArmClient. It documents the full resource hierarchy: Subscription → ResourceGroup → ApiCenterService (the inventory service itself, created with a ManagedServiceIdentity) → Workspace (a logical grouping of APIs, e.g. by team) → Api (with title, description, ApiKind - rest/graphql/grpc/soap/webhook/websocket/mcp - ApiLifecycleStage, terms of service, external docs, and contacts) → ApiVersionApiDefinition (the actual OpenAPI/GraphQL/etc. specification), alongside sibling Environment (a deployment target like dev/staging/prod, with onboarding instructions and portal URIs) and Deployment (an API linked to a specific environment and definition, with a runtime URI) resources, plus service-level MetadataSchema resources for custom governance metadata. Ten core workflows are shown end to end: create the API Center service, create a workspace, create an API (including custom properties via BinaryData.FromObjectAsJson), create an API version, create an API definition and import its OpenAPI spec inline, export a stored specification back out, create an environment, create a deployment linking an environment and a definition by resource ID, create a JSON-Schema-based metadata schema (e.g. requiring a team property, with optional costCenter and an enum dataClassification) assigned to the API entity type, and list/search APIs, their versions, environments, and deployments via async enumeration. Error handling distinguishes 409 (conflicting existing API) and 400 (invalid request) via RequestFailedException. Best practices: organize APIs into workspaces by team/domain/product, use metadata schemas for governance, keep lifecycle stages current as APIs progress from design to production to deprecated/retired, document environments with onboarding instructions, version consistently, import real specifications for discoverability, link deployments to their runtime environments, and use managed identity for secure integrations.

When to use - and when NOT to

Use this skill when building or automating a centralized API catalog for API governance - registering APIs, versions, and specifications, tracking their lifecycle stage, defining custom metadata schemas for compliance, or linking APIs to deployment environments. It is not an API gateway or runtime policy engine (that's the separate Azure.ResourceManager.ApiManagement SDK) - API Center is a design-time inventory and governance layer, not a request-routing or rate-limiting service.

Inputs and outputs

Input is API metadata (title, kind, lifecycle stage, contacts), OpenAPI/GraphQL specification content, environment and deployment details, and custom metadata schema definitions. Output is created/updated API Center resources (service, workspace, API, version, definition, environment, deployment, metadata schema) and, for export operations, the specification content itself. Resource targeting is configured via AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP, and AZURE_APICENTER_SERVICE_NAME.

Integrations

Built on Azure Resource Manager via Azure.ResourceManager.ApiCenter, authenticated with Azure Identity's DefaultAzureCredential, complementary to Azure.ResourceManager.ApiManagement for the runtime API gateway layer.

dotnet add package Azure.ResourceManager.ApiCenter

Who it's for

.NET developers and platform teams building a centralized, governed API inventory - tracking APIs, versions, specifications, environments, and deployments with custom metadata across an organization.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.