Get Azure Subscriptions (Entitlements)

Get Azure Subscriptions (Entitlements) under the specific Azure Plan.

Prerequisites

  • An Azure Plan is a container for Azure Subscriptions.

  • When an Azure Plan is created (one per tenant), Microsoft automatically provisions a default Azure Subscription (also referred to as an Entitlement).

  • Find a customer tenant that is connected to Azure Plan

  • Find your azure plan id

GET https://api.crayon.com/api/v1/customertenants/{customerTenantId}/azureplan/

Request

Request Syntax:

Request Example:

GET $"https://api.crayon.com/api/v1/azureplans/{azurePlanId:int}/azuresubscriptions/"
Accept: application/json
Content-Type: application/json
Authorization: Bearer < Token >

Response

If successful, this method returns a AzurePlanEntitlementCollection resource in the response body.

Response Body:

{
    "Items": [
        {
            "InvoiceProfile": null,
            "Id": 3004,
            "AzurePlanId": 17124,
            "PublisherSubscriptionId": "00000000-0000-0000-0000-000000000000",
            "FriendlyName": "FriendlyName1",
            "Status": "active",
            "Tags": null
        },
        {
            "InvoiceProfile": null,
            "Id": 2854,
            "AzurePlanId": 17124,
            "PublisherSubscriptionId": "00000000-0000-0000-0000-000000000000",
            "FriendlyName": "FriendlyName2",
            "Status": "deleted",
            "Tags": null
        },
        {
            "InvoiceProfile": null,
            "Id": 2979,
            "AzurePlanId": 17124,
            "PublisherSubscriptionId": "00000000-0000-0000-0000-000000000000",
            "FriendlyName": "FriendlyName3",
            "Status": "active",
            "Tags": null
        }
    ],
    "TotalHits": 3
}

Response success and error codes:

Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters.

Error Codes

Description

202 Accepted

The request has succeeded.

401 Unauthorized

The request requires user authentication. If the request already included Authorization credentials, then the 401 (Unauthorized) status code means that authorization has been refused for those credentials. It is a non-retryable error condition.

404 Not Found

Azure subscriptions not found.

500 Internal Server Error

Azure Subscriptions fetching failed. Indicates that a generic error has occurred on the server.