[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-00ffc175-856d-4cd9-acbf-d8ed45c5fca2":3,"$fDFSNqFdRmtgiv-4kd6hKm9QOg3bZeCFRILC2xdpsQ6Y":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"00ffc175-856d-4cd9-acbf-d8ed45c5fca2","azure-mgmt-apicenter-dotnet","Azure API Center SDK for .NET。集中式API库存管理，包括治理、版本控制和发现。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: azure-mgmt-apicenter-dotnet\ndescription: Azure API Center SDK for .NET. Centralized API inventory management with governance, versioning, and discovery.\nrisk: unknown\nsource: community\ndate_added: '2026-02-27'\n---\n\n# Azure.ResourceManager.ApiCenter (.NET)\n\nCentralized API inventory and governance SDK for managing APIs across your organization.\n\n## Installation\n\n```bash\ndotnet add package Azure.ResourceManager.ApiCenter\ndotnet add package Azure.Identity\n```\n\n**Current Version**: v1.0.0 (GA)  \n**API Version**: 2024-03-01\n\n## Environment Variables\n\n```bash\nAZURE_SUBSCRIPTION_ID=\u003Cyour-subscription-id>\nAZURE_RESOURCE_GROUP=\u003Cyour-resource-group>\nAZURE_APICENTER_SERVICE_NAME=\u003Cyour-apicenter-service>\n```\n\n## Authentication\n\n```csharp\nusing Azure.Identity;\nusing Azure.ResourceManager;\nusing Azure.ResourceManager.ApiCenter;\n\nArmClient client = new ArmClient(new DefaultAzureCredential());\n```\n\n## Resource Hierarchy\n\n```\nSubscription\n└── ResourceGroup\n    └── ApiCenterService                    # API inventory service\n        ├── Workspace                       # Logical grouping of APIs\n        │   ├── Api                         # API definition\n        │   │   └── ApiVersion              # Version of the API\n        │   │       └── ApiDefinition       # OpenAPI\u002FGraphQL\u002Fetc specification\n        │   ├── Environment                 # Deployment target (dev\u002Fstaging\u002Fprod)\n        │   └── Deployment                  # API deployed to environment\n        └── MetadataSchema                  # Custom metadata definitions\n```\n\n## Core Workflows\n\n### 1. Create API Center Service\n\n```csharp\nusing Azure.ResourceManager.ApiCenter;\nusing Azure.ResourceManager.ApiCenter.Models;\n\nResourceGroupResource resourceGroup = await client\n    .GetDefaultSubscriptionAsync()\n    .Result\n    .GetResourceGroupAsync(\"my-resource-group\");\n\nApiCenterServiceCollection services = resourceGroup.GetApiCenterServices();\n\nApiCenterServiceData data = new ApiCenterServiceData(AzureLocation.EastUS)\n{\n    Identity = new ManagedServiceIdentity(ManagedServiceIdentityType.SystemAssigned)\n};\n\nArmOperation\u003CApiCenterServiceResource> operation = await services\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"my-api-center\", data);\n\nApiCenterServiceResource service = operation.Value;\n```\n\n### 2. Create Workspace\n\n```csharp\nApiCenterWorkspaceCollection workspaces = service.GetApiCenterWorkspaces();\n\nApiCenterWorkspaceData workspaceData = new ApiCenterWorkspaceData\n{\n    Title = \"Engineering APIs\",\n    Description = \"APIs owned by the engineering team\"\n};\n\nArmOperation\u003CApiCenterWorkspaceResource> operation = await workspaces\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"engineering\", workspaceData);\n\nApiCenterWorkspaceResource workspace = operation.Value;\n```\n\n### 3. Create API\n\n```csharp\nApiCenterApiCollection apis = workspace.GetApiCenterApis();\n\nApiCenterApiData apiData = new ApiCenterApiData\n{\n    Title = \"Orders API\",\n    Description = \"API for managing customer orders\",\n    Kind = ApiKind.Rest,\n    LifecycleStage = ApiLifecycleStage.Production,\n    TermsOfService = new ApiTermsOfService\n    {\n        Uri = new Uri(\"https:\u002F\u002Fexample.com\u002Fterms\")\n    },\n    ExternalDocumentation = \n    {\n        new ApiExternalDocumentation\n        {\n            Title = \"Documentation\",\n            Uri = new Uri(\"https:\u002F\u002Fdocs.example.com\u002Forders\")\n        }\n    },\n    Contacts =\n    {\n        new ApiContact\n        {\n            Name = \"API Support\",\n            Email = \"api-support@example.com\"\n        }\n    }\n};\n\n\u002F\u002F Add custom metadata\napiData.CustomProperties = BinaryData.FromObjectAsJson(new\n{\n    team = \"orders-team\",\n    costCenter = \"CC-1234\"\n});\n\nArmOperation\u003CApiCenterApiResource> operation = await apis\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"orders-api\", apiData);\n\nApiCenterApiResource api = operation.Value;\n```\n\n### 4. Create API Version\n\n```csharp\nApiCenterApiVersionCollection versions = api.GetApiCenterApiVersions();\n\nApiCenterApiVersionData versionData = new ApiCenterApiVersionData\n{\n    Title = \"v1.0.0\",\n    LifecycleStage = ApiLifecycleStage.Production\n};\n\nArmOperation\u003CApiCenterApiVersionResource> operation = await versions\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"v1-0-0\", versionData);\n\nApiCenterApiVersionResource version = operation.Value;\n```\n\n### 5. Create API Definition (Upload OpenAPI Spec)\n\n```csharp\nApiCenterApiDefinitionCollection definitions = version.GetApiCenterApiDefinitions();\n\nApiCenterApiDefinitionData definitionData = new ApiCenterApiDefinitionData\n{\n    Title = \"OpenAPI Specification\",\n    Description = \"Orders API OpenAPI 3.0 definition\"\n};\n\nArmOperation\u003CApiCenterApiDefinitionResource> operation = await definitions\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"openapi\", definitionData);\n\nApiCenterApiDefinitionResource definition = operation.Value;\n\n\u002F\u002F Import specification\nstring openApiSpec = await File.ReadAllTextAsync(\"orders-api.yaml\");\n\nApiSpecImportContent importContent = new ApiSpecImportContent\n{\n    Format = ApiSpecImportSourceFormat.Inline,\n    Value = openApiSpec,\n    Specification = new ApiSpecImportSpecification\n    {\n        Name = \"openapi\",\n        Version = \"3.0.1\"\n    }\n};\n\nawait definition.ImportSpecificationAsync(WaitUntil.Completed, importContent);\n```\n\n### 6. Export API Specification\n\n```csharp\nApiCenterApiDefinitionResource definition = await client\n    .GetApiCenterApiDefinitionResource(definitionResourceId)\n    .GetAsync();\n\nArmOperation\u003CApiSpecExportResult> operation = await definition\n    .ExportSpecificationAsync(WaitUntil.Completed);\n\nApiSpecExportResult result = operation.Value;\n\n\u002F\u002F result.Format - e.g., \"inline\"\n\u002F\u002F result.Value - the specification content\n```\n\n### 7. Create Environment\n\n```csharp\nApiCenterEnvironmentCollection environments = workspace.GetApiCenterEnvironments();\n\nApiCenterEnvironmentData envData = new ApiCenterEnvironmentData\n{\n    Title = \"Production\",\n    Description = \"Production environment\",\n    Kind = ApiCenterEnvironmentKind.Production,\n    Server = new ApiCenterEnvironmentServer\n    {\n        ManagementPortalUris = { new Uri(\"https:\u002F\u002Fportal.azure.com\") }\n    },\n    Onboarding = new EnvironmentOnboardingModel\n    {\n        Instructions = \"Contact platform team for access\",\n        DeveloperPortalUris = { new Uri(\"https:\u002F\u002Fdeveloper.example.com\") }\n    }\n};\n\nArmOperation\u003CApiCenterEnvironmentResource> operation = await environments\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"production\", envData);\n```\n\n### 8. Create Deployment\n\n```csharp\nApiCenterDeploymentCollection deployments = workspace.GetApiCenterDeployments();\n\n\u002F\u002F Get environment resource ID\nResourceIdentifier envResourceId = ApiCenterEnvironmentResource.CreateResourceIdentifier(\n    subscriptionId, resourceGroupName, serviceName, workspaceName, \"production\");\n\n\u002F\u002F Get API definition resource ID\nResourceIdentifier definitionResourceId = ApiCenterApiDefinitionResource.CreateResourceIdentifier(\n    subscriptionId, resourceGroupName, serviceName, workspaceName, \n    \"orders-api\", \"v1-0-0\", \"openapi\");\n\nApiCenterDeploymentData deploymentData = new ApiCenterDeploymentData\n{\n    Title = \"Orders API - Production\",\n    Description = \"Production deployment of Orders API v1.0.0\",\n    EnvironmentId = envResourceId,\n    DefinitionId = definitionResourceId,\n    State = ApiCenterDeploymentState.Active,\n    Server = new ApiCenterDeploymentServer\n    {\n        RuntimeUris = { new Uri(\"https:\u002F\u002Fapi.example.com\u002Forders\") }\n    }\n};\n\nArmOperation\u003CApiCenterDeploymentResource> operation = await deployments\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"orders-api-prod\", deploymentData);\n```\n\n### 9. Create Metadata Schema\n\n```csharp\nApiCenterMetadataSchemaCollection schemas = service.GetApiCenterMetadataSchemas();\n\nstring jsonSchema = \"\"\"\n{\n    \"type\": \"object\",\n    \"properties\": {\n        \"team\": {\n            \"type\": \"string\",\n            \"title\": \"Owning Team\"\n        },\n        \"costCenter\": {\n            \"type\": \"string\",\n            \"title\": \"Cost Center\"\n        },\n        \"dataClassification\": {\n            \"type\": \"string\",\n            \"enum\": [\"public\", \"internal\", \"confidential\"],\n            \"title\": \"Data Classification\"\n        }\n    },\n    \"required\": [\"team\"]\n}\n\"\"\";\n\nApiCenterMetadataSchemaData schemaData = new ApiCenterMetadataSchemaData\n{\n    Schema = jsonSchema,\n    AssignedTo =\n    {\n        new MetadataAssignment\n        {\n            Entity = MetadataAssignmentEntity.Api,\n            Required = true\n        }\n    }\n};\n\nArmOperation\u003CApiCenterMetadataSchemaResource> operation = await schemas\n    .CreateOrUpdateAsync(WaitUntil.Completed, \"api-metadata\", schemaData);\n```\n\n### 10. List and Search APIs\n\n```csharp\n\u002F\u002F List all APIs in a workspace\nApiCenterWorkspaceResource workspace = await client\n    .GetApiCenterWorkspaceResource(workspaceResourceId)\n    .GetAsync();\n\nawait foreach (ApiCenterApiResource api in workspace.GetApiCenterApis())\n{\n    Console.WriteLine($\"API: {api.Data.Title}\");\n    Console.WriteLine($\"  Kind: {api.Data.Kind}\");\n    Console.WriteLine($\"  Stage: {api.Data.LifecycleStage}\");\n    \n    \u002F\u002F List versions\n    await foreach (ApiCenterApiVersionResource version in api.GetApiCenterApiVersions())\n    {\n        Console.WriteLine($\"  Version: {version.Data.Title}\");\n    }\n}\n\n\u002F\u002F List environments\nawait foreach (ApiCenterEnvironmentResource env in workspace.GetApiCenterEnvironments())\n{\n    Console.WriteLine($\"Environment: {env.Data.Title} ({env.Data.Kind})\");\n}\n\n\u002F\u002F List deployments\nawait foreach (ApiCenterDeploymentResource deployment in workspace.GetApiCenterDeployments())\n{\n    Console.WriteLine($\"Deployment: {deployment.Data.Title}\");\n    Console.WriteLine($\"  State: {deployment.Data.State}\");\n}\n```\n\n## Key Types Reference\n\n| Type | Purpose |\n|------|---------|\n| `ApiCenterServiceResource` | API Center service instance |\n| `ApiCenterWorkspaceResource` | Logical grouping of APIs |\n| `ApiCenterApiResource` | Individual API |\n| `ApiCenterApiVersionResource` | Version of an API |\n| `ApiCenterApiDefinitionResource` | API specification (OpenAPI, etc.) |\n| `ApiCenterEnvironmentResource` | Deployment environment |\n| `ApiCenterDeploymentResource` | API deployment to environment |\n| `ApiCenterMetadataSchemaResource` | Custom metadata schema |\n| `ApiKind` | rest, graphql, grpc, soap, webhook, websocket, mcp |\n| `ApiLifecycleStage` | design, development, testing, preview, production, deprecated, retired |\n| `ApiCenterEnvironmentKind` | development, testing, staging, production |\n| `ApiCenterDeploymentState` | active, inactive |\n\n## Best Practices\n\n1. **Organize with workspaces** — Group APIs by team, domain, or product\n2. **Use metadata schemas** — Define custom properties for governance\n3. **Track lifecycle stages** — Keep API status current (design → production → deprecated)\n4. **Document environments** — Include onboarding instructions and portal URIs\n5. **Version consistently** — Use semantic versioning for API versions\n6. **Import specifications** — Upload OpenAPI\u002FGraphQL specs for discovery\n7. **Link deployments** — Connect APIs to their runtime environments\n8. **Use managed identity** — Enable SystemAssigned identity for secure integrations\n\n## Error Handling\n\n```csharp\nusing Azure;\n\ntry\n{\n    ArmOperation\u003CApiCenterApiResource> operation = await apis\n        .CreateOrUpdateAsync(WaitUntil.Completed, \"my-api\", apiData);\n}\ncatch (RequestFailedException ex) when (ex.Status == 409)\n{\n    Console.WriteLine(\"API already exists with conflicting configuration\");\n}\ncatch (RequestFailedException ex) when (ex.Status == 400)\n{\n    Console.WriteLine($\"Invalid request: {ex.Message}\");\n}\ncatch (RequestFailedException ex)\n{\n    Console.WriteLine($\"Azure error: {ex.Status} - {ex.Message}\");\n}\n```\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.ResourceManager.ApiCenter` | API Center management (this SDK) | `dotnet add package Azure.ResourceManager.ApiCenter` |\n| `Azure.ResourceManager.ApiManagement` | API gateway and policies | `dotnet add package Azure.ResourceManager.ApiManagement` |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| NuGet Package | https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAzure.ResourceManager.ApiCenter |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.resourcemanager.apicenter |\n| Product Documentation | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fapi-center\u002F |\n| GitHub Source | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-net\u002Ftree\u002Fmain\u002Fsdk\u002Fapicenter\u002FAzure.ResourceManager.ApiCenter |\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,94,1711,"2026-05-16 13:06:50",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"44b3c4ee-6ef9-47a6-98b4-1158b7607551","1.0.0","azure-mgmt-apicenter-dotnet.zip",3905,"uploads\u002Fskills\u002F00ffc175-856d-4cd9-acbf-d8ed45c5fca2\u002Fazure-mgmt-apicenter-dotnet.zip","5f5e86edcd0c71ad39549e2f23e85b274e10e3483f34358a4e316fb97b5d8199","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":12964}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]