Provision Azure Plan ==================== Prerequisites ^^^^^^^^^^^^^ - Find a customer tenant the Azure Plan should be added to :doc:`/scenarios/customertenants-get` - You need to have signed the Microsoft Customer Agreement. :doc:`/scenarios/customertenantagreement-create` Limits ^^^^^^ - You can only have one Azure Plan per Customer Tenant - You can not provision Azure Plan if you already have Azure Subscriptions. Then you need to contact Crayon in order to enable this functionality. Request ^^^^^^^ To provision Azure Plan you use endpoint for creating subscription, but use a specific PartNumber: **DZH318Z0BPS6:0001**. More information on how to create subscriptions can be found here: :doc:`/scenarios/subscription-create` C# ^^ .. code-block:: c# :emphasize-lines: 21 var subscription = new SubscriptionDetailed { Name = "My Azure Plan", Quantity = 1, CustomerTenant = new CustomerTenantReference { Id = }, Organization = new ObjectReference { Id = }, Product = new ProductReference { PartNumber = "DZH318Z0BPS6:0001" //DZH318Z0BPS6:0001 = AzurePlan } }; var client = new CrayonApiClient("https://api.crayon.com/"); var token = client.Tokens.GetUserToken(clientId, clientSecret, userName, password).GetData().AccessToken; var result = client.Subscriptions.Create(token, subscription); Request ^^^^^^^ Request Syntax: +---------+--------------------------------------------------+ | Method | Request URI | +=========+==================================================+ | POST | *https://api.crayon.com/api/v1/subscriptions/* | +---------+--------------------------------------------------+ Request Example: :: POST $"https://api.crayon.com/api/v1/subscriptions/" Accept: application/json Content-Type: application/json Authorization: Bearer < Token > Request Body: .. literalinclude:: /scenarios/_static/SubscriptionAzurePlanRequest.json :language: json Response ^^^^^^^^ If successful, this method returns the created subscription as a :doc:`/resources/SubscriptionDetailed` resource in the response body. PublisherSubscriptionID of AzurePlan-subscription will be pending and state will be set to suspended until subscription is fully functional and will automatically transition to Active when ready. An azure subscription entitlement will also automatically be created. Response Body: .. literalinclude:: /resources/_static/SubscriptionDetailedAzurePlan.json :language: json