microsoft/skills

azure-mgmt-apimanagement-dotnet

用 .NET ARM SDK 配置 APIM 网关服务、API、产品和策略

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

azure-mgmt-apimanagement-dotnet 是什么?

这个 Skill 使用 Azure.ResourceManager.ApiManagement 管理 APIM control plane 资源:服务、API、产品、订阅、policy、用户、后端等。它不直接代表对 gateway 的数据面调用,也不负责业务后端逻辑。

中文说明由本站依据来源整理;英文原文保留在页面下方。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 azure-mgmt-apimanagement-dotnet,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 azure-mgmt-apimanagement-dotnet

请在 Codex 的当前工作环境中安装并检查 azure-mgmt-apimanagement-dotnet 这个 Skill。

项目身份:microsoft/skills / azure-mgmt-apimanagement-dotnet
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-apimanagement-dotnet/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-apimanagement-dotnet/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 安装 Azure.ResourceManager.ApiManagement 和 Azure.Identity,配置订阅并取得正确 ARM 权限。
  • 在创建 APIM service 前确认 SKU、区域、网络、容量、预算和所需等待时间;开发者 SKU 与生产可用性不能混为一谈。
  • 准备经过审查的 policy XML、backend URI 和发布产品设置;所有资源 ID、scope 都需指向预期实例。

实际使用顺序

  1. 先读取现有 APIM service、API、product 与策略,确认要新增还是更新。
  2. 创建 API Management service 属于长时间资源操作;运行前确认名称、SKU、区域和容量,等待服务就绪。
  3. 再配置 API/backend、产品订阅与策略,检查 policy XML 和作用范围;低风险先在测试 service 验证。
  4. 如果要取 subscription secrets,仅按最小权限调用并安全传递,禁止写日志;备份/恢复前验证目标 storage 和服务。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

请用此 Skill 为已存在 APIM 服务制作只读盘点代码草案,列出现有API、产品名和关联策略,不创建服务、订阅或密钥,也不改policy。
预期结果

得到只读资源盘点方案;没有发生 ARM 写操作。

使用前先看这些限制

使用条件与边界

  • 此 SDK 是管理面。网关上的业务请求、运行时响应和后端数据属于数据面。
  • Create service、policy、subscription、backup/restore 会改变生产环境;源文示例返回的主密钥是敏感信息。
  • 源文中 Developer SKU 没有生产 SLA;SKU与容量选择要根据当前产品条件确认。
针对这个 Skill 的疑问

常见问题

我想从代码调用后端API,这个SDK适合吗?

通常不是;此管理SDK用于配置 APIM 资源。实际调用网关 endpoint 属于数据面请求。

创建service为什么要很久?

APIM服务资源部署是长时ARM操作,示例提到可能超过30分钟。应由作业系统跟踪状态,而不要把请求提交成功当作已就绪。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-apimanagement-dotnet/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

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".

查看源文件章节 / Source sections
  • 原文:Azure.ResourceManager.ApiManagement (.NET)
  • 安装 / Installation
  • 原文:Environment Variables
  • 原文:Authentication
  • 原文:Resource Hierarchy
  • 原文:Core Workflow
  • 原文:1. Create API Management Service
  • 原文:2. Create an API
  • 原文:3. Create a Product
  • 原文:4. Create a Subscription
  • 原文:5. Set API Policy
  • 原文:6. Backup and Restore
  • 原文:Key Types Reference
  • 原文:SKU Types
  • 原文:Best Practices
  • 原文:Error Handling
  • 原文:Reference Files
  • 原文:Related Resources
原文:Azure.ResourceManager.ApiManagement (.NET)

Management plane SDK for provisioning and managing Azure API Management resources via Azure Resource Manager. > **⚠️ Management vs Data Plane** > - **This SDK (Azure.ResourceManager.ApiManagement)**: Create services, APIs, products, subscriptions, policies, users, groups > - **Data Plane**: Direct API calls to your APIM gateway endpoints

安装 / Installation

```bash dotnet add package Azure.ResourceManager.ApiManagement dotnet add package Azure.Identity ``` **Current Version**: v1.3.0

原文:Environment Variables

```bash AZURE_SUBSCRIPTION_ID=<your-subscription-id> # Required: Azure subscription ID AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production AZURE_TENANT_ID=<tenant-id> # For service principal auth (optional) AZURE_CLIENT_ID=<client-id> # For service principal auth (optional) AZURE_CLIENT_SECRET=<client-secret> # For service principal auth (optional) ```

原文:Authentication

```csharp using Azure.Identity; using Azure.ResourceManager; using Azure.ResourceManager.ApiManagement; // Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential> var credential = new DefaultAzureCredential( DefaultAzureCredential.DefaultEnvironmentVariableName ); // Or use a specific credential directly in production: // See https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes // var credential = new ManagedIdentityCredential(); var armClient = new ArmClient(credential); // Get subscription var subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID"); var subscription = armClient.GetSubscriptionResource( new ResourceIdentifier($"/subscriptions/{subscriptionId}")); ```

原文:Resource Hierarchy

``` ArmClient └── SubscriptionResource └── ResourceGroupResource └── ApiManagementServiceResource ├── ApiResource │ ├── ApiOperationResource │ │ └── ApiOperationPolicyResource │ ├── ApiPolicyResource │ ├── ApiSchemaResource │ └── ApiDiagnosticResource ├── ApiManagementProductResource │ ├── ProductApiResource │ ├── ProductGroupResource │ └── ProductPolicyResource ├── ApiManagementSubscriptionResource ├── ApiManagementPolicyResource ├── ApiManagementUserResource ├── ApiManagementGroupResource ├── ApiManagementBackendResource ├── ApiManagementGatewayResource ├── ApiManagementCertificateResource ├── ApiManagementNamedValueResource └── ApiManagementLoggerResource ```

原文:1. Create API Management Service

```csharp using Azure.ResourceManager.ApiManagement; using Azure.ResourceManager.ApiManagement.Models; // Get resource group var resourceGroup = await subscription .GetResourceGroupAsync("my-resource-group"); // Define service var serviceData = new ApiManagementServiceData( location: AzureLocation.EastUS, sku: new ApiManagementServiceSkuProperties( ApiManagementServiceSkuType.Developer, capacity: 1), publisherEmail: "admin@contoso.com", publisherName: "Contoso"); // Create service (long-running operation - can take 30+ minutes) var serviceCollection = resourceGroup.Value.GetApiManagementServices(); var operation = await serviceCollection.CreateOrUpdateAsync( WaitUntil.Completed, "my-apim-service", serviceData); ApiManagementServiceResource service = operation.Value; ```

文件 SHA256:71718aef3ae2343f90c9db33dee8ed9cbe146e66128c624cac069bf23d2083fe

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

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".

查看历史简介来源

历史收录数据

来源仓库microsoft/skills
Skill源路径.github/plugins/azure-sdk-dotnet/skills/azure-mgmt-apimanagement-dotnet/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源