Windows Azure - 以编程方式创建订阅

时间:2014-02-19 11:54:25

标签: azure

有没有办法创建新订阅并以编程方式将其添加到Windows Azure帐户?

目标是拥有一个Web应用程序,用户可以在其中注册和部署一组虚拟机(自动)。 Web应用程序应使用现有的Windows Azure帐户并为其添加新订阅,然后使用该订阅为新用户部署计算机。

有关实施此建议的任何建议,而无需手动访问管理门户并添加新订阅吗?

5 个答案:

答案 0 :(得分:1)

没有用于创建订阅的REST API或任何其他编程方法。订阅包含相关的安全检查,具体计划,付款方式等。此部分必须通过windowsazure.com门户网站完成。

一旦完成,您可以以编程方式创建云服务,部署VM(基于图库图像或您自己的自定义图像),以及其他任何内容。

答案 1 :(得分:0)

必须通过门户网站创建订阅。其他所有内容都可以通过Azure Service Management apis完成。

答案 2 :(得分:0)

看起来Azure已经计划好了,但我很难找到有关此问题的任何进一步细节。 2016年6月按计划回复提及的管理员。没有进一步的细节。

https://feedback.azure.com/forums/170030-signup-and-billing/suggestions/13117482-api-for-creating-accounts-and-subscriptions

答案 3 :(得分:0)

Microsoft合作伙伴中心具有用于创建Azure订阅的API:

IAggregatePartner partnerOperations;
string customerId;
string offerId;

var order = new Order()
{
    ReferenceCustomerId = customerId,
    LineItems = new List<OrderLineItem>()
    {
        new OrderLineItem()
        {
            OfferId = offerId,
            FriendlyName = "new offer purchase",
            Quantity = 5
        }
    }
};

var createdOrder = partnerOperations.Customers.ById(customerId).Orders.Create(order);

来源:https://docs.microsoft.com/en-us/azure/cloud-solution-provider/integration/manage-customers/add-subscriptions#c

有关合作伙伴中心计划的更多信息,请访问:https://partnercenter.microsoft.com/en-us/partner/home

答案 4 :(得分:0)

在发表评论时,支持创建订阅作为企业协议(EA)的预览API / Powershell / CLI

https://docs.microsoft.com/en-us/azure/azure-resource-manager/programmatically-create-subscription?tabs=rest

POST https://management.azure.com/providers/Microsoft.Billing/enrollmentAccounts/747ddfe5-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Subscription/createSubscription?api-version=2018-03-01-preview

{
  "displayName": "Dev Team Subscription",
  "offerType": "MS-AZR-0017P",
  "owners": [
    {
      "objectId": "<userObjectId>"
    },
    {
      "objectId": "<servicePrincipalObjectId>"
    }
  ]
}

注意:使用API​​创建的订阅数/帐户数限制为50

相关问题