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 :doc:`/scenarios/customertenants-get` - Find your azure plan id *GET https://api.crayon.com/api/v1/customertenants/{customerTenantId}/azureplan/* Request ^^^^^^^ Request Syntax: +---------+--------------------------------------------------------------------------------------------+ | Method | Request URI | +=========+============================================================================================+ | GET | *https://api.crayon.com/api/v1/azureplans/{azurePlanId}/azuresubscriptions/* | +---------+--------------------------------------------------------------------------------------------+ 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 :doc:`/resources/AzurePlanEntitlementCollection` resource in the response body. Response Body: .. literalinclude:: /resources/_static/AzurePlanEntitlementCollection.json :language: json 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. | +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+