首页 > 解决方案 > 如何通过 C# 创建 Azure API 管理实例?

问题描述

我一直在使用 Microsoft.Azure.Management.Fluent 包来创建一个工具来构建我的环境并进行一些额外的设置。现在,我需要添加一个 API 管理实例。我在 Fluent SDK 中看不到任何与 API 管理相关的内容。我假设它没有 SDK 包装器,我只需要自己调用 REST。我在找向导。

标签: azureazure-api-management

解决方案


目前,API ManagementFluent api. 这是一个关于此的问题

相反,还有另一个包Microsoft.Azure.Management.ApiManagement 6.0.0-preview,您可以使用它来创建API Management instance. 如下代码:

        // you should provide the real credentialhere.
        ApiManagementClient client = new ApiManagementClient(the_credential);

        //provide the neccesary parameters to create the APIM instance.
        client.ApiManagementService.CreateOrUpdate(the_parameters);

另一种创建API Management方法是使用此 api:Api Management Service - Create Or Update。您可以阅读 api 文档以了解其用法和示例。


推荐阅读